Common causes
- Your user account isn't in the docker group on Linux
- You just added yourself to the docker group but haven't logged out and back in to pick up the new group membership
- Running docker in a script where the executing user doesn't have group access
- The docker group doesn't exist or the socket file permissions are wrong
How to fix it
- Add your user to the docker group: sudo usermod -aG docker $USER
- Log out and back in (or run: newgrp docker) for the group change to take effect
- Verify group membership: groups $USER — you should see docker listed
- As a quick workaround for a single command, prefix with sudo — but the group method is preferred for day-to-day use
Example
$ docker run hello-world
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: dial unix /var/run/docker.sock: connect: permission deniedRunning docker on Linux as a non-root user who hasn't been added to the docker group
Browse more errors
The Developer Hub covers 150+ errors across Git, npm, Node.js, Python, TypeScript, and Docker — with plain-English explanations and fix steps.
