📖 ~1 min read
Table of contents
Symptom & Impact
docker ps fails with permission denied to /var/run/docker.sock.

Environment & Reproduction
Happens after fresh Docker installation using apt packages.

Root Cause Analysis
Current user is not in docker group or session lacks group refresh.

Quick Triage
Run id and ls -l /var/run/docker.sock to check group ownership.

Step-by-Step Diagnosis
Confirm daemon health with sudo systemctl status docker and group entry with getent group docker.

Solution – Primary Fix
Add user using sudo usermod -aG docker $USER, then re-login or run newgrp docker.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Use sudo for Docker commands until group membership is refreshed.

Verification & Acceptance Criteria
docker run –rm hello-world succeeds without sudo.

Rollback Plan
Remove user from docker group with sudo gpasswd -d $USER docker if policy requires.

Prevention & Hardening
Apply least privilege and audit docker group membership regularly.

Related Errors & Cross-Refs
Related: cannot connect to Docker daemon due to service stopped.
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 post-install docs for Linux and Ubuntu package notes.

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.