Menu

1 / 5

Docker: Permission Denied While Connecting to the Docker Daemon Socket

DEV Community: docker·head_of_david·about 14 hours ago
#PtqDxAOm
#devtodocker#devto#dev#docker#group
Reading 0:00
15s threshold

permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

Enter fullscreen mode

Exit fullscreen mode

The Docker CLI talks to the Docker daemon through a Unix socket, /var/run/docker.sock . On Linux that socket belongs to root and the docker group:

$ ls -l /var/run/docker.sock srw-rw---- 1 root docker 0 Oct 15 09:12 /var/run/docker.sock

Enter fullscreen mode

Exit fullscreen mode

srw-rw---- is mode 660 : read and write for the owner and the group, nothing for anyone else. If your user isn't in the docker group, the CLI can't connect.

The standard fix

Add yourself to the group:

sudo usermod -aG docker $USER

Enter fullscreen mode

Exit fullscreen mode

Then log out and back in — group membership is read when you log in, so the change doesn't reach existing shells. To use it in the current shell straight away, run newgrp docker .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.