Skip to content

Files

Latest commit

5539463 · Apr 9, 2021

History

History
29 lines (19 loc) · 585 Bytes

docker-without-sudo.md

File metadata and controls

29 lines (19 loc) · 585 Bytes

Run Docker commands without sudo

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

Optionally change the username to match your preferred user.

$ sudo gpasswd -a $USER docker

IMPORTANT: Log out and log back in so that your group membership is re-evaluated.

3. Restart the docker daemon
$ sudo service docker restart

If you are on Ubuntu 14.04-15.10, use docker.io instead:

$ sudo service docker.io restart