4

I am trying to follow this guide to setup traefik properly on my DS918+. Everything seems to work normally but I can't actually launch it because

Got permission denied while trying to connect to the Docker daemon socket at 
unix:///var/run/docker.sock: 
Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/traefik/logs?follow=1&stderr=1&stdout=1&tail=100&timestamps=1: 
dial unix /var/run/docker.sock: connect: permission denied

I have tried sudo chmod +rwx docker.sock with the user that I'm using to launch the docker but to no avail.

How should I solve this ?

3 Answers 3

6

The following works for me:

sudo synogroup --add docker <userid>
sudo chgrp docker /var/run/docker.sock

Once you have done this, you must log out from the shell for the changes to take effect (at least if you were logged in as <userid> when running the commands).

1
  • It's worth to mention that synogroup (v2003-2023) supports both UID and username as the argument for -add or --memberadd. Yet, it does not check whether UID or username exists prior adding. Thus, please be careful with username letter-case too. Also, the command does not support removal of members, and only --member is an option which rewrites the whole member list it seems.
    – Artfaith
    Commented Mar 16 at 8:21
1

In the usual dock implementations, either you use docker as root (or with sudo) or you add the authorized user to the docker group (the socket is group-writable):

ll /var/run/docker.sock
srw-rw---- 1 root docker 0 Apr 19 16:13 /var/run/docker.sock=

AFAIK this is not done by default because having docker rights in practice gives you root access, so beware.

2
  • Thks for your reply. I indeed start the docker with sudo but it still gives me that error. How does one add a user into a group on synology?
    – Chapo
    Commented Apr 25, 2020 at 10:39
  • On Synology to add user to a group the command is: sudo synogroup --add <group> <user>
    – Emil
    Commented Jan 7, 2021 at 17:47
0

It helped me to run the docker command via sudo

docker exec -it homeassistant bash
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/container                                   s/homeassistant/json": dial unix /var/run/docker.sock: connect: permission denied

And then

sudo docker exec -it homeassistant bash

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
homeassistant:/config#

Interesting point is that I should enter the my password. I spent a lot of time trying to figure out the root password.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .