DEV Community

Javad Rajabzadeh for Gopher

Posted on

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

After install docker maybe need using docker without sudo for home users.

Fact : for security don't bypass sudo request in docker.

Step 1
Create docker group if not exist : sudo groupadd docker

Step 2
Add user to docker group : sudo usermod -aG docker ${USER}

Step 3
Change docker.sock to new permission : sudo chmod 666 /var/run/docker.sock

Step 4
Finally restart docker daemon service : sudo systemctl restart docker

Enjoy!!!

Top comments (0)