I'm running Ubuntu 26.04 LTS with Docker Engine installed without Docker Desktop. Every Docker command fails unless I prefix it with sudo. I tried `sudo usermod -aG docker $USER`, which seemed to work only in the terminal where I ran it. Logging out and rebooting did not fix the problem. What should I check to make Docker work as my normal user?
3 Answers
Be aware that membership in the `docker` group effectively gives a user root-level control over the host, because containers can be used to access the Docker daemon with high privileges. If that security tradeoff is unacceptable, look into Docker’s rootless mode instead. Otherwise, confirm the group membership and restart your login session rather than using `sudo -i` as a workaround.
For a quick test in the current shell, run `newgrp docker`, then try `docker ps`. If that works, the issue was just that the shell had the old group membership. You can also check the socket permissions with `ls -l /var/run/docker.sock`; it should normally belong to the `docker` group. Don’t run `apt upgrade` or change unrelated permissions as a fix.
First verify that the group exists and that your current account is actually a member: run `getent group docker` and `groups`. If `docker` is missing from the group list, add the account explicitly with `sudo usermod -aG docker "$USER"`, then completely log out of your graphical session and log back in. A reboot is normally unnecessary, but simply opening another terminal may not refresh the group membership.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures