Fix the Jenkins Docker error: Permission denied when trying to connect to Docker daemon

Jenkins Docker permission denied error

There’s an easy fix to the “Permission denied while trying to connect to the Docker daemon socket” error you encounter when you run a Jenkins build or a pipeline’s Jenkinsfile that accesses a Docker image. It’s just a single terminal command and then a reboot:

sudo usermod -a -G docker jenkins

Run this command and Jenkins will be able to invoke a Docker run command and the Docker daemon socket issues will go away.

Jenkins Docker Permission Denied fix

To fix the Jenkins Docker permission denied error, just run a usermod command in the terminal and reboot.


Cameron McKenzie Cameron McKenzie is an AWS Certified AI Practitioner, Machine Learning Engineer, Solutions Architect and author of many popular books in the software development and Cloud Computing space. His growing YouTube channel training devs in Java, Spring, AI and ML has well over 30,000 subscribers.