Published on

Avoiding the need for sudo when running docker commands

Authors

On Linux when running Docker commands you normally have to run them as sudo which can be annoying for example:

sudo docker ps

To avoid having to be sudo, add your user to the docker group as follows:

sudo usermod -aG docker $(whoami) && su - ${USER}

You will likely need to logout/restart your machine for this to take affect but once doing this you will not need to run docker commands as sudo instead just run them for example:

docker ps