DEV Community

Javad Rajabzadeh for Gopher

Posted on

2 1

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️