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 21.0.2 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.

1 Synology NAS nextcloud Docker container set up

  • 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.

2 Synology NAS nextcloud Docker container set up

  • STEP 5

Log into Portainer using your username and password. On the Portainer left sidebar click on Stacks. After you click on Stacks, a new screen will open. 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.9'

services:
  
  mariadb:
    container_name: mariadb
    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    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

3 Synology NAS nextcloud Docker container set up

After you paste the code in the Web editor, change the value for TZ (Select your current Time Zone from this list).
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: If you have your docker folder in a different volume, then change /volume1/docker/nextcloud according to your settings. For example: /volume2/docker/nextcloud or /volume3/docker/nextcloud etc.
Note: If you decide to use mariaDB remember to change user, database, root password and database password.

  • STEP 6

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.

4 Synology NAS nextcloud Docker container set up

  • STEP 7

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

5 Synology NAS nextcloud Docker container set up

  • STEP 8

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

  • STEP 9

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 5. Check “Install recommended apps” if you want to install apps then click Finish Setup. Follow the instructions in the image below

1 Nextcloud Synology docker set up

Note: Remember to add your own credentials you have previously created on STEP 5.

  • STEP 10

After you click Finish Setup, recommended apps will be installed. Just be patient because it will take up to 10 minutes depends on your internet speed connection.

3 Nextcloud Synology docker set up

  • STEP 11

After all apps is installed enjoy your Nextcloud via Docker!

4 Nextcloud Synology docker set up

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 Tuesday / June 22nd, 2021 at 4:36 PM