Synology has added the possibility to add Docker containers a couple of years ago. The delivered GUI on Synology is pretty good. But in order to manage images or clean up your old stuff like images, volumes and so on. You need a more advanced GUI. In this small tutorial, we will set up a Portainer container and secure it via SSL using Let’s encrypt.
- Create a DNS entry pointing to your external IP, I will be using manager.fistoftech.ch
- Make sure, you have a forwarding in place to reach your NAS via the Internet
- Install the Docker software from the Package Manager. I assume you already have that since you want to manage containers 🙂
- Login to your NAS via SSH, you can use Putty, PowerShell or any other SSH capable software to open a shell on your NAS
- For persistence create the folder /volume1/docker/Portainer
- Run the following line
sudo docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /volume1/docker/Portainer:/data portainer/portainer-ce
You are free to alter the line, the important part is “-v /var/run/docker.sock:/var/run/docker.sock”. It allows this container to communicate with the other containers.
- Head over to Application Portal -> Reverse Proxy and click Create and fill in the following
- Create a new certificate under Security -> Certificate -> Add Button. For this step, your NAS needs to be accessible over the Internet via a defined URL (manager.fistoftech.ch in my case) on Port 80.
- Add a description and choose “Get a certificate from Let’s Encrypt”
- Fill in the required Information
- Domain name: manager.fistoftech.ch
- Email: email@example.com
- Subject Alternative Name: manager.fistoftech.ch (It allows you to separate entries with a semi-colon)
- Add the certificate
- Click on configure and add the certificate to the reverse proxy defined
- Enjoy Portainer