FIX ERROR – Jenkins: dial unix /var/run/docker.sock: connect: permission denied

After we installed Docker on the Jenkins server and started it, when we try to build, we get the following error:

dial unix /var/run/docker.sock: connect: permission denied

 

Solution:

Add the user “jenkins” to the “docker” group:

sudo usermod -aG docker jenkins

 

After that, the user “jenkins” will be able to work with Docker if he connects via SSH, but with Jenkins job there will still be the same error, to get rid of it, you need to restart the Jenkins service:

sudo systemctl restart jenkins

Tagged: Tags

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments