How to Run Docker Containers on Synology NAS
As a big fan of Raspberry Pis, I have been running multiple Pis with multiple Docker containers. They can serve a lot of different purposes for your home lab. The problem is you have to make sure you backup your data frequently. You can use a NAS as your backup system but what’s even better is to utilize the compute power of your Synology NAS and run your Docker containers directly on the NAS. This way you can have built-in redundancy assuming you did set up redundancy with your NAS which is generally the common goal.
Getting Started
To run Docker containers on your Synology NAS, you need to install a package called Container Manager. You can check if your Synology is compatabile with this package on his page: Container Manager compatability
In this tutorial, I’ll be using a Synology DS1821+ model.
Open Package Center, and search for “container”.
Click Install on Container Manager package or you can click on somewhere else on the box to read the details of the package. Then you can click Install on that page too.
Once installed, click Open to see the details
You can now that the Container Manager is ready to use:
## Running Containers To run a container off of a Docker image, first you need to pull the image from a Docker registry. By default, the container manager uses DockerHub as its Docker registry but you can sutomize it by clicking Registry –> Settings.
Here you can add other registries from other providers.
To test your setup, click on nginx package and click Download.
When asked to choose a tag, accept the default which is “latest” and click Download again.
Once the image is downloaded, you can see it in the Image section
Click Run button. You should a settings dialog window. Here you can customize the resouce allocation of your container.
Click Next and you will be presented with the Advanced Settings such as port mapping, environment variables etc.
Here enter a local port to be able to access your web server. In this example, I will use port 6500 to access the nginx on this container.
Click Next again, review the Summary and click Done.
You can now view your container by switching to the container tab.
You view your new Nginx server running on your Synology NAS at port 6500, simply go to your NAS address followed by :6500 to indicate the port and you should see it in action:
Summary
In this beginners tutorial, you learned how to install the Container Manager package on your Synology NAS and ran your first container. In the upcoming articles, we will cover running Docker containers in more depth with more real-life examples.