How to fix docker: Got permission denied while trying to connect to the Docker daemon socket

preview_player
Показать описание
By default, the docker command can only be run the root user or by a user in the docker group, which is automatically created during Docker’s installation process. If you attempt to run the docker command without prefixing it with sudo or without being in the docker group, you’ll get an error saying "Got permission denied while trying to connect to the Docker daemon socket"

This is a short demo on how to execute the Docker command without sudo.

I use DigitalOcean for all of my demos, you can use the link below to get a free $100 credit and spin up your own Linux servers!

Рекомендации по теме
Комментарии
Автор

OMG I don't know how should I thank you. The perfect tutorial within 56 seconds solved the problem that I was facing for the last 3 days. I appreciate your effort. Thanks a lot and please keep updating your channel, I am gonna subscribe for more awesome videos.

junaid_qadir
Автор

thank you, i hope this video can help a ton of people

s.abdulhakim
Автор

*thank you very much!*
*you saved me a lot of time!*

bxrxrk
Автор

when i try to login my authentication is failing what should i give for pass

balatamil
Автор

Hi Can you please guide me. I am new to docker and I couldn't solve the issue. Even after following the steps I got the same error. Can you please guide me what should I follow or recheck?

SS-
Автор

As mentioned by jason Formol if you have a snap installation, there are a few extra things that you need to do:


sudo docker ps # which works fine
docker ps # which doesn't work because of permission failure
sudo addgroup --system docker
sudo adduser $USER docker
newgrp docker
sudo snap restart docker
docker ps # finally this should work as normal

Source:

bobbyiliev_
Автор

Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!

timokito
Автор

sudo chmod 666 /var/run/docker.sock answer from sagarjethi in digital ocean forum

jhoanmartinezsilva