π ~1 min read
Table of contents
Symptom & Impact
Running docker ps as non-root returns permission denied on /var/run/docker.sock.

Environment & Reproduction
Appears after fresh install where user has not been added to docker group or session not refreshed.

Root Cause Analysis
Socket ownership grants access to root and docker group only, excluding current shell user membership.

Quick Triage
Check group membership with id and inspect socket permissions using ls -l /var/run/docker.sock.

Step-by-Step Diagnosis
Confirm daemon status with systemctl status docker and validate effective groups in current login session.

Solution – Primary Fix
Run sudo usermod -aG docker $USER, then logout/login or run newgrp docker. Verify with docker run hello-world.
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 in restricted environments where group access is not allowed by policy.

Verification & Acceptance Criteria
Non-root user executes docker ps and docker run commands without permission errors.

Rollback Plan
Remove user from docker group using sudo gpasswd -d user docker if compliance requires reversal.

Prevention & Hardening
Apply least privilege by limiting docker group membership and auditing user access regularly.

Related Errors & Cross-Refs
Related failures include daemon not running and cgroup driver mismatches.
Related tutorial: View the step-by-step tutorial for Ubuntu 26.04 LTS.
View all Ubuntu 26.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading
Docker Engine on Ubuntu docs and Linux group management references.

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.