How to Install ownCloud on Your Synology NAS

How to Install ownCloud on Your Synology NAS

If you are looking for a nice self hosted Cloud, let me suggest ownCloud. ownCloud is an open-source file sync, share and content collaboration software that lets teams work on data easily from anywhere, on any device. It provides access to your data through a web interface, sync clients or WebDAV while providing a platform to view, sync and share across devices easily – all under your control. ownCloud’s open architecture is extensible via a simple, but powerful API for applications and plugins and it works with any storage. In this step by step guide I will show you how to install ownCloud Community Edition on your Synology NAS with Docker & Portainer.

💡Note: This guide works perfectly with the latest ownCloud v10.14.0 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. Attention: Make sure you have installed the latest Portainer version.

  • STEP 3

Make sure you have a synology.me Wildcard Certificate. Follow my guide to get a Wildcard Certificate. If you already have a synology.me Wildcard certificate, skip this STEP.

  • STEP 4

Go to Control Panel / Login Portal / Advanced Tab / click Reverse Proxy. Follow the instructions in the image below.

ownCloud Synology NAS Set up 1

  • STEP 5

Now click the “Create” button. Follow the instructions in the image below.

ownCloud Synology NAS Set up 2

  • STEP 6

After you click the Create button, the window below will open. Follow the instructions in the image below.

On the General area, set the Reverse Proxy Name description: type in ownCloud. After that, add the following instructions:

Source:
Protocol: HTTPS
Hostname: owncloud.yourname.synology.me
Port: 443

Check Enable HSTS

Destination:
Protocol: HTTP
Hostname: localhost
Port: 4660

ownCloud Synology NAS Set up 3

  • STEP 7

On the Reverse Proxy Rules click the Custom Header tab. Click Create and then, from the drop-down menu, click WebSocket. After you click on WebSocket, two Header Names and two Values will be automatically added. Click Save. Follow the instructions in the image below.

Synology Proxy WebSocket

  • STEP 8

Go to Control Panel / Network / Connectivity tab/ Check Enable HTTP/2 then click Apply. Follow the instructions in the image below.

ownCloud Synology NAS Set up 4

  • STEP 9

Go to Control Panel / Security / Advanced tab/ Check Enable HTTP Compression then click Apply. Follow the instructions in the image below.

ownCloud Synology NAS Set up 5

  • STEP 10

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

ownCloud Synology NAS Set up 6

  • STEP 11

Now create three new folders inside the owncloud folder that you created at STEP 10 and name them data, db, redis. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

ownCloud Synology NAS Set up 7

  • STEP 12

Download (click on the blue link below) and upload the my.cnf file below in the db folder that you have previously created at STEP 11. Follow the instructions in the image below. 🔒Note: Support my work to unlock the password. You can use this password to download any file on mariushosting forever!

👉🏻Download my.cnf

ownCloud Synology NAS database configuration

  • STEP 13

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

1 Synology Portainer Add Stack

  • STEP 14

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

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

version: "3.9"
services:
  redis:
    image: redis
    command:
      - /bin/sh
      - -c
      - redis-server --requirepass redispass
      - --databases 1
    container_name: ownCloud-REDIS
    hostname: owncloud-redis
    mem_limit: 256m
    mem_reservation: 50m
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    read_only: true
    user: 1026:100
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping || exit 1"]
    volumes:
      - /volume1/docker/owncloud/redis:/data:rw
    environment:
      TZ: Europe/Bucharest
    restart: on-failure:5

  db:
    image: mariadb:11.3-jammy
    command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"]
    container_name: ownCloud-DB
    hostname: owncloud-db
    mem_limit: 1g
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    user: 1026:100
    volumes:
      - /volume1/docker/owncloud/db:/var/lib/mysql:rw
      - /volume1/docker/owncloud/db:/etc/mysql/conf.d:rw
    environment:
      TZ: Europe/Bucharest
      MYSQL_ROOT_PASSWORD: rootpass
      MYSQL_DATABASE: owncloud
      MYSQL_USER: ownclouduser
      MYSQL_PASSWORD: owncloudpass
    restart: on-failure:5

  owncloud:
    image: owncloud/server:latest
    container_name: ownCloud
    hostname: owncloud
    mem_limit: 4g
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    ports:
      - 4660:8080
    volumes:
      - /volume1/docker/owncloud/data:/mnt/data:rw
      - /etc/localtime:/etc/localtime:ro
    environment:
      OWNCLOUD_DOMAIN: localhost:8080
      OWNCLOUD_TRUSTED_DOMAINS: 192.168.1.18,owncloud.yourname.synology.me
      OWNCLOUD_DB_TYPE: mysql
      OWNCLOUD_DB_NAME: owncloud
      OWNCLOUD_DB_PREFIX: oc_
      OWNCLOUD_DB_USERNAME: ownclouduser
      OWNCLOUD_DB_PASSWORD: owncloudpass
      OWNCLOUD_DB_HOST: owncloud-db
      OWNCLOUD_ADMIN_USERNAME: marius
      OWNCLOUD_ADMIN_PASSWORD: mariushosting
      OWNCLOUD_MYSQL_UTF8MB4: true
      OWNCLOUD_REDIS_ENABLED: true
      OWNCLOUD_REDIS_HOST: owncloud-redis
      OWNCLOUD_REDIS_PASSWORD: redispass
