Synology: How to Install Nextcloud Using Docker

Synology How to Install Nextcloud Using Docker

Nextcloud is a suite of client-server software for creating and using file hosting services. Nextcloud is free and open-source, which means that anyone is allowed to install and operate it on their own private server devices. In this step by step guide I will show you how to install Nextcloud on your Synology NAS using Docker & Portainer.

Note: This guide works perfectly with the latest Nextcloud 22.1.1 release.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

Install Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP.

  • STEP 3

Go to File Station and open the docker folder. Inside the docker folder, create one new folder and name it nextcloud. Follow the instructions in the image below.
Note: Be careful enter only lowercase, not uppercase letters.

Nextcloud Synology NAS Set up 1

  • STEP 4

Inside the nextcloud folder create 5 new folders. Follow the instructions in the image below.

  • config
  • custom_apps
  • data
  • html
  • themes

Note: Be careful enter only lowercase, not uppercase letters.

Nextcloud Synology NAS Set up 2

  • STEP 5

Log into Portainer using your username and password. On the Portainer left sidebar click on Stacks then + Add stack. Follow the instructions in the image below.

Nextcloud Synology NAS Set up 3

  • STEP 6

In the Name field type in nextcloud. Follow the instructions in the image below.

Note: In the Portainer Stacks Web editor Copy Paste the code below.

version: '2'

services:
  
  mariadb:
    container_name: mariadb
    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-read-only-compressed=OFF
    restart: always
    volumes:
      - mariadb:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=rootpassword
      - MYSQL_PASSWORD=mysqlpassword
      - MYSQL_DATABASE=nextcloudatabasename
      - MYSQL_USER=nextclouduser

  nextcloud:
    container_name: nextcloud
    ports:
      - 8082:80
    links:
      - mariadb
    environment:
      - PUID=1026
      - PGID=100
      - TZ=Romania/Bucharest
    volumes:
      - /volume1/docker/nextcloud/html:/var/www/html
      - /volume1/docker/nextcloud/custom_apps:/var/www/html/custom_apps
      - /volume1/docker/nextcloud/config:/var/www/html/config
      - /volume1/docker/nextcloud/data:/var/www/html/data
      - /volume1/docker/nextcloud/themes:/var/www/html/themes/
    image: nextcloud
    restart: always

volumes:
  mariadb: # nextcloud

Note: After you paste the code in the Web editor, change the value numbers for PUID and PGID with your own values. (Follow my step by step guide on how to do this.)
Note: After you paste the code in the Web editor, change the value for TZ (Select your current Time Zone from this list).

Nextcloud Synology NAS Set up 4

  • STEP 7

Scroll down on the page until you see a button named Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.

Nextcloud Synology NAS Set up 5

  • STEP 8

If everything goes right, you will see this message at the top right of your screen: “Stack successfully deployed“.

Nextcloud Synology NAS Set up 6

  • STEP 9

Go back to STEP 1 or you will deal with karma 🙂.

  • STEP 10

Now open your browser and type in http://Synology-ip-address:8082/ Follow the instructions in the image below. Create an admin account. Select MySQL/MariaDB Database, add your own database credentials you have previously created at STEP 6. Uncheck “Install recommended apps” you will install it later after the installation is complete. Click Finish Setup. Follow the instructions in the image below.

Nextcloud Synology NAS Set up 7

Enjoy your Nextcloud via Docker!

Nextcloud Synology NAS Set up 8

Troubleshooting

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.

0770 nextcloud

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.

Note: If you want to run this container over an HTTPS check How to Run Docker Containers Over HTTPS.

Note: Find out how to update Nextcloud container with the latest image.
Note: Can I run Docker on my Synology NAS? See the supported models.
Note: I don’t use nextcloud via Docker I use the standard installation method for nextcloud. This helps me to do serious backups.
Note: If you encounter mem_swappiness issue contact me for instructions on how to solve it.
Note: Nextcloud together with the OnlyOffice document server.
Note: How to Free Disk Space on Your NAS if You Run Docker.

This post was updated on Saturday / September 18th, 2021 at 5:31 AM