Skip to main content

Posts

Showing posts from September, 2025

🔧 Fixing “Permission Denied While Trying to Connect to the Docker Daemon Socket” in Jenkins

🔧 Fixing “Permission Denied While Trying to Connect to the Docker Daemon Socket” in Jenkins Running Jenkins builds that involve Docker can sometimes lead to frustrating errors. One such common error is: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock If you’ve stumbled upon this error during a Jenkins pipeline or freestyle job, don’t worry — you’re not alone. In this article, we’ll break down what this error means, why it happens, and how to fix it the right way. 🧠 What Does the Error Mean? When Jenkins tries to run a Docker command (like docker build , docker run , or docker rm ), it needs to communicate with the Docker daemon . On Linux systems, Docker exposes a special Unix socket file: /var/run/docker.sock This socket file controls access to Docker. Only users with permission to this file (typically, members of the docker group) can interact with Docker. So, if Jenkins shows this error: permission denied while tryi...