Jenkins: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
The Jenkins user is not allowed to talk to Docker — it is not in the docker group or the socket is not mounted in the container.
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sockpermission denied while trying to connect to the Docker daemon socket Jenkinsdocker.sock permission denied jenkinsdial unix /var/run/docker.sock: connect: permission denied Meaning
Docker's socket is root-owned with group docker. Add the jenkins user to that group and restart Jenkins, or when Jenkins runs in a container, mount the socket and match the host's docker GID. Understand that this gives the build root-equivalent power on the host.
Common causes
jenkinsuser not in thedockergroup- Jenkins not restarted after group change
- Container without
/var/run/docker.sockmounted - Docker GID differs between host and container
- Rootless Docker using a different socket path
⚡ Quick fix
sudo usermod -aG docker jenkinsand restart Jenkins- Mount
-v /var/run/docker.sock:/var/run/docker.sockand add the matching--group-add - Consider rootless builds (Kaniko, Buildah) for untrusted code
Detailed fix by platform
Linux
id jenkinsthensudo systemctl restart jenkins- Check GID:
stat -c '%g' /var/run/docker.sock
How to diagnose
- User — jenkins in docker group?
- Restart — Service restarted?
- Socket — Mounted into the container?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Cannot connect to the Docker daemon (GitLab) GitLab CI: Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?
- Cannot perform an interactive login from a non TTY device GitHub Actions: Error: Cannot perform an interactive login from a non TTY device
- Could not find credentials entry Jenkins: ERROR: Could not find credentials entry with ID 'github-token'
Most viewed in CI/CD
- The process '/usr/bin/git' failed with exit code 128 GitHub Actions: Error: The process '/usr/bin/git' failed with exit code 128
- This job is stuck because you don't have any active runners GitLab CI: This job is stuck because you don't have any active runners online or available with any of these tags assigned to them
- Resource not accessible by integration GitHub Actions: Error: Resource not accessible by integration (403)
Other ways to find it
Where this error sits
Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 25 Oct 2026