// troubleshooting guide · jenkins
Jenkins Docker 'Permission Denied' Connecting to Docker Daemon Socket
- Status
- Workaround available
- platforms:
- Linux, Docker
- updated:
- November 16, 2026
- reports:
- 4
- Method
- how we research
RUNBOOK · jenkins/docker-permission-denied4 FIXES
// quick answer
The jenkins user can't access /var/run/docker.sock. Add it to the docker group and restart Jenkins (or the agent); avoid chmod 777 on the socket.
Most likely fix: Add jenkins to the docker group
How to fix it
// try these in order, the most common fix is first
FIX 1Add jenkins to the docker group
- 01Run sudo usermod -aG docker jenkins
- 02Restart Jenkins: sudo systemctl restart jenkins (or restart the agent)
- 03Verify with sudo -u jenkins docker ps
Did this fix it?FIX 2Make sure Docker is running
- 01Run sudo systemctl status docker
- 02Start it with sudo systemctl start docker if needed
Did this fix it?FIX 3Match the group ID in containers
- 01Run getent group docker on the host to get the GID
- 02Run the Jenkins/agent container with --group-add <GID> so it can use the mounted socket
Did this fix it?FIX 4Don't chmod 777 the socket
- 01chmod 777 /var/run/docker.sock is insecure and resets after a reboot
- 02Use the group fix instead
Did this fix it?
SANDBOX · jenkins RUNS IN YOUR BROWSER
Try it: push, review, run CI and merge in a code host and cloud workspace
A hands-on Jenkins-style sandbox, including the spots where users get stuck. See where problems like this one start. 1-2 minutes, nothing is saved.
Symptoms
A pipeline step running docker fails with 'Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock'.
Why it happens
- C-01The jenkins user isn't in the docker group
- C-02Jenkins wasn't restarted after the group change, so the old groups still apply
- C-03Inside a container, the docker group ID differs from the host's
- C-04The Docker service isn't running
// this guide also covers
- jenkins docker permission denied
- permission denied while trying to connect to the docker daemon socket jenkins
- jenkins docker.sock permission denied
Still not working?
If Jenkins keeps failing, you're not alone. See every Jenkins problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other Jenkins errors
- Jenkins Build Stuck 'Waiting for Next Available Executor'
- Jenkins Build Stuck and Won't Abort
- Jenkins Plugins Failed to Load After Update
- Jenkins Not Starting: 'Job for jenkins.service failed'
- Jenkins java.lang.OutOfMemoryError: Java Heap Space
- Why Is Jenkins So Slow?
- Jenkins 'Scripts Not Permitted to Use Method' Error
- Jenkins GitHub Webhook Not Triggering Build