Site icon Narayana Tutorial

Got permission denied while trying to connect to the Docker daemon socket

docker permission denied

docker permission denied

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

docker images

The above command giving error like permission denied so we need to update the permission to 666 as per the following.

 

Solution:

Update the permission by executing the following command

sudo chmod 666 /var/run/docker.sock

And then type the following command to check docker permission fixed or not . If you have any images, it will display all images else it will display header information.

docker images