# more ENV @ https://github.com/owncloud-docker/base/blob/master/ENVIRONMENT.md
    restart: on-failure:5
    depends_on:
      redis:
        condition: service_healthy
      db:
        condition: service_started

Note: Before you paste the code above in the Web editor area below, change the value numbers for user with your own values. (Follow my step by step guide on how to do this.1026 is my personal UID value and 100 is my personal GID value. You have to type in your own values.
Note: Before you paste the code above in the Web editor area below, change the value for TZ. (Select your current Time Zone from this list.)
Note: Before you paste the code above in the Web editor area below, change the value for OWNCLOUD_TRUSTED_DOMAINS and type in your own local NAS IP and your own synology.me DDNS without https:// at the beginning that you have previously created at STEP 6. The local NAS IP and DDNS are separated by a comma.
Note: Before you paste the code above in the Web editor area below, change the value for OWNCLOUD_ADMIN_USERNAME and type in your own username. marius is an example for a username.
Note: Before you paste the code above in the Web editor area below, change the value for OWNCLOUD_ADMIN_PASSWORD and type in your own admin password. mariushosting is an example for a password.
Note: If you need more Environment variables, check the full ENV variables.

ownCloud Synology NAS Set up 8

  • STEP 15

Scroll down on the page until you see a button called 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.

ownCloud Synology NAS Set up 9 new2 2024

  • STEP 16

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

ownCloud Synology NAS Set up 10

  • STEP 17

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

  • STEP 18

Now open your browser and type in your HTTPS/SSL certificate like this https://owncloud.yourname.synology.me that you have previously created at STEP 6. In my case it’s https://owncloud.mariushosting.synology.me If everything goes right, you will see the ownCloud Login page. Type in your own Username and Password that you have previously added at STEP 14. Click Login. Follow the instructions in the image below.

ownCloud Synology NAS Set up 11

  • STEP 19

Upload your own Documents. Follow the instructions in the image below.

ownCloud Synology NAS Set up 12

  • STEP 20

Follow my step by step guide on how to activate SMTP for your Gmail account. This step is mandatory. Note: If you don’t want to use the easiest way for SMTP with Google and you already have SMTP details from your own Mail Server, you can just skip this STEP and use your personalized email SMTP details instead.

  • STEP 21

Set up Email Notifications. At the top right of the page click on your profile icon then Settings. On the left sidebar click General then add the details below. Follow the instructions in the image below.

Send mode: smtp
Encryption: SSL/TLS
From address: Type in your own Gmail address.
Authentication method: Login
Check ✔️Authentication method.
Server address: smtp.gmail.com : 465
Credentials: Type in your own Gmail Address and App Password / STEP 19.
Test receiver email: Add an email address.
Note: Click Send email to test if the email can reach the recipient.

ownCloud Synology NAS Set up 13

Check your email:

ownCloud Synology NAS Set up 14

  • STEP 22

Download the ownCloud Desktop app for Windows, Mac and Linux. Download the ownCloud app for your Android Phone or Apple iPhone.

Enjoy ownCloud!

🆘TROUBLESHOOTING

If you encounter issues by using this container, make sure to check out the Common Docker issues article.

Note: Can I run Docker on my Synology NAS? See the supported models.
Note: Find out how to update the ownCloud container with the latest image.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: How to Schedule Start & Stop For Docker Containers.
Note: How to Activate Email Notifications.
Note: How to Add Access Control Profile on Your NAS.
Note: How to Change Docker Containers Restart Policy.
Note: How to Use Docker Containers With VPN.
Note: Convert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.
Note: Find out the Best NAS Models For Docker.
Note: Activate Gmail SMTP For Docker Containers.

This post was updated on Sunday / March 10th, 2024 at 9:54 AM