NextCloud is a self-hosted productivity platform that offers industry-leading, on-premise content collaboration functionality.

It’s an alternative to Dropbox or Google Drive, but with the advantage that it can be installed on your own server, ensuring that your data remains under your control.

You can use NextCloud to share and collaborate on documents, send and receive emails, manage your calendar, and have video chats – all without any possibility of data leaks.

In this post, we will show you exactly how to install NextCloud using RunCloud.

Prerequisites

You will need a server that meets NextCloud’s system requirements. When you connect your server to RunCloud, it automatically installs all necessary dependencies, and updates them. If you have an existing server connected to RunCloud, you can use that as well – as long as it has the necessary capacity to handle additional load.

1. Create A PHP Web Application In RunCloud

Go to your RunCloud dashboard and click “Deploy New Web App”. Next, switch to the “Empty Web App” tab and give your application a descriptive name.

Deploy a web app

For “Domain name“, you can either use your own domain name or use RunCloud’s test domain. If you are using RunCloud’s Cloudflare integration, RunCloud will automatically create the necessary DNS records for your domain.

Set domain name on RUnCloud

Next, select PHP version 8.1 and click “Deploy” to create the web application.

set PHP RunCloud

2. Prepare NextCloud Installer

After deploying the application you will need to download the NextCloud installation file to your server. There are two ways to do this.

2.1 Using SSH

If you are comfortable with SSH then you can run the following commands to download the installation file to your website’s root directory. Don’t forget to update the path to your web application’s root directory (displayed in RunCloud dashboard).

cd <path to root>
wget https://download.nextcloud.com/server/installer/setup-nextcloud.php

2.2 Using RunCloud File Manager

The second method is to use RunCloud’s file manager. RunCloud has a graphical user interface for editing files on your server, and you can use this to add or remove files from your server. Click on the “File Manager” option to browse the files.

RunCloud file manager

Once you have opened the file manager, you should only see one file – “index.html”. Click on “New” and create a new file with the name “setup-nextcloud.php”.

After the file has been created it will be displayed in the file manager. Click on it to edit the file – it will open a file editor in a new browser tab.

create a file using runcloud file manager

Download the installation file from https://download.nextcloud.com/server/installer/setup-nextcloud.php and open it in any text editor such as Notepad or VS Code. Press Ctrl + a to select all of the text, and Ctrl + c to copy it.Now go back to the RunCloud file editor and paste the text using Ctrl + v. Make sure to save the file afterwards.

saving file in RunCloud

3. Run NextCloud Installer

After preparing your NextCloud installer, open the URL of your website in a web browser. By default you will see the “Welcome to RunCloud” message present in the “index.html” file. Go to the address bar of your browser and append “/setup-nextcloud.php” to the end of the URL.

For example, if your website is located at www.example.com, you need to go to www.example.com/setup-nextcloud.php to start the installation.

If you followed the steps correctly, you will be greeted with the following screen. Click on “Next” to move forward with the installation.

Start Nextcloud installation

On the next screen you will be asked to specify the installation directory of your web application. Enter a single full stop to install the setup in the current location – i.e., where we added the “setup-nextcloud.php” file. 

set installation directory Nextcloud

After you have configured the directory, the installation will begin. It will take 5-10 minutes, depending on the speed of your internet connection. Once the installation is complete you will be greeted with a success message.

nextcloud installation successful

4. Configure NextCloud

After installation you will need to set up the administrator account, storage path, and the database that will be used by NextCloud.

First, go to the RunCloud dashboard and create a new database user. After you have done this, create a new database and grant its access to the user that you just created. Once you have created the database, it should look like this:

nextcloud database create

After creating the database, return to the NextCloud installation and enter the login credentials of your administrator account. If you don’t want to use the default path to store data then you can change that as well.

Finally, make sure to switch to the MySQL/MariaDB tab and enter the details of the new database and user that you created in the last step. Update the database host to “localhost:3306” and click “Install”.

Create Nextcloud admin account

After installation, you will be asked if you want to install the recommended apps. You can skip this step if you wish, and install any apps at a later time from the dashboard.

5. Troubleshooting NextCloud

