Portainer is my favourite tool to manage docker containers because it provides a simple, yet powerful graphical user interface. But running it on my QNAP NAS was not as straight forward as I first thougt it would be. This blog post shows one way to run Portainer CE to manage containers on a QNAP NAS.
The first opportunity for me to use Portainer was to manage containers running on a Raspberry Pi. And since I was really happy with setup and use on the Pi, Portainer was my tool of choice to manage containers on my QNAP NAS.
At first, setting up the Portainer CE container on the NAS seemed largely straight-forward: Create a new container using ContainerStation, select the
portainer/portainer-ce:latest image and give it a name. Then select the necessary ports, create and mount a volume for persistent data, and mount the UNIX socket at
But at this point I ran into a problem that almost stopped me. ContainerStation would not let me enter a path to mount nor would it let me select the socket at
My first idea was to tamper with the source code of the web-ui using the Chrome DevTools.
readonly attribute would then let me enter the desired path.
Things looked good when the volume mount was also listed in the summary.
But all hope was gone when Portainer could not connect to the docker socket on startup.
A new idea was needed. Why not try the simplest way and run the container for Portainer directly from the shell ?
After connecting to the NAS through putty, running
docker -v confirmed that docker was available from the shell.
[~] # docker -v
Docker version 20.10.5, build 55c4c88
The next step is to create the persistent volume and run the container:
[~] # docker volume create portainer
[~] # docker run -d --restart=unless-stopped -p 8000:8000 -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer:/data --name portainer portainer/portainer-ce:latest
Opening the web browser at
http://<NAS-IP>:9000 shows that Portainer is running. Once it is configured to manage the local docker instance, the Home screen shows up and reveals one running container — Portainer itself.
Bingo! Obviously the simplest solution actually did the job.
Portainer is runing, connected to the docker daemon on the NAS and happily ready to manage containers.
Thank you for reading. I hope this blog post could help you setting up Portainer CE. If you have any comments, suggestions, or questions please leave a comment, drop me a message on medium, or DM me on twitter.
If you would like to read more interesting blog posts, not only about running Portainer on your NAS, take a look at our company blog.