Installing Nextcloud

Please be aware that the below is the method that I’ve used to setup and use Nextcloud publicly, outside of my local network. I’ve been made aware that some of the steps below do will not apply to using Nextcloud locally and some may break your instance when using it locally. I will be looking into what below is not necessary for local use of Nextcloud over the next few weeks and coming back to update this setup guide. Thank you to the Reddit user who brought this to my attention after using this guide to fix some of the issues that they were having with Nextcloud.


Download Nextcloud Zip file.

Unzip Nextcloud Zip file.

Move Nextcloud folder to Apache web server directory. (Folder name can be changed to something different at this point if desired.)

Set nextcloud folder user permission to the www-data user. (If you change the name of the nextcloud folder, substitute it in the below command.)

Create Nextcloud Apache configuration file. (File name can be anything you want. If you’re planning to host more than one Nextcloud instance, name them something to associate it with each instance.)

Add the below code to the newly created configuration file. Replace nextcloud in the below with the name that you gave to your Nextcloud folder if you changed it. Insert your server’s IP address or your desire URL for use with Nextcloud inplace of [Nextcloud URL] (removing the open and closed brackets).

Enable Nextcloud’s Apache confirguation file.

Restart Apache.

Troubleshooting Nextcloud

Installing Redis.

Open Nextcloud PHP configuration file. (Replace nextcloud with the name that you gave your Nextcloud directory.)

Add the following code to the PHP file right below ‘installed’ => true, .
(Note: There are two (2) spaces at the beginning of each line.)

Add user www-data to the redis group.

Set Nextcloud’s PHP configuration file permissions. (Replace nextcloud with the name that you gave your Nextcloud directory.)

Install libmagickcore.

Open Nextcloud’s Apache SSL configuration file.

Add the following code below Server Name to fix Strict Transport Security error.

Restart Apache.

Open Crontab file for www-data user.

Add the follow code at the bottom of document to fix cron job error.

Open PHP’s apcu.ini file.

Add the following at the bottom of document.

Install missing indices.

×