📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

docker ps returns permission denied on /var/run/docker.sock for standard users. CI and developer workflows are blocked.

Environment & Reproduction

Ubuntu 22.04 with Docker Engine installed via apt repository. Reproduce by running docker commands as user not in docker group.

Root Cause Analysis

UNIX socket access is limited to root and docker group members. Session may not reflect new group membership until re-login.

Quick Triage

Check socket permissions with ls -l /var/run/docker.sock and verify groups using id .

Step-by-Step Diagnosis

Confirm docker daemon status with systemctl status docker, inspect daemon logs via journalctl -u docker, and validate group assignment propagation.

Illustrative mockup for ubuntu-22-04-lts — ubuntu2204-common-problem-21-docker-perms-01.webp
Docker commands fail with permission denied for non-root user. — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Add user to docker group using sudo usermod -aG docker , then fully log out/in or run newgrp docker before retrying.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Illustrative mockup for ubuntu-22-04-lts — ubuntu2204-common-problem-21-docker-perms-02.webp
Add user to docker group and refresh session membership. — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Use rootless Docker mode for tighter privilege boundaries where feasible.

Verification & Acceptance Criteria

Non-root user can run docker ps successfully, and daemon remains healthy under systemd supervision.

Rollback Plan

Remove user from docker group if policy requires, and switch to sudo-based docker command execution.

Prevention & Hardening

Treat docker group as privileged, apply least privilege controls, and audit group membership regularly.

Got permission denied while trying to connect to the Docker daemon socket.

Related tutorial: View the step-by-step tutorial for Ubuntu 22.04 LTS.

View all Ubuntu 22.04 LTS tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Docker post-installation docs, Ubuntu Docker package guidance, Linux group security best practices.

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.