Showing posts with label permission denied. Show all posts
Showing posts with label permission denied. Show all posts

Tuesday, December 28, 2021

Docker daemon socket at unix:///var/run/docker.sock: /var/run/docker.sock: connect: permission denied



If you are getting the following error 

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/containers/json": dial unix /var/run/docker.sock: connect: permission denied

while executing #Docker #Commands then please try the following steps.

1. Add current user to the docker group:

    sudo usermod -a -G docker $USER

    The above command will add the current user to the docker group.

2. Change the permission of docker.sock

    sudo chmod 666 /var/run/docker.sock

3. Also check If the gid of the second command is not in the list of gids of the first command, you need to run the task as root or add the user to the group displayed by the second command.

    list group ids of the current user: id --groups

    show UID: gid of docker.sock: stat /var/run/docker.sock --format '%u:%g'




Monday, March 1, 2021

Permission denied while trying to connect to the Docker daemon socket

Try the following command in the terminal after installing Docker.


  • sudo groupadd docker

  • sudo usermod -aG docker $USER

  • newgrp docker

  • docker ps              

  • Either reboot or log off and login and done.


Featured Posts

Kali Linux Remote Desktop: Access GNOME from Windows Using Native RDP

  Kali Linux + GNOME 50 + GNOME Remote Desktop + Windows Remote Desktop (MSTSC) Getting a full GNOME desktop remotely on Kali Linux can be ...