DEV Community

Manish R Warang
Manish R Warang

Posted on • Originally published at blog.g33kzone.com on

Docker Error - Permission denied connecting Docker daemon socket

Post Docker installation, you may face the following error if you execute Docker commands without "sudo".

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

Post http://%2Fvar%2Frun%2Fdocker.sock/v1.38/containers/create: dial unix /var/run/docker.sock: connect: permission denied.

The following steps will help resolve this issue

Create the docker group & add your user

  • Create the docker group
sudo groupadd docker

Enter fullscreen mode Exit fullscreen mode
  • Add your user to the docker group
sudo usermod -aG docker ${USER}

Enter fullscreen mode Exit fullscreen mode

You might need to log out and log back in so that your group membership is re-evaluated

Top comments (0)