Skip to Content

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

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

karchunt

Kar Chun Tan

Creator

Metadata

Fri Mar 28 2025

1 min read

92 words

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

The error message “permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock” typically occurs when the current user does not have the necessary permissions to access the Docker daemon.

To resolve this issue, you can add your user to the docker group, which grants the necessary permissions to interact with the Docker daemon without requiring sudo for every command.

sudo groupadd docker sudo usermod -aG docker $USER newgrp docker sudo chmod 666 /var/run/docker.sock docker ps # test connection
Last updated on