Running Docker commands without sudo

Run Docker commands without sudo

  1. Add the docker group if it doesn’t already exist
1
$ sudo groupadd docker
  1. Add the connected user $USER to the docker group

$USER will be set to the currently logged in user

1
$ sudo gpasswd -a $USER docker

IMPORTANT: Log out and log back in so that your group membership is re-evaluated. I had to restart my PC for some reason to get it to work.

  1. Restart the docker daemon
1
$ sudo service docker restart

Notes

You can read more about it here and [here] (https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)