After installation, you will need to tweak a few settings to properly secure your server. Click on the user icon in the top right corner of your screen, and navigate to “Administration Settings”.

setup Nextcloud installation

Ideally, you should see the green “All check passed” in the security and setup warning section. However, after installing NextCloud it is possible that you might see messages in any of three different colors:

  • red (error)
  • yellow (warning)
  • black (notice)

Fortunately, RunCloud makes it very easy to remove these messages. Let’s start with red ones first.

Warnings on Nextcloud dashboard

This can be easily fixed in the RunCloud dashboard. Go to “Settings” and scroll down to the PHP settings section. You will see the option to modify the memory limit. Update the value, and save the changes.

setting memory limit on RunCloud

5.2 Warning – PHP Function is Not Available

NextCloud requires a number of PHP functions to run properly. If there are any unavailable PHP functions, you will probably see this warning message.

If you see the message that the PHP function “set_time_limit” is not available, this could result in scripts being halted mid-execution, breaking your installation. Enabling this function is strongly recommended.

To fix this issue, go to the RunCloud dashboard panel, select your server, click the Web Application menu, select your web application, and then click the “Settings” menu of this web app.

Scroll to find the “disable_functions” option and remove the “set_time_limit,” from the text, and finally click the “Update Web Application Settings” button. Refresh the NextCloud page – the warning message should disappear.

disable php functions on RunCloud

5.3 Fixing “Strict-Transport-Security HTTP Header…” 

Enabling HTTP Strict Transport Security policy on your server will fix multiple error messages. Go to your dashboard and click on “Domain Name”. You will see all of the domains that are associated with your application. Configure the TLS settings to enable the HSTS policy.

Configure HSTS header on RunCloud

Once there, pick the third option to enable the policy, and click “Update” to save the changes.

Enable HSTS header on RunCloud

5.4 Configure Redis Memory Cache

You can significantly improve your NextCloud server performance with memory caching, where frequently-requested objects are stored in memory for faster retrieval.

In NextCloud, there are two types of caches available: a PHP opcode cache (commonly called opcache), and data caching for your Web server. If you do not install and enable a local memcache, you will see a warning on your NextCloud admin page. A memcache is not required and you may safely ignore the warning if you prefer.

When you use NextCloud with RunCloud you can use either Redis or Memcached for memory cache. In this tutorial, we will use Redis.

First, go to the RunCloud dashboard panel, select your server, then click the “Service” menu of that server. Redis has been installed by RunCloud for your server, so you only need to start it.

Enable Redis on RunCloud

Second, go to the RunCloud dashboard panel, select your server, open your web application, then click the “File Manager” menu of this web app.Edit the config/config.php file inside your NextCloud installation to add the code for Redis memory cache to your config.php file.

 'memcache.local' => '\OC\Memcache\Redis',
  'memcache.distributed' => '\OC\Memcache\Redis',
  'memcache.locking' => '\OC\Memcache\Redis',
    'redis' => [
    'host' => '127.0.0.1',
    'port' => 6379,
  ],

You need to insert this code inside the config file. Do not paste it at the bottom of the file – it needs to be pasted inside the configuration settings with a valid syntax. Please check the example below:

edit nextcloud configuration on RunCloud

Save this file and check the NextCloud security and setup warning section again. The warning message should disappear.

5.5. Enable Imagick (ImageMagick PHP Extension)

NextCloud uses Imagick for the preview generation process. When Imagick is not available, you will see a warning message in NextCloud’s automated checks.

Imagick is optional – it’s not required, and you may safely ignore the warning if only a few users are using your NextCloud server. If you want to enable it, read our quick guide on how to install Imagick (ImageMagick PHP Extension) in RunCloud.

Summary

NextCloud is an open source file manager that provides many additional features such as calendar management and file sharing. If you want to run your own version of Dropbox or Google Drive on your server for your own team or business, NextCloud is a great solution, allowing you to share and collaborate on documents, and have video chats without potential data leaks.

RunCloud is a server management platform that makes it easy to manage and optimize your servers with an easy to use graphical user interface. Sign up for RunCloud today and see how it can save you time and money.