January 5, 2022

Configuring Docker on Synology NAS (DSM 7.x)

I bought a Synology NAS DS218+ about a couple of years ago. Since I’ve been using it as a transient store for all media files before it uploads to the cloud for permanent storage. I was looking to utilise it more, rather than a glorified cache, but memory limitation was a bummer. DS218+ comes with 2GB of built-in memory and is user-upgradable to a max of 10GB by adding a second 8GB DIMM. I came across a blog that suggested unofficial upgrades to bump it up to 16GB, but it required opening up the Synology NAS to bare bones to access the first DIMM slot. I took the plunge, and in hindsight, it was one of the best decisions on hardware upgrades I have made over the years.

Upgrading DS218+ with loads of RAM allows me to run a host of Docker-based applications. It frees time from administrative tasks and is repeatable, resulting in fewer headaches during upgrades. Here is a quick introduction to Docker on Synology NAS. Installing Docker on DSM (DiskStation Manager, Synology NAS GUI) is as easy as clicking a button and gets you going quickly. If the Dockerised application you want to run isn’t conventional, knowing a little deeper might go a long way.

Installing Docker

docker-installed-running.png

Configure Docker for a non-root user

Docker is installed and run as a root user. If you look at the permissions on the docker.sock , you will see it has both the user and group of the root.

$ ls -l /var/run/docker.sock 
srw-rw---- 1 root root 0 Jan  5 22:15 /var/run/docker.sock

To make Docker accessible for non-root users through a CLI, you would have to move the docker.sock to a group that’s a bit more permissible. Create a new group and make docker.sock part of the new group. Restart the Docker service and make non-root user members of the newly created group.

You can achieve group creation either in DSM or SSH. Changing docker.sock group ownership still needs SSH.

# Create a group named docker
$ sudo synogroup --add docker

# Change group ownership of docker.sock to the newly created group
$ sudo chown root:docker /var/run/docker.sock

# Make a non-root user a member of the Docker group
$ sudo synogroup --member docker user1 

How I have set up an example use case

I have created a separate user account to run all my Dockerised applications. That way it won’t mess with all the other stuff I have running on Synology for other purposes, mainly photo backups, and as NFS. Below is a list of applications that I run, and I might add a few more moving forward, and might write about it here.

© Nataraj Basappa 2025