DEV Community


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

Javad Rajabzade
Software engineer
・1 min read

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


Discussion (0)