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 also install Nextcloud on your Synology NAS with DSM version 6.2.4.
Install the following packages through the DSM Package Center.
Note: Once you install the MariaDB 10 package, you will have to set a root password. You will need this root password on STEP 10 of this article.
Download the latest Nextcloud version from the official Nextcloud website nextcloud.com/install and place the nextcloud zip in the root of your web folder (/volume1/web/). Right click on the zip file and extract it in the web folder. Follow the instructions in the image below.
Your web folder should look like this.
Right click on the nextcloud folder then click Properties. Follow the instructions in the image below.
Go to the Permission tab then click Create. Follow the instructions in the image below.
On the User or group dropdown menu choose SYSTEM then check all Read and Write Permissions. Click Done. Follow the instructions in the image below.
After you click Done on STEP 7, check “Apply to this folder, sub-folders and files“. Click Save. Follow the instructions in the image below.
Configure PHP. Follow the instructions in the image below.
- Open the Web Station Package.
- Go to Script Language Settings and click the Create tab.
After you click Create on STEP 9, a new window will open. Go to the Settings tab and choose your Profile name, your Description and the PHP 7.4 version, then check Enable PHP cache. Follow the instructions in the image below.
Next tab: “Extensions“.
Check the following extensions. Follow the instructions in the image above.
Next tab: “Core“. Search for the following values and change them accordingly:
upload_max_filesize= 128M (Allows uploading of maximum file size. If you need to upload bigger files, you can set 4000M = 4GB)
After you have changed all the values above, click the Save button.
- Open the Web Station Package.
- Go to Web Service Portal.
- Choose Apache 2.4 as HTTP back-end server.
- Choose the PHP 7.4 profile created at STEPS 9-12 then click Save.
Follow the instructions in the image below.
Open the phpMyAdmin package you have previously downloaded from Package Center at STEP 2 of this article. Log in with your MariaDB 10 root credentials. Create the nextcloud database. Follow the instructions in the image below. Go to the phpMyAdmin Databases tab. In the Create database field, type in nextcloud then click the Create button. Follow the instructions in the image below. Note: To login via phpMyAdmin remember the username for phpMyAdmin is root and the password is the one for MariaDB 10 you have previously set at STEP 2.
After the nextcloud database was successfully created at STEP 14, select it from the left panel then go to the phpMyadmin Privileges tab, and click Add user account. Follow the instructions in the image below.
After you click Add user account on STEP 15, you will see the page below. Choose a User name, Select Local as Host name then click the Generate button. This button will Generate a random password. Copy paste this password in the Password field and in the Re-type field. Follow the instructions in the image below.
Scroll down the page a little bit and click the Go button. Follow the instructions in the image below.
Go back to STEP 1 or you will deal with karma 🙂
Now open your browser and type in http://Synology-ip-address/nextcloud
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.4 are selected on STEP 13. Follow the instructions in the images below.
Note: If you experience trouble with connection open MariaDB 10 package then check “Enable TCP/IP connection“. Click Apply and try again to connect to your Nextcloud.
After you click Finish setup on STEP 19 the recommended apps will be installed. Just be patient because it will take up to 10 minutes.
Set permissions! Go to Control Panel / Task Scheduler / Create / Scheduled Task / User-defined script. Follow the instructions in the image below.
Once you click on User-defined script, a new window will open. Follow the instructions below:
- General: In the Task field type in “Nextcloud Permissions“. Uncheck “Enabled” option. Select root user.
- Schedule: Select Run on the following date then select “Do not repeat“.
- Task Settings: Check “Send run details by email“, add your email then copy paste the code below in the Run command area. After that click OK.
chown -R http:http /volume1/web/nextcloud chmod -R 0770 /volume1/web/nextcloud
After you click OK above you will see a warning pop-up message. Click OK.
Note: If you have your nextcloud folder in a different volume, then change in the code above /volume1/web/nextcloud according to your settings. For example: /volume2/web/nextcloud or /volume3/web/nextcloud etc.
After you click OK on STEP 23, select your “Nextcloud Permissions” Task then click the “Run” tab. You will be asked to run Nextcloud Permissions – click Yes. Follow the instructions in the image below.
Go back to STEP 1 or you will deal with karma 🙂 You have already been warned on STEP 18 🙂
Works and synchronizes perfectly with multiple devices:
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 the Web Station Package
- Go to Web Service Portal and click the “Create” tab.
Select Virtual Host as portal.
- Enter your hostname: yourdomain.com
- Choose Ports 80/443
- For Document root: click Browse and select your Nextcloud folder. 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.4 as PHP
- Login to Godaddy and change your DNS A record and point it to your WAN IP.
Click Create 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)
Log into your router and go to the Port Forwarding area. Select your NAS Local IP Address and port forward ports 80 and 443 both TCP/UDP. Remember that every router has its own interface design. At the moment I am using an RT2600ac router. Follow the instructions in the image below:
Below you can see my nextcloud correctly working with my domain name.
Note: What if I get error 0770? Your data directory is readable by other users.
Please change the permissions to 0770 so that the directory cannot be listed by other users.
If you get this error Right click on the nextcloud folder in File Station then click Properties. Click on the Permission tab then go to the Advanced options. Select Make inherited permissions explicit. Now Select User “Everyone” then Delete it using Delete tab. Check “Apply to this folder, sub-folders and files”. Click Save.
Steps to consider after the 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 NAS.
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 Tuesday / October 5th, 2021 at 3:11 AM