Excerpt
Problem
Just installed docker in Ubuntu and ran docker ps, and it was throwing the below 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.24/containers/json: dial unix /var/run/docker.sock: connect: permission denied
Solution
Create a docker group
sudo groupadd docker
Add the current user to newly created docker group
sudo usermod -aG docker ${USER}
After logout session and login back and restart docker
sudo systemctl restart docker
After all the above, just open the terminal and run the below command
sudo chmod 666 /var/run/docker.sock
Did this post help you?
Tutsplanet brings in-depth and easy tutorials to understand even for beginners. This takes a considerable amount of work. If this post helps you, please consider supporting us as a token of appreciation:
Just want to thank us? Buy us a Coffee
May be another day? Shop on Amazon using our li
Problem
Just installed docker in Ubuntu and ran docker ps, and it was throwing the below 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.24/containers/json: dial unix /var/run/docker.sock: connect: permission denied
Solution
Create a docker group
sudo groupadd docker
Add the current user to newly created docker group
sudo usermod -aG docker ${USER}
After logout session and login back and restart docker
sudo systemctl restart docker
After all the above, just open the terminal and run the below command
sudo chmod 666 /var/run/docker.sock
Did this post help you?
Tutsplanet brings in-depth and easy tutorials to understand even for beginners. This takes a considerable amount of work. If this post helps you, please consider supporting us as a token of appreciation:
Just want to thank us? Buy us a Coffee
May be another day? Shop on Amazon using our links. Your prices won't change but we get a small commission.
Editorial StaffEditorial Staff at Tutsplanet is a dedicated team to write various tutorials about subjects like Programming, Technology and Operating Systems.View all posts by Editorial Staff