Running Docker commands without sudo
Run Docker commands without sudo
- Add the
docker
group if it doesn’t already exist
1 | sudo groupadd docker |
- 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.
- 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)