Error Knowledge Base DOCKER daemon_sock_permission_denied

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

Docker denied access to the daemon socket due to insufficient permissions.

Affected versions: All supported Docker Engine and Docker CLI versions.

What This Error Means

Docker denied access to the daemon socket due to insufficient permissions.

How to Fix It

  1. On Linux, add your user to the docker group: sudo usermod -aG docker $USER (then re-login).
  2. As a quick test, run the same command with sudo (do not rely on this long-term).
  3. Check socket permissions: ls -la /var/run/docker.sock.
  4. If SELinux/AppArmor is enabled, review the policy denial logs.

Why It Happens

  • Your user is not in the docker group (Linux).
  • The Docker socket has restrictive permissions.
  • A security policy (SELinux/AppArmor) is blocking access.

How to Verify

  1. Re-run docker version without sudo and confirm the server info is shown.
  2. Retry the original command.

Manual daemon access checks

  1. Print groups: groups.
  2. Check daemon socket: stat /var/run/docker.sock.

Common CLI Output

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: connect: permission denied

Prevention Tips

  • Provision CI runners with correct docker group membership.
  • Avoid running Docker commands as root unless required by policy.

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list