How to fix docker ‘Permission denied on accessing Docker daemon socket’

Are you facing this error?

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

The simplest command to solve this is by running this command :

$ sudo usermod -a -G docker $USER

Once you got this command running, you need to logout from the computer, ang logging back again to get the effect.

I wrote these tutorials for myself in future when I forget for the next steps.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store