Nextcloud_Logo

Nextcloud is an open source file sharing, communication, and collaboration platform. It can be installed on our servers.

NOTE: You can install Nextcloud on your account with a few clicks via the App Installer section of the Control Panel. You can check our App Installer article for more information.

If you prefer to install Nextcloud manually, you can follow the instructions listed in this article.

This guide has been tested with Nextcloud versions 16, 17, and 18.

Prerequisites

Before you install Nextcloud, there are a few settings to configure on your hosting account.

PHP

Nextcloud requires PHP 7.2 or later. If your hosting account is still configured with PHP 5.6, you should change the PHP version to PHP 7.3 for Nextcloud. More details on how to change the PHP version are available in our PHP version article.

You should also change the PHP configuration settings for your domain/subdomain by adding the following recommended settings to a PHP configuration file in your hosting account:

memory_limit = -1
max_execution_time = 120
post_max_size = 128M
upload_max_filesize = 128M
extension = imagick.so

You can learn more on how to change your PHP settings in our Changing PHP settings article.

Database

You need to create a MySQL database and user for the Nextcloud application. For security reasons, MySQL databases and users can be created only through the hosting Control Panel. Detailed instructions on the process are available in our Creating a MySQL database/user article.

Once you have the database and MySQL user created, you should associate the MySQL user with the database by following the instructions from our Associating a MySQL user with a database article. Unless you have a reason to do otherwise, you can select all available privileges for the new MySQL user.

Installation

Open https://nextcloud.com/install in your browser. Click on 'Download for server' and then select the 'Web Installer' option. Right-click on the link to the installer and save the setup-nextcloud.php file to your computer.

After that, upload setup-nextcloud.php to the location on your hosting account where you wish to install Nextcloud. You can easily upload the file through the File Manager section of the hosting Control Panel. If you prefer to install Nextcloud in a subdomain such as nextcloud.yourdomain.com, you can create a new subdomain through the Subdomains section of the hosting Control Panel.

Point your browser to the location of setup-nextcloud.php you just uploaded. The Nextcloud Setup Wizard will open. Click on Next to proceed.

On the next screen, enter your desired administrator’s username and password. After that, click on 'Storage & database' and select 'MySQL/MariaDB'. In the respective fields enter the MySQL username, password, and database name you created. If you are using a MySQL 8 database, you should change the database host from 'localhost' to 'localhost:/tmp/mysql8.sock'.

 

Next Cloud Install

Once all dependency checks have completed, the wizard will ask you for the directory where it should install Nextcloud. You can enter . (a single dot) to install in the current directory, or you can enter a subdirectory name. Make sure that the directory you install into is empty.

Finally, click on 'Finish setup'. Once the installation has completed, you will be automatically logged in to your new Nextcloud installation.

Additional Configuration

To ensure that Nextcloud is secure and working properly, we recommend that you make the following additional changes:

Enable HTTPS

You can set up an SSL certificate and force all connections through HTTPS using the SSL/HTTPS section of the hosting Control Panel.

Update .htaccess

Using the Control Panel's File Manager, go to the directory where Nextcloud is installed and open the file named .htaccess. In it, you should add the following lines at the beginning of the file:

# Enable Strict-Transport-Security for 180 days
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"

Email Configuration

Go to Settings -> Basic Settings in Nextcloud and make sure that you have the following settings for 'Email server':

Send mode: Sendmail Sendmail mode: smtp (-bs)
From address: a valid email address on your domain

Update config/config.php

In Settings -> Overview of Nextcloud, the following warnings may be displayed:

The "X-Content-Type-Options" HTTP header is not set to "nosniff". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
The "X-Robots-Tag" HTTP header is not set to "none". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
The "X-Download-Options" HTTP header is not set to "noopen". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
The "X-Permitted-Cross-Domain-Policies" HTTP header is not set to "none". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.

You may also get the following warning message:

Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the documentation. (List of invalid files… / Rescan…)

Clicking on 'List of invalid files...'will show you any extra files that are not part of the Nextcloud installation. You may want to move or delete any such files. Also, if you have edited the .htaccess file as advised above, the file may appear in the list as having an invalid hash. You can safely ignore that warning.

Nextcloud stores the server settings in config/config.php –this file is located in the config/ subdirectory of the directory where Nextcloud is installed.

For example, if Nextcloud is installed in /home/your_username/www/nextcloud, the full path to the configuration file would be /home/your_username/www/nextcloud/config/config.php. To resolve the issue with the HTTP headers, open the config.php file with the File Manager in the hosting Control Panel and add the following line at the end of the file:

putenv("modHeadersAvailable=true");

In the config.php file, you can also change the location where Nextcloud stores temporary files. Open config.php in the File Manager and add the following lines right after 'dbtype' => 'mysql':

'tempdirectory' => '/home/your_username/www/nextcloud/data/tmp',

Make sure you set the correct path to the Nextcloud installation, replacing "your_username" with your actual account username.

We would also recommend that you add the following two lines:

'htaccess.RewriteBase' => '/',
'htaccess.IgnoreFrontController' => true,

After that, using the Control Panel's File Manager go to the directory where Nextcloud is installed. Open the 'data/' directory and create in it another directory named 'tmp'.

Cron Job

Nextcloud can perform background tasks using a cron job. This is the recommended method to run such tasks.

To set up a cron job for Nextcloud, go to Settings -> Basic settings in Nextcloud and select 'Cron' for 'Background jobs'.

After that, open the Cron Jobs interface of the hosting Control Panel and set the cron.php file of Nextcloud to be executed every 15 minutes. The cron.php file is located in the directory of your Nextcloud installation. You should edit that file and add the following line at the top:

#!/usr/local/bin/php.cli