How to run Docker without sudo

How to run Docker without sudo

Normally if you try to run docker command without sudo you will get an error (permission error) because by default docker needs to run under root privilege. But there is a trick that will allow you to run docker command without sudo.

How to run docker without sudo
  • open command line/terminal
  • add the docker group if it doesn't already exist
  • sudo groupadd docker
  • add the current user to docker group
  • sudo gpasswd -a $USER docker
  • activate the changes
  • newgrp docker
  • now you can run docker command without sudo
  • docker ps

Share this

Previous
Next Post »