User Tools

Site Tools


docker:allow_docker_to_be_run_without_using_sudo

This is an old revision of the document!


Docker - Allow docker to be run without using sudo

Add current user to the docker group

sudo usermod -aG docker $USER

NOTE: This allows docker to be run without using sudo.

To enable this functionality, log out and log back in; or run:

newgrp docker

Add a specific user to the docker group

Determine the username

whoami

returns:

peter

Add this user to the docker group

sudo usermod -aG docker peter

Enable this functionality

Either log out and log back in; or run:

newgrp docker

Verify that docker commands can be run without sudo

docker run hello-world

NOTE: If an error is seen such as docker: Got permission denied while trying to connect to the Docker daemon socket, then:

sudo chmod 666 /var/run/docker.sock

docker/allow_docker_to_be_run_without_using_sudo.1747755496.txt.gz · Last modified: 2025/05/20 15:38 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki