Monday, October 1, 2018

Install Nextcloud as Docker container on Synology NAS

You can find guides out there explaining how to install Nextcloud as a Docker container, or rather as a number of containers, since you'll normally need a few supporting containers (DB, reverse proxy, etc.). However, I wanted to explore a simple way to set up Nextcloud, and I wanted to do it on my Synology NAS. Basically, what I wanted to do was the following:

  • Setup Nextcloud (using built-in SQLite database) Docker container on Synology NAS
  • Expose Nextcloud through Synology NAS built-in reverse proxy
  • Create and use a Let's Encrypt certificate for HTTPS
This guide assumes your Synology NAS supports Docker and you've already installed the Synology Docker app on your Synology NAS. The guide furthermore assumes you are using a Synology NAS volume called "volume1". If not, just replace with name of the volume you are using.
The guide is based on DSM 6.2.
  1. Go to where you administer your domains and add an A-record for a new subdomain, e.g.
  2. Go to your router administration interface and setup port forwarding, e.g.: external-ip:6443 -> internal-ip:6301.
    Note: I'm using the port 6443 externally because that's what I want. I your case, you may want to use the standard SSL port 443, or something else entirely.
  3. Log in to Synology DSM, open Control Panel/Security/Certificate, and create a new Let's Encrypt certificate (since the default Synology certificate is NOT a trusted one):
    • Press "Add"
    • Select "Add a new certificate" and press "Next"
    • Select "Get a certificate from Let's Encrypt" and press "Next"
    • Enter the information needed by Let's Encrypt and press "Apply"
  4. Go to Control Panel/Application Portal/Reverse Proxy, and create a new entry:
    • Source: HTTPS,, 6443, Enable HSTS
    • Destination: HTTP, localhost, 6301
  5. Go back to Control Panel/Security/Certificate, and press "Configure", then for "" select your newly created Let's Encrypt certificate.
  6. SSH into your Synology NAS (e.g. with PuTTy) using an account with administrative rights.
  7. Create a new folder called "nextcloud" located in "volume1/docker". This will be used to store all your Nextcloud data, so when you upgrade the Docker container your data remain in place.
    mkdir /volume1/docker/nextcloud
  8. Pull the Nextcloud image and run it as a container using the following command (note: it is recommended to pull/run using command line since Synology Docker app is limited in what you can configure):
    sudo docker run -d --name nextcloud -p 6301:80 -v /volume1/docker/nextcloud:/var/www/html nextcloud
You should now be able to open a browser and go to: without any problems (even in Firefox :-)

Part 2:

Ok, so I installed Nextcloud. What I really wanted to use it for was for bookmark synchronization across browsers. With the unfortunate demise of Xmarks, I needed some other way of keeping all my bookmarks in sync, and this time I wanted to control everything myself, so I didn't have to rely on the potentially unreliable existence of yet another 3rd party cloud service.

In order to use Nextcloud for bookmarks, the first thing I did was to install an app called "Bookmarks". The term "app" can mean a lot of things these days, but in this case it means that you log in to your Nextcloud web interface, locate the app store, and find the app called "Bookmarks" and install it.

Next thing I did was installing the Floccus browser extension in the various browsers I use, and then I followed the Floccus instructions for how to sync bookmarks.


Post a Comment