π ~1 min read
Table of contents
Symptom & Impact
Non-root users cannot run Docker commands due to socket permission errors.
Environment & Reproduction
Often appears after fresh Docker Engine installation.
docker ps
ls -l /var/run/docker.sock
id
Root Cause Analysis
User account is not in docker group or daemon is not active.
Quick Triage
Confirm daemon status and current user group membership.
systemctl status docker --no-pager
getent group docker
id -nG
Step-by-Step Diagnosis
Inspect socket ownership and test CLI with sudo.
stat -c '%U %G %a %n' /var/run/docker.sock
sudo docker version

Solution – Primary Fix
Add user to docker group and re-login so new group applies.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo usermod -aG docker $USER
newgrp docker
docker run --rm hello-world

Solution – Alternative Approaches
Use rootless Docker for tighter privilege boundaries.
dockerd-rootless-setuptool.sh install
Verification & Acceptance Criteria
User can run docker commands without sudo and daemon remains healthy.
docker ps
docker info
Rollback Plan
Remove user from docker group if policy requires sudo-only operation.
sudo gpasswd -d $USER docker
Prevention & Hardening
Limit docker group membership and review daemon access policies.
getent group docker
Related Errors & Cross-Refs
Related errors include permission denied while trying to connect to the Docker daemon socket.
Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.
View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Docker Engine post-install steps for Ubuntu.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.