Cannot connect to the Docker daemon (GitLab) CI/CD Origin: Build & delivery Last updated 25 Oct 2026

GitLab CI: Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?

A docker-in-docker job could not reach the docker:dind service — it is not started, not privileged, or the TLS/host settings do not match.

Exact message you may see Cannot connect to the Docker daemon at tcp://docker:2375Is the docker daemon running? GitLabCannot connect to the Docker daemon at unix:///var/run/docker.sock gitlab runnerdocker:dind service not starting
Seen on: GitLab CI Docker

Meaning

With the Docker executor, builds need the docker:dind service, a privileged runner, and matching DOCKER_HOST/DOCKER_TLS_CERTDIR. Newer images enable TLS on port 2376, so an old tcp://docker:2375 setting breaks. Alternatively mount /var/run/docker.sock or use Kaniko/BuildKit without a daemon.

Common causes

  • docker:dind service missing from the job
  • Runner not privileged (privileged = true required for dind)
  • DOCKER_HOST points to 2375 while TLS is on (or reverse)
  • Shell executor without Docker installed for the gitlab-runner user
  • Docker client and dind versions mismatched

⚡ Quick fix

  1. Add services: [docker:27-dind] and variables: DOCKER_TLS_CERTDIR: "/certs"
  2. Enable privileged = true in the runner config.toml
  3. Or build without a daemon using Kaniko

Detailed fix by platform

GitLab CI

  1. Runner config: [runners.docker] privileged = true then restart gitlab-runner

Code examples

Docker-in-Docker with TLS

yaml
build-image:
  image: docker:27
  services: [docker:27-dind]
  variables:
    DOCKER_TLS_CERTDIR: "/certs"
  script:
    - docker info
    - docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" .

How to diagnose

  1. Service — dind listed in services?
  2. Privileged — Runner privileged?
  3. Host — DOCKER_HOST and TLS consistent?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):

.gitlab-ci.yml invalid — GitLab CI: Found errors in your .gitlab-ci.yml: jobs:build config contains unknown keys: scripts (CI/CD).gitlab-ci.yml invalidCannot perform an interactive login from a non TTY device — GitHub Actions: Error: Cannot perform an interactive login from a non TTY device (CI/CD)Cannot perform an int…Container exceeded memory limit — Bitbucket Pipelines: Container 'Build' exceeded memory limit / Docker container exited with code 137 (CI/CD)Container exceeded me…ERROR: Job failed: exit code 1 — GitLab CI: ERROR: Job failed: exit code 1 (CI/CD)ERROR: Job failed: ex…execution took longer than 1h0m0s — GitLab CI: ERROR: Job failed: execution took longer than 1h0m0s seconds (CI/CD)execution took longer…failed to pull image (GitLab) — GitLab CI: ERROR: Job failed: failed to pull image "registry.example.com/app:latest" with specified policies [always]: access forbidden (CI/CD)failed to pull image …Job depends on artifacts that have expired — GitLab CI: This job could not start because it could not retrieve the needed artifacts (dependencies: build). (CI/CD)Job depends on artifa…permission denied /var/run/docker.sock — Jenkins: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock (CI/CD)permission denied /va…Cannot co…

Explore the map of this error Full error map →

🧠 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.