Running Docker as a Normal User on Synology NAS

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 running docker 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.