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

ja7ad

Javad Rajabzadeh

Posted on June 7, 2021

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!!!

💖 💪 🙅 🚩
ja7ad
Javad Rajabzadeh

Posted on June 7, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related