What is Nextcloud? Nextcloud is the most deployed self-hosted file share and collaboration platform on the web. Access and collaborate across your devices. The Nextcloud application is functionally similar to Dropbox or OneDrive. Unlike Dropbox and OneDrive, Nextcloud does not offer off-premises file storage hosting. Nextcloud is free and open-source, which means that anyone is allowed to install and operate it on their own private server devices. Follow the instructions below to install Nextcloud on your Synology NAS device. You can install it on your DSM version 6.2.3+.
Install the following packages through the DSM Package Center.
- Web Station
- Apache HTTP Server 2.4.43
- PHP 7.3.16
- phpMyAdmin 4.9.2 / Also install PHP 7.2
- MariaDB 10.3.21
Change the default MariaDB password. Follow the instructions in the image below.
- Open MariaDB 10.
- Click “Reset root password”.
- Choose a strong password for your root.
Basic setup. Follow the instructions in the image below.
- Open the Web Station Package.
- Go to General Settings.
- Choose Apache 2.4 as HTTP back-end server.
- Choose PHP 7.3 as PHP.
Configure PHP 7.3 Extensions. Follow the instructions in the image below.
- Open the Web Station Package.
- Go to PHP Settings and select PHP 7.3 then Edit.
First select “Enable PHP Cache”. Then check the following extensions:
Edit PHP 7.3 Values. Open the “Core” tab and search for the following values and change them accordingly:
upload_max_filesize= 128M (Allows uploading maximum file size)
Now you have prepared an environment in which Nextcloud should work perfectly. The next steps are the actual installation steps.
Download the latest Nextcloud Files from here nextcloud.com/install and place the nextcloud.zip in the root of your web folder (/volume1/web/) and unzip it there.
Go back to STEP 1 or you will deal with karma 🙂
Set up Read/Write “SYSTEM” permissions to the nextcloud folder. After you click “OK“, remember to check the option “Apply to this folder, sub-folders and files“. Follow the instructions in the images below.
After you click “OK“, remember to check the option “Apply to this folder, sub-folders and files” then click OK.
Go back to STEP 1. I have worked hard to make this guide work perfectly for everyone 🙂
Now open your browser and type in http://Synology-ip-address/nextcloud Follow the instructions in the image below.
If all is good, you should find yourself at the installation page for Nextcloud. If your page is blank or you get an error, make sure Apache 2.4 and PHP 7.3 are selected in your web station/virtual host and not nginx.
Fill out the “form” according to your installation (see picture above).
- Choose a username and password for your first user (which will be an administrator).
- Enter root username and the password for your MariaDB 10 that you previously created at STEP 3.
- Choose any name for the database. In my screenshot above I have chosen “nextcloud”.
- Instead of localhost enter localhost:/run/mysqld/mysqld10.sock
Click Finish setup and wait approximately 10 minutes before Nextcloud and all apps are installed.
After apps are installed, go to http://Synology-ip-address/nextcloud
Enjoy your Nextcloud!
Works and synchronizes perfectly with multiple devices:
If you encounter permission issues when you try to renew nextcloud please follow my step by step guide on how to create FTP user than use FileZilla to change permissions to 777. Right click on the nextcloud folder than save permissions. Follow the instructions in the image below.
Virtual host or basic setup? The Synology “Web Station” package has the ability to create virtual hosts if you want to point a specific domain to your Nextcloud installation. In my case I have my own domain so I wanted to point it straight to my Nextcloud installation. I recommend you buy your own domain name if you want to use nextcloud with a domain name.
STEP 1 (FOLLOW THIS STEP ONLY IF YOU HAVE A DOMAIN NAME)
- Open Web Station Package
- Go to Virtual Host and click “Create”
- Enter your hostname: yourdomain.com
- Choose Ports 80/443
- For Document root: click browse and select the folder where you want to install Nextcloud. If you choose /web/nextcloud you will be able to access your Nextcloud installation through your virtual hostname.
- Choose Apache 2.4 as HTTP back-end server
- Choose PHP 7.3 as PHP
- Login to Godaddy and change your DNS A record and point it to your WAN IP.
Click OK and your Virtual Host is set up. Only thing to keep in mind is your chosen installation folder.
STEP 2 (FOLLOW THIS STEP ONLY IF YOU HAVE A DOMAIN NAME)
Router Port Forwarding. Search Port Forwarding on your Router Settings; every router has its own graphic interface. Remember to open the following ports in your router “Port Forwarding” settings (see below). After having done so, save the settings. Port 80 will allow visitors to visit your site, while port 443 will allow visitors to visit the site via SSL protocol.
Follow the instructions in the image below.
Port 80 on TCP
Port 80 on UDP
Port 443 on TCP
Port 443 on UDP
Below you can see my nextcloud correctly work with my domain name.
Steps to consider after nextcloud installation:
HTTPS with Let’s Encrypt
A good practice is to use https (SSL) on any website, unless the access to your website is only on a local network. Synology has built-in Let’s Encrypt which supports great and free SSL certificates.
Create Let’s Encrypt certificate
Go to Control Panel / Security, Certificate and click “add”.
For the domain name, you can use your own domain name, just make sure your domain is pointing to your diskstation.
Unless you are using subdomains, just leave the “Subject Alternative Name:” blank.
Force HTTPS through .htaccess
Go to your Nextcloud installation folder and edit config.php in the config folder. Find the overwrite.cli.url value and change the http to https:
‘overwrite.cli.url’ => ‘https://yourdomain.com’
This post was updated on Thursday / January 14th, 2021 at 10:36 AM