Cleanup installation manual (#1757)

Cleanup installation manual
This commit is contained in:
John Molakvoæ
2020-01-02 17:42:43 +01:00
committed by GitHub
6 changed files with 379 additions and 451 deletions

View File

@@ -129,19 +129,6 @@ To start the MySQL command line mode use::
Then a **mysql>** or **MariaDB [root]>** prompt will appear. Now enter the following lines and confirm them with the enter key:
::
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS nextcloud;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON nextcloud.* TO 'username'@'localhost' IDENTIFIED BY 'password';
FLUSH privileges;
You can quit the prompt by entering::
quit
If you prefer UTF8MB4 as your database collation setting:
::
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

View File

@@ -0,0 +1,220 @@
.. _centos7_installation_label:
Example installation on CentOS 8
================================
In this install tutorial we will be deploying CentOS 8, PHP 7.2, MariaDB, Redis as memcache and Nextcloud running on Apache.
Start off by installing a CentOS 8 minimal install. This should provide a sufficient platform to run a successful Nextcloud instance.
First install some dependencies you will be needing during installation, but which will also be useful in every day use situations::
yum install -y epel-release yum-utils unzip curl wget \
bash-completion policycoreutils-python-utils mlocate bzip2
Now make sure your system is up to date::
yum update -y
Apache
------
::
yum install -y httpd
See :ref:`apache-web-server-configuration` for details.
Make sure the apache web service is enabled and started::
systemctl enable httpd.service
systemctl start httpd.service
PHP
---
.. note:: CentOS 8 doesn't come with packages for the redis and imagick php extensions.
Those can either be installed using pecl. Apart from the official PHP packages there are 3rdparty
repositories available at ``https://rpms.remirepo.net``. Using remirepo you can also install the
latest PHP version instead of the standard shipped one.
Setting up remirepo with PHP 7.4
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
More details can be found on ``https://blog.remirepo.net/pages/Config-en``
Command to install the EPEL repository configuration package:
::
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Command to install the Remi repository configuration package:
::
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
Command to install the yum-utils package (for the yum-config-manager command):
::
dnf install yum-utils
You want a single version which means replacing base packages from the distribution. Packages have the same name than the base repository, ie php-*. Some common dependencies are available in remi-safe repository, which is enabled by default.
You have to enable the module stream for 7.4:
::
dnf module reset php
dnf module install php:remi-7.4
dnf update
Installing PHP and the required modules
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Next install the PHP modules needed for this install. Remember, because this is a limited basic install, we only install the neccessary modules, not all of them. If you are making a more complete install, please refer to PHP module list at the top of this page.::
yum install -y php php-gd php-mbstring php-intl \
php-pecl-apcu php-mysqlnd php-opcache php-json php-zip
Manually building redis/imagick (optional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
yum install -y php-pear gcc curl-devel php-devel zlib-devel pcre-devel make
pecl install redis
yum config-manager --set-enabled PowerTools
yum install -y Imagemagick ImageMagick-devel
pecl install imagick
After installing the extensions make sure to load the extensions in your php.ini file with:
extension=redis.so
extension=imagick.so
Database
--------
As mentioned, we will be using MySQL/MariaDB as our database.::
yum install -y mariadb mariadb-server
Make sure the database service is enabled to start at boot time.::
systemctl enable mariadb.service
systemctl start mariadb.service
Improve MariaDB security.::
mysql_secure_installation
After you have done this, make sure you create a database with a username and password so that
Nextcloud will have access to it. For further details on database setup and configuration,
see the :doc:`../configuration_database/linux_database_configuration` documentation.
Redis
-----
::
yum install -y redis
systemctl enable redis.service
systemctl start redis.service
**Installing Nextcloud**
Nearly there, so keep at it, you are doing great!
Now download the archive of the latest Nextcloud version:
* Go to the `Nextcloud Download Page <https://nextcloud.com/install>`_.
* Go to **Download Nextcloud Server > Download > Archive file for
server owners** and download either the tar.bz2 or .zip archive.
* This downloads a file named nextcloud-x.y.z.tar.bz2 or nextcloud-x.y.z.zip
(where x.y.z is the version number).
* Download its corresponding checksum file, e.g. nextcloud-x.y.z.tar.bz2.md5,
or nextcloud-x.y.z.tar.bz2.sha256.
* Verify the MD5 or SHA256 sum::
md5sum -c nextcloud-x.y.z.tar.bz2.md5 < nextcloud-x.y.z.tar.bz2
sha256sum -c nextcloud-x.y.z.tar.bz2.sha256 < nextcloud-x.y.z.tar.bz2
md5sum -c nextcloud-x.y.z.zip.md5 < nextcloud-x.y.z.zip
sha256sum -c nextcloud-x.y.z.zip.sha256 < nextcloud-x.y.z.zip
* You may also verify the PGP signature::
wget https://download.nextcloud.com/server/releases/nextcloud-x.y.z.tar.bz2.asc
wget https://nextcloud.com/nextcloud.asc
gpg --import nextcloud.asc
gpg --verify nextcloud-x.y.z.tar.bz2.asc nextcloud-x.y.z.tar.bz2
For the sake of the walk-through, we grabbed the latest version of Nextcloud in the form a zip file, confirmed the download with the above-mentioned command, and now we will extract it::
unzip nextcloud-*.zip
Copy the content over to the root directory of your webserver. In our case, we are using apache so it will be ``/var/www/html/``::
cp -R nextcloud/ /var/www/html/
During the install process, no data folder is created, so we will create one manually to help with the installation wizard::
mkdir /var/www/html/nextcloud/data
Make sure that apache has read and write access to the whole nextcloud folder::
chown -R apache:apache /var/www/html/nextcloud
Restart apache::
systemctl restart httpd.service
Create a firewall rule for access to apache::
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload
**SELinux**
Again, there is an extensive write-up done on SELinux which can be found at :doc:`../installation/selinux_configuration`, so if you are using SELinux in Enforcing mode, please run the commands suggested on that page.
The following commands only refers to this tutorial::
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.htaccess'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.user.ini'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/3rdparty/aws/aws-sdk-php/src/data/logs(/.*)?'
restorecon -R '/var/www/html/nextcloud/'
setsebool -P httpd_can_network_connect on
If you need more SELinux configs, refer to the above-mentioned URL, return to this tutorial.
Once done with with SELinux, please head over to ``http://your.server.com/nextcloud`` and follow the steps as found :doc:`../installation/installation_wizard`, where it will explain to you exactly how to proceed with the final part of the install, which is done as admin user through your web browser.
.. note:: If you use this tutorial, and you see warnings in the web browser after installation about ``OPcache`` not being enabled or configured correctly, you need to make the suggested changes in ``/etc/opt/rh/rh-php72/php.d/10-opcache.ini`` for the errors to disappear. These warnings will be on the Admin page, under Basic settings.
Because we used ``Redis`` as a memcache, you will need a config similar to the following example in ``/var/www/html/nextcloud/config/config.php`` which is auto-generated when you run the online installation wizard mentioned earlier.
Example config::
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\APCu',
'redis' => array(
'host' => 'localhost',
'port' => 6379,
),
Remember, this tutorial is only for a basic setup of Nextcloud on CentOS 8, with PHP 7.2. If you are going to use more features like LDAP or Single Sign On, you will need additional PHP modules as well as extra configurations. So please visit the rest of the Admin manual, :doc:`../index`, for detailed descriptions on how to get this done.

View File

@@ -0,0 +1,69 @@
.. _ubuntu_installation_label:
Example installation on Ubuntu 18.04 LTS
========================================
Or you can use .deb packages to install the required and recommended modules for a typical Nextcloud
installation, using Apache and MariaDB, by issuing the following commands in a
terminal::
apt-get install apache2 mariadb-server libapache2-mod-php7.2
apt-get install php7.2-gd php7.2-json php7.2-mysql php7.2-curl php7.2-mbstring
apt-get install php7.2-intl php-imagick php7.2-xml php7.2-zip
* This installs the packages for the Nextcloud core system.
``libapache2-mod-php7.2`` provides the following PHP extensions::
bcmath bz2 calendar Core ctype date dba dom ereg exif fileinfo filter ftp gettext
hash iconv libxml mhash openssl pcre Phar posix Reflection session shmop SimpleXML
soap sockets SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xmlreader xmlwriter zlib
If you are planning on running additional apps, keep in mind that they might require additional
packages. See :ref:`prerequisites_label` for details.
* At the installation of the MySQL/MariaDB server, you will be prompted to
create a root password. Be sure to remember your password as you will need it
during Nextcloud database setup.
Now download the archive of the latest Nextcloud version:
* Go to the `Nextcloud Download Page <https://nextcloud.com/install>`_.
* Go to **Download Nextcloud Server > Download > Archive file for
server owners** and download either the tar.bz2 or .zip archive.
* This downloads a file named nextcloud-x.y.z.tar.bz2 or nextcloud-x.y.z.zip
(where x.y.z is the version number).
* Download its corresponding checksum file, e.g. nextcloud-x.y.z.tar.bz2.md5,
or nextcloud-x.y.z.tar.bz2.sha256.
* Verify the MD5 or SHA256 sum::
md5sum -c nextcloud-x.y.z.tar.bz2.md5 < nextcloud-x.y.z.tar.bz2
sha256sum -c nextcloud-x.y.z.tar.bz2.sha256 < nextcloud-x.y.z.tar.bz2
md5sum -c nextcloud-x.y.z.zip.md5 < nextcloud-x.y.z.zip
sha256sum -c nextcloud-x.y.z.zip.sha256 < nextcloud-x.y.z.zip
* You may also verify the PGP signature::
wget https://download.nextcloud.com/server/releases/nextcloud-x.y.z.tar.bz2.asc
wget https://nextcloud.com/nextcloud.asc
gpg --import nextcloud.asc
gpg --verify nextcloud-x.y.z.tar.bz2.asc nextcloud-x.y.z.tar.bz2
* Now you can extract the archive contents. Run the appropriate unpacking
command for your archive type::
tar -xjf nextcloud-x.y.z.tar.bz2
unzip nextcloud-x.y.z.zip
* This unpacks to a single ``nextcloud`` directory. Copy the Nextcloud directory
to its final destination. When you are running the Apache HTTP server you may
safely install Nextcloud in your Apache document root::
cp -r nextcloud /path/to/webserver/document-root
where ``/path/to/webserver/document-root`` is replaced by the
document root of your Web server::
cp -r nextcloud /var/www
On other HTTP servers it is recommended to install Nextcloud outside of the
document root.

View File

@@ -11,8 +11,10 @@ Installation and server configuration
installation_wizard
command_line_installation
apps_supported
php_72_installation
selinux_configuration
nginx
harden_server
server_tuning
example_ubuntu
example_centos

View File

@@ -1,114 +0,0 @@
=========================================
Installing PHP 7.2 on RHEL 7 and CentOS 7
=========================================
PHP 5.4 has been end-of-life since September 2015 and is no longer supported by the PHP team. RHEL 7 still ships with PHP 5.4, and Red Hat supports it. However, seeing as PHP 7.0 has also now reached EOL, and from Nextcloud 14 onwards the Nextcloud team suggests using PHP 7.1+, it is strongly advised to upgrade your PHP version to 7.2.
RHEL 7 Upgrade to PHP 7.2
-------------------------
To upgrade to PHP 7.2, you must use the Software Collections (SCL) repository to be in compliance with your RHEL support contract, and not any other third-party repository. Follow these steps to install PHP 7.2 from SCL. First you must use your Subscription Manager to enable SCL::
subscription-manager repos --enable rhel-server-rhscl-7-eus-rpms
Then install PHP 7.2 and these modules::
yum install rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl rh-php72-php-pecl-apcu
You must also install the updated database module for your database. This installs the new PHP 7.2 module for MySQL/MariaDB::
yum install rh-php72-php-mysqlnd
If you are using the Nextcloud LDAP app, you need this module::
yum install rh-php72-php-ldap
Disable loading the old PHP Apache modules by changing their names, for example::
mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php54.off
mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php54.off
Note: change your version number in the above command to correspond to the current php
version installed, for example "php70.off"
Symlink the PHP 7.2 Apache modules into place::
ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/
ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/
ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/
Then restart Apache::
systemctl restart httpd.service
Verify with ``phpinfo`` that your Apache server is using PHP 7.2 and loading the
correct modules; see :ref:`label-phpinfo` to learn how to use ``phpinfo``.
If there is no requirement for your old PHP installation, you can remove it::
yum remove php*
rm /etc/httpd/conf.modules.d/10-php54.off /etc/httpd/conf.d/php54.off
After uninstalling, you can symlink the PHP 7.2 binary to use the short path (e.g. for cron)::
ln -s /opt/rh/rh-php72/root/usr/bin/php /usr/bin/php
Any changes to the configuration of the previous used php installation don't apply to the new installation. Required changes for the new installation can be configured here::
/etc/opt/rh/rh-php72/
CentOS 7 Upgrade to PHP 7.2
---------------------------
To upgrade to PHP 7.2, use the Red Hat Software Collections (SCL) repository.
Follow these steps to install PHP 7.2 from SCL. First install the SCL repository::
yum install centos-release-scl
Then install PHP 7.2 and these modules::
yum install rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl rh-php72-php-pecl-apcu
You must also install the updated database module for your database. This installs the new PHP 7.2 module for MySQL/MariaDB::
yum install rh-php72-php-mysqlnd
If you are using the Nextcloud LDAP app, you need this module::
yum install rh-php72-php-ldap
Disable loading the old PHP Apache modules by changing their names, for example::
mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php54.off
mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php54.off
Note: change your version number in the above command to correspond to the current php
version installed, for example "php70.off"
Symlink the PHP 7.2 Apache modules into place::
ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/
ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/
ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/
Then restart Apache::
systemctl restart httpd.service
Verify with ``phpinfo`` that your Apache server is using PHP 7.2 and loading the
correct modules; see :ref:`label-phpinfo` to learn how to use ``phpinfo``.
If there is no requirement for your old PHP installation, you can remove it::
yum remove php*
rm /etc/httpd/conf.modules.d/10-php54.off /etc/httpd/conf.d/php54.off
After uninstalling, you can symlink the PHP 7.2 binary to use the short path (e.g. for cron)::
ln -s /opt/rh/rh-php72/root/usr/bin/php /usr/bin/php
Any changes to the configuration of the previous used php installation don't apply to the new installation. Required changes for the new installation can be configured here::
/etc/opt/rh/rh-php72/

View File

@@ -2,89 +2,23 @@
Installation on Linux
=====================
If there are no packages for your Linux distribution, you have the option to
install `Snap Packages <http://snapcraft.io/docs/core/install/>`_. See
:ref:`snaps_label`
In case you prefer installing from the source tarball, you can setup Nextcloud
from scratch using a classic LAMP stack (Linux, Apache, MySQL/MariaDB, PHP).
This document provides a complete walk-through for installing Nextcloud on
Ubuntu 18.04 LTS Server with Apache and MariaDB, using `the Nextcloud .tar
archive <https://nextcloud.com/install/>`_.
archive <https://nextcloud.com/install/>`_. This method is recommended to install Nextcloud.
.. note:: Admins of SELinux-enabled distributions such as CentOS, Fedora, and
Red Hat Enterprise Linux may need to set new rules to enable installing
Nextcloud. See :ref:`selinux_tips_label` for a suggested configuration.
You can also use the `Nextcloud VM scripts <https://github.com/nextcloud/vm/>`_ to install directly on a clean Ubuntu Server. It will setup everything for you and include scripts for automated installation of apps like; Collabora, OnlyOffice, Talk and so on.
.. _vm_label:
Installing on Windows (virtual machine)
---------------------------------------
If you are using Windows, the easiest way to get Nextcloud up and running is
using a virtual machine (VM). There are two options:
* **Enterprise/SME appliance**
Nextcloud GmbH maintains a free appliance built on the
`Univention Corporate Server (UCS) <https://www.univention.com/products/univention-app-center/app-catalog/nextcloud/>`_
with easy graphical setup and web-based administration. It includes user
management via LDAP, can replace an existing Active Directory setup and
has optional ONLYOFFICE and Collabora Online integration, with many more applications
available for easy and quick install.
It can be installed on hardware or run in a virtual machine using VirtualBox,
VMWare (ESX) and KVM images.
Download the the Appliance here:
- `Univention Corporate Server (UCS) <https://www.univention.com/products/univention-app-center/app-catalog/nextcloud/>`_
If you prefer a more automated installation of Nextcloud and there are no packages for your Linux distribution, you have the option to
install the community `Snap Packages <http://snapcraft.io/docs/core/install/>`_. See
:ref:`snaps_label` You can also use the `Nextcloud VM scripts <https://github.com/nextcloud/vm/>`_ to install directly on a clean Ubuntu Server. It will setup everything for you and include scripts for automated installation of apps like; Collabora, OnlyOffice, Talk and so on. Please note that those two options are not officially supported by Nextcloud GmbH.
* **Home User/SME appliance**
The `Nextcloud VM`_ is maintained by
`T&M Hansson IT <https://www.hanssonit.se/nextcloud-vm/>`_ and several different versions are
offered. Collabora, OnlyOffice, Full Text Search and other apps can easily be installed with the included scripts which you can choose to run during the first setup, or download them later and run it afterwards. You can find all the currently available automated app installations `on GitHub <https://github.com/nextcloud/vm/tree/master/apps/>`_.
The VM is made with VMware version 10 and it comes in different sizes and versions:
- 40 GB (VMware, VirtualBox, Hyper-V)
- 500 GB (VMware, VirtualBox, Hyper-V)
- 1 TB (VMware, VirtualBox, Hyper-V)
- 2 TB (VMware & VirtualBox, Hyper-V)
- Custom size? Please `ask us <https://www.hanssonit.se/#contact>`_.
You can find all the different version `here <https://shop.hanssonit.se/product-category/virtual-machine/nextcloud-vm/>`_.
For complete instructions and downloads see:
- `Nextcloud VM (Github) <https://github.com/nextcloud/vm/>`_
- `Nextcloud VM (T&M Hansson IT) <https://www.hanssonit.se/nextcloud-vm/>`_
.. note:: You can install the VM on several different operating systems as long as you can mount OVA, VMDK, or VHD/VHDX VM in your hypervisor. If you are using KVM then you need to install the VM from the scripts on Github. You can follow the `instructions in the README <https://github.com/nextcloud/vm#build-your-own-vm-or-install-on-a-vps>`_.
.. _snaps_label:
Installing via Snap packages
----------------------------
A snap is a zip file containing an application together with its dependencies,
and a description of how it should safely be run on your system, especially
the different ways it should talk to other software. Most importantly snaps are
designed to be secure, sandboxed, containerized applications isolated from the
underlying system and from other applications.
To install the Nextcloud Snap Package, run the following command in a terminal::
sudo snap install nextcloud
.. note:: The `snapd technology <http://snapcraft.io/docs/core/>`_ is the core
that powers snaps, and it offers a new way to package, distribute, update and
run OS components and applications on a Linux system. See more about snaps on
`snapcraft.io <http://snapcraft.io/>`_.
This installation guide is giving a general overview of required dependencies and their configuration. For a distribution specific setup guide have a look at the :doc:`./example_ubuntu` and :doc:`./example_centos`.
.. _prerequisites_label:
@@ -171,258 +105,6 @@ SabreDAV.
If ``mod_webdav`` is enabled you must disable it for Nextcloud. (See
:ref:`apache_configuration_label` for an example configuration.)
.. _ubuntu_installation_label:
Example installation on Ubuntu 18.04 LTS server
-----------------------------------------------
On a machine running a pristine Ubuntu 18.04 LTS server, you have three options:
**Bash scripts**
One of the easiest ways of installing is to use the Nextcloud VM scripts. It's basically just two steps:
1. Download the latest `installation script <https://github.com/nextcloud/vm/blob/master/nextcloud_install_production.sh/>`_.
2. Run the script with::
sudo bash nextcloud_install_production.sh
A guided setup will follow and the only thing you have to do it to follow the on screen instructions, when given to you.
**Snap package**
Another very easy way is to install the Nextcloud `Snap Package <http://snapcraft.io/>`_, just run the
following command in a terminal::
sudo snap install nextcloud
**Debian packages**
Or you can use .deb packages to install the required and recommended modules for a typical Nextcloud
installation, using Apache and MariaDB, by issuing the following commands in a
terminal::
apt-get install apache2 mariadb-server libapache2-mod-php7.2
apt-get install php7.2-gd php7.2-json php7.2-mysql php7.2-curl php7.2-mbstring
apt-get install php7.2-intl php-imagick php7.2-xml php7.2-zip
* This installs the packages for the Nextcloud core system.
``libapache2-mod-php7.2`` provides the following PHP extensions::
bcmath bz2 calendar Core ctype date dba dom ereg exif fileinfo filter ftp gettext
hash iconv libxml mhash openssl pcre Phar posix Reflection session shmop SimpleXML
soap sockets SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xmlreader xmlwriter zlib
If you are planning on running additional apps, keep in mind that they might require additional
packages. See :ref:`prerequisites_label` for details.
* At the installation of the MySQL/MariaDB server, you will be prompted to
create a root password. Be sure to remember your password as you will need it
during Nextcloud database setup.
Now download the archive of the latest Nextcloud version:
* Go to the `Nextcloud Download Page <https://nextcloud.com/install>`_.
* Go to **Download Nextcloud Server > Download > Archive file for
server owners** and download either the tar.bz2 or .zip archive.
* This downloads a file named nextcloud-x.y.z.tar.bz2 or nextcloud-x.y.z.zip
(where x.y.z is the version number).
* Download its corresponding checksum file, e.g. nextcloud-x.y.z.tar.bz2.md5,
or nextcloud-x.y.z.tar.bz2.sha256.
* Verify the MD5 or SHA256 sum::
md5sum -c nextcloud-x.y.z.tar.bz2.md5 < nextcloud-x.y.z.tar.bz2
sha256sum -c nextcloud-x.y.z.tar.bz2.sha256 < nextcloud-x.y.z.tar.bz2
md5sum -c nextcloud-x.y.z.zip.md5 < nextcloud-x.y.z.zip
sha256sum -c nextcloud-x.y.z.zip.sha256 < nextcloud-x.y.z.zip
* You may also verify the PGP signature::
wget https://download.nextcloud.com/server/releases/nextcloud-x.y.z.tar.bz2.asc
wget https://nextcloud.com/nextcloud.asc
gpg --import nextcloud.asc
gpg --verify nextcloud-x.y.z.tar.bz2.asc nextcloud-x.y.z.tar.bz2
* Now you can extract the archive contents. Run the appropriate unpacking
command for your archive type::
tar -xjf nextcloud-x.y.z.tar.bz2
unzip nextcloud-x.y.z.zip
* This unpacks to a single ``nextcloud`` directory. Copy the Nextcloud directory
to its final destination. When you are running the Apache HTTP server you may
safely install Nextcloud in your Apache document root::
cp -r nextcloud /path/to/webserver/document-root
where ``/path/to/webserver/document-root`` is replaced by the
document root of your Web server::
cp -r nextcloud /var/www
On other HTTP servers it is recommended to install Nextcloud outside of the
document root.
.. _centos7_installation_label:
Example installation on CentOS 7 server
-----------------------------------------------
In this install tutorial we will be deploying CentOS 7.5, PHP 7.2, MariaDB, Redis as memcache and Nextcloud running on Apache.
Start off by installing a CentOS 7 minimal install. This should provide a sufficient platform to run a successful Nextcloud instance.
First install some dependencies you will be needing during installation, but which will also be useful in every day use situations::
yum install -y epel-release yum-utils unzip curl wget \
bash-completion policycoreutils-python mlocate bzip2
Now make sure your system is up to date::
yum update -y
**Apache**
::
yum install -y httpd
See :ref:`apache-web-server-configuration` for details.
Make sure the apache web service is enabled and started::
systemctl enable httpd.service
systemctl start httpd.service
**PHP**
Next install the PHP modules needed for this install. Remember, because this is a limited basic install, we only install the neccessary modules, not all of them. If you are making a more complete install, please refer to PHP module list at the top of this page.::
yum install -y centos-release-scl
yum install -y rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring \
rh-php72-php-intl rh-php72-php-pecl-apcu rh-php72-php-mysqlnd rh-php72-php-pecl-redis \
rh-php72-php-opcache rh-php72-php-imagick
Next you will need to create a few symlinks::
ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/
ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/
ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/
This next symlink will give you the opportunity to be able to invoke ``php`` from anywhere in terminal, including for ``occ`` commands::
ln -s /opt/rh/rh-php72/root/bin/php /usr/bin/php
**Database**
As mentioned, we will be using MySQL/MariaDB as our database.::
yum install -y mariadb mariadb-server
Make sure the database service is enabled to start at boot time.::
systemctl enable mariadb.service
systemctl start mariadb.service
After you have done this, make sure you create a database with a username and password so that Nextcloud will have access to it. In the docs, refer to the Database configuration part, specifically about MariaDB. There is a complete write-up on how to setup the database.
**Redis**
::
yum install -y redis
systemctl enable redis.service
systemctl start redis.service
**Installing Nextcloud**
Nearly there, so keep at it, you are doing great!
Now download the archive of the latest Nextcloud version:
* Go to the `Nextcloud Download Page <https://nextcloud.com/install>`_.
* Go to **Download Nextcloud Server > Download > Archive file for
server owners** and download either the tar.bz2 or .zip archive.
* This downloads a file named nextcloud-x.y.z.tar.bz2 or nextcloud-x.y.z.zip
(where x.y.z is the version number).
* Download its corresponding checksum file, e.g. nextcloud-x.y.z.tar.bz2.md5,
or nextcloud-x.y.z.tar.bz2.sha256.
* Verify the MD5 or SHA256 sum::
md5sum -c nextcloud-x.y.z.tar.bz2.md5 < nextcloud-x.y.z.tar.bz2
sha256sum -c nextcloud-x.y.z.tar.bz2.sha256 < nextcloud-x.y.z.tar.bz2
md5sum -c nextcloud-x.y.z.zip.md5 < nextcloud-x.y.z.zip
sha256sum -c nextcloud-x.y.z.zip.sha256 < nextcloud-x.y.z.zip
* You may also verify the PGP signature::
wget https://download.nextcloud.com/server/releases/nextcloud-x.y.z.tar.bz2.asc
wget https://nextcloud.com/nextcloud.asc
gpg --import nextcloud.asc
gpg --verify nextcloud-x.y.z.tar.bz2.asc nextcloud-x.y.z.tar.bz2
For the sake of the walk-through, we grabbed the latest version of Nextcloud in the form a zip file, confirmed the download with the above-mentioned command, and now we will extract it::
unzip nextcloud-*.zip
Copy the content over to the root directory of your webserver. In our case, we are using apache so it will be ``/var/www/html/``::
cp -R nextcloud/ /var/www/html/
During the install process, no data folder is created, so we will create one manually to help with the installation wizard::
mkdir /var/www/html/nextcloud/data
Make sure that apache has read and write access to the whole nextcloud folder::
chown -R apache:apache /var/www/html/nextcloud
Restart apache::
systemctl restart httpd.service
Create a firewall rule for access to apache::
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload
**SELinux**
Again, there is an extensive write-up done on SELinux which can be found at :doc:`../installation/selinux_configuration`, so if you are using SELinux in Enforcing mode, please run the commands suggested on that page.
The following commands only refers to this tutorial::
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.htaccess'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.user.ini'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/3rdparty/aws/aws-sdk-php/src/data/logs(/.*)?'
restorecon -R '/var/www/html/nextcloud/'
setsebool -P httpd_can_network_connect on
If you need more SELinux configs, refer to the above-mentioned URL, return to this tutorial.
Once done with with SELinux, please head over to ``http://your.server.com/nextcloud`` and follow the steps as found :doc:`../installation/installation_wizard`, where it will explain to you exactly how to proceed with the final part of the install, which is done as admin user through your web browser.
.. note:: If you use this tutorial, and you see warnings in the web browser after installation about ``OPcache`` not being enabled or configured correctly, you need to make the suggested changes in ``/etc/opt/rh/rh-php72/php.d/10-opcache.ini`` for the errors to disappear. These warnings will be on the Admin page, under Basic settings.
Because we used ``Redis`` as a memcache, you will need a config similar to the following example in ``/var/www/html/nextcloud/config/config.php`` which is auto-generated when you run the online installation wizard mentioned earlier.
Example config::
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\APCu',
'redis' => array(
'host' => 'localhost',
'port' => 6379,
),
Remember, this tutorial is only for a basic setup of Nextcloud on CentOS 7, with PHP 7.2. If you are going to use more features like LDAP or Single Sign On, you will need additional PHP modules as well as extra configurations. So please visit the rest of the Admin manual, :doc:`../index`, for detailed descriptions on how to get this done.
.. _apache_configuration_label:
Apache Web server configuration
@@ -695,6 +377,88 @@ Other Web servers
* :doc:`nginx`
.. _vm_label:
Installing on Windows (virtual machine)
---------------------------------------
If you are using Windows, the easiest way to get Nextcloud up and running is
using a virtual machine (VM). There are two options:
* **Enterprise/SME appliance**
Nextcloud GmbH maintains a free appliance built on the
`Univention Corporate Server (UCS) <https://www.univention.com/products/univention-app-center/app-catalog/nextcloud/>`_
with easy graphical setup and web-based administration. It includes user
management via LDAP, can replace an existing Active Directory setup and
has optional ONLYOFFICE and Collabora Online integration, with many more applications
available for easy and quick install.
It can be installed on hardware or run in a virtual machine using VirtualBox,
VMWare (ESX) and KVM images.
Download the the Appliance here:
- `Univention Corporate Server (UCS) <https://www.univention.com/products/univention-app-center/app-catalog/nextcloud/>`_
* **Home User/SME appliance**
The `Nextcloud VM`_ is maintained by
`T&M Hansson IT <https://www.hanssonit.se/nextcloud-vm/>`_ and several different versions are
offered. Collabora, OnlyOffice, Full Text Search and other apps can easily be installed with the included scripts which you can choose to run during the first setup, or download them later and run it afterwards. You can find all the currently available automated app installations `on GitHub <https://github.com/nextcloud/vm/tree/master/apps/>`_.
The VM is made with VMware version 10 and it comes in different sizes and versions:
- 40 GB (VMware, VirtualBox, Hyper-V)
- 500 GB (VMware, VirtualBox, Hyper-V)
- 1 TB (VMware, VirtualBox, Hyper-V)
- 2 TB (VMware & VirtualBox, Hyper-V)
- Custom size? Please `ask us <https://www.hanssonit.se/#contact>`_.
You can find all the different version `here <https://shop.hanssonit.se/product-category/virtual-machine/nextcloud-vm/>`_.
For complete instructions and downloads see:
- `Nextcloud VM (Github) <https://github.com/nextcloud/vm/>`_
- `Nextcloud VM (T&M Hansson IT) <https://www.hanssonit.se/nextcloud-vm/>`_
.. note:: You can install the VM on several different operating systems as long as you can mount OVA, VMDK, or VHD/VHDX VM in your hypervisor. If you are using KVM then you need to install the VM from the scripts on Github. You can follow the `instructions in the README <https://github.com/nextcloud/vm#build-your-own-vm-or-install-on-a-vps>`_.
.. _snaps_label:
Installing via Snap packages
----------------------------
A snap is a zip file containing an application together with its dependencies,
and a description of how it should safely be run on your system, especially
the different ways it should talk to other software. Most importantly snaps are
designed to be secure, sandboxed, containerized applications isolated from the
underlying system and from other applications.
To install the Nextcloud Snap Package, run the following command in a terminal::
sudo snap install nextcloud
.. note:: The `snapd technology <http://snapcraft.io/docs/core/>`_ is the core
that powers snaps, and it offers a new way to package, distribute, update and
run OS components and applications on a Linux system. See more about snaps on
`snapcraft.io <http://snapcraft.io/>`_.
On a machine running a pristine Ubuntu 18.04 LTS server, you have three options:
Installation via install script
-------------------------------
One of the easiest ways of installing is to use the Nextcloud VM scripts. It's basically just two steps:
1. Download the latest `installation script <https://github.com/nextcloud/vm/blob/master/nextcloud_install_production.sh/>`_.
2. Run the script with::
sudo bash nextcloud_install_production.sh
A guided setup will follow and the only thing you have to do it to follow the on screen instructions, when given to you.
.. _Nextcloud VM:
https://github.com/nextcloud/vm