SWS-5007 / My-Experience

13 stars 0 forks source link

AWS - Error: dial unix /var/run/docker.sock: connect: permission denied #16

Open SWS-5007 opened 1 year ago

SWS-5007 commented 1 year ago

Hi, How can I solve this error ?

permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json?all=1&filters=%7B%22label%22%3A%7B%22com.docker.compose.project%3Dharvester%22%3Atrue%7D%7D: dial unix /var/run/docker.sock: connect: permission denied

?

SWS-5007 commented 1 year ago

I found this solution for this issue.

If want to run docker as non-root user then need to add it to the docker group.

$ sudo groupadd docker

$ sudo usermod -aG docker $USER

$ newgrp docker

$ reboot

I hope this will help you too. Best.