Running docker commands without sudo

Steps to run docker commands without sudo on Linux

January 30, 2018 - 1 minute read -
Docker Linux

1. Create a docker group if it doesn’t exist

$ sudo groupadd docker

2. Add the current user to the docker group

$ sudo usermod -aG docker $USER

3. Restart the docker deamon

$ sudo service docker restart #Ubuntu

4. Optionally, check you can run docker without sudo

$ docker run hello-world
Source