Add a user to the Docker group

docker

Updated August 29, 2026

On a Linux Docker Engine installation, adding a user to the docker group allows access to the Docker socket without typing sudo:

sudo usermod -aG docker "$USER"

Sign out and back in, or start a new login session, then verify with id and a harmless command. The group is not a normal least-privilege application group: access to the Docker daemon can generally be used to obtain root-equivalent control of the host. Do not add untrusted users or services to it.

If you only need Docker occasionally, continuing to use sudo docker ... may be a better trade-off. Rootless Docker is another option where its documented prerequisites fit the workload. Never make /var/run/docker.sock world-writable and do not solve a permission error by running arbitrary installation scripts as root. Check the active context and socket ownership before changing groups.

Sources

related.

Ruslan Osipov

Ruslan Osipov

About the author