I bought Synology NAS DS218+ about a couple of years ago. Since 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 done, 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, i.e. fewer headaches during upgrades. Here is a quick intro 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
- Login to DSM go to Package Center and search for
Docker
and click install. Wait for few mins and once Docker is installed you will seeDocker
in Main Menu
- Docker installation creates a shared folder docker in the default volume. It is possible to move the shared folder to another volume. If you want to move the shared folder, stop the Docker service, edit the
Shared Folder
fromControl Panel
and change the Location to match the new volume. - You can’t delete the shared folder as DSM complains about being used by the Docker application. Even if you edit the storage location in the Docker config file
/var/packages/Docker/etc/dockerd.json
, you can’t delete the shared folder. The best option is to stick with it. - Docker service runs under root user irrespective of the user who installed it from
Package Center
. - If you manage Docker from DSM, then you are all set. If you want to access Docker from the command line, you need a little more configuration, assuming non-root log-in.
Configure docker for 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 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
be 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 newly created group
$ sudo chown root:docker /var/run/docker.sock
# Make a non-root user member of docker group
$ sudo synogroup --add docker user1
How I have setup and example use-cases
I have created a separate user account to run all my dockerized applications. That way it won’t mess with all other stuff I have it running on Synology for other purposes mainly photo backups and as NFS. Below is a list of applications that I run and might add a few more moving forward and might write about it here