docker: Cannot connect to Docker daemon
This error matches known, documented patterns with reliable solutions.
Quick Fix (Most Common Solution)
- Start Docker service or Docker Desktop
- Add user to docker group
Seeing "docker: Cannot connect to Docker daemon"? This error can be frustrating, but it's usually fixable. It typically affects your development workflow or system. Below you'll find clear, step-by-step solutions to resolve this issue.
What This Error Means
The Docker background service is not running or accessible.
Frequently documented in developer and vendor support forums.
Not affiliated with browser, OS, or device manufacturers.
New here? Learn why exact error messages matter →
Common Causes
- Docker service not started
- User not in docker group
- Docker Desktop not running
How to Fix
- Start Docker service or Docker Desktop
- Add user to docker group
- Check Docker socket permissions
Last reviewed: March 2026 How we review solutions
Version note: On Linux, Docker Engine 24+ requires cgroup v2 by default. Older kernels (RHEL 7, CentOS 7) may need cgroup v1 compatibility mode.
Environment-Specific Commands
Linux (systemd)
sudo systemctl start dockersudo systemctl enable docker # auto-start on bootsudo usermod -aG docker $USER && newgrp docker
macOS
Open Docker Desktop from ApplicationsOr: open -a DockerWait for the whale icon in the menu bar to stop animating
Windows
Start Docker Desktop from Start MenuIf WSL2 backend: ensure WSL is updated (wsl --update)Restart WSL if needed: wsl --shutdown then reopen terminal
Quick Diagnostic Path
- If sudo docker works but docker without sudo does not → Your user is not in the docker group. Run: sudo usermod -aG docker $USER and log out/in.
- If systemctl status docker shows "failed" → Check logs: journalctl -u docker.service -n 50 for the root cause.
- If Docker Desktop is running but CLI still fails → Check the Docker context: docker context ls — ensure "desktop-linux" is selected.
If This Still Fails, Check
- Rootless Docker installations use a different socket path (~/.docker/run/docker.sock) — set DOCKER_HOST accordingly
- Snap-installed Docker on Ubuntu has a different service name: snap.docker.dockerd
- Corporate VPN or firewall software may block the Docker socket — try disconnecting VPN to test
Full diagnostic sequence for Docker daemon issues
# Check daemon status
sudo systemctl status docker
# If inactive, start it
sudo systemctl start docker
# Verify socket exists
ls -la /var/run/docker.sock
# srw-rw---- 1 root docker 0 ... /var/run/docker.sock
# Test connection
docker infoOptional follow-up
Some users ask whether saving fixes for recurring errors would be useful when the same issue appears again.
Was this explanation helpful?
Frequently Asked Questions
How do I start Docker?
Run sudo systemctl start docker or start Docker Desktop.
How do I add user to docker group?
Run sudo usermod -aG docker $USER then log out and back in.
Also Known As
- Docker container error
- Docker build failure
- Container runtime error
- Docker daemon error
Common Search Variations
- "docker container won't start"
- "docker build error fix"
- "docker image not found"
- "container exited with error"
- "docker daemon not responding"
- "fix docker network error"
Related Errors
Still Stuck?
Paste a different error message or upload a screenshot to get help instantly.