Running Docker as a Normal User on Synology NAS

Most people install Docker (or Container Manager on DSM 7.2+) on their Synology NAS and run it directly as root or by prefixing every command with sudo
. While this works, itโs not always convenient or secure:
- ๐ Convenience: Typing
sudo
every time gets old quickly, especially if youโre frequently runningdocker ps
,docker logs
, or restarting containers. - ๐ Security: Staying logged in as root (or using
sudo
too often) increases the risk of accidental mistakes or exposing the system to vulnerabilities. Limiting root access is always a good idea. - ๐ฅ Multi-user setup: If more than one person manages the NAS, you donโt want everyone using the admin account just to manage containers.
For these reasons, itโs cleaner and safer to allow your normal DSM user to run Docker directly. On Linux, this usually means adding the user to the docker
group. Synology doesnโt ship with this group by default, but you can set it up yourself.
Step-by-Step: Enable a Synology User to Run Docker
1. Enable SSH
First, log into DSM and go to:
Control Panel โ Terminal & SNMP โ Terminal โ Enable SSH service
2. SSH Into Your NAS
From your computer terminal:
ssh youruser@your-nas-ip
3. Switch to Root
Get root permissions:
$ sudo -i
4. Create a docker
Group
Synology doesnโt have one by default:
# synogroup --add docker
5. Add Your User to the Group
Replace youruser
with your DSM username:
# synogroup --member docker youruser
Check that it worked:
$ id youruser
You should now see docker
in the groups list.
6. Fix the Docker Socket Permission
By default, only root can access /var/run/docker.sock
. Update it so members of the docker
group can use it:
# chown root:docker /var/run/docker.sock
Confirm:
# ls -l /var/run/docker.sock
Expected:
srw-rw---- 1 root docker 0 Aug 14 10:07 /var/run/docker.sock
7. Re-login
Log out and back in. From now on, your user can run Docker without sudo
.
โ ๏ธ Note About Reboots
Synology may reset the socket permissions on reboot. To make the fix permanent, create a Task Scheduler job in DSM that runs on startup with the following command:
# chown root:docker /var/run/docker.sock
โ
Done! You now have Docker available for your Synology user โ no more sudo
spam, less time as root, and a cleaner, safer setup.