Docker "Permission Denied" on /var/run/docker.sock: Fixed

Symptom

docker ps fails with permission denied on docker.sock.

Root cause

Your user is not in the docker group (or the sock is root-only).

Fix, in order

1. Add your user to the docker groupsudo usermod -aG docker $USER && newgrp docker
2. Re-login if the group did not applygroups | grep docker
3. Never chmod 777 the socketls -l /var/run/docker.sock # srw-rw---- root docker

Prevent it coming back

Treat docker group membership as root-equivalent access.

Deep-dive article

Full walkthrough: Docker "Permission Denied" on /var/run/docker.sock: Fixed on the NinjaOps blog.

Run it on clean infra

Spinning up a fresh box to reproduce or escape this error?

DevOps tools shelf

Related

Cloud & DevOps tool comparisons · Hardware build guides

NinjaOps publishes free engineering guides. Some outbound links are affiliate links: they cost you nothing and support the site.

Last reviewed 2026-10-02 · NinjaOps SEO grid · DevOps blog