How to fix Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? in Docker

DockerBEGINNERHIGHUpdated Dec 6, 2025ยท 190 views

The Docker daemon is not running or your user lacks permission to access the Docker socket. Start the daemon service or add your user to the docker group.

Quick fix

Fixes Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

# On Linux with systemd
sudo systemctl status docker

# Or check if the process is running
ps aux | grep dockerd
  1. Check if Docker daemon is running
  2. Start the Docker service
  3. Enable Docker to start on boot
  4. Add your user to the docker group (Linux)
docker โ€” error
# On Linux with systemd
sudo systemctl status docker
# Or check if the process is running
ps aux | grep dockerd
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

What this error means

This error occurs when the Docker CLI cannot communicate with the Docker daemon (dockerd). The daemon is the background service that manages containers, images, and networks. Without it running, no Docker commands can execute. The Docker socket at `/var/run/docker.sock` is a Unix socket that acts as the communication channel between the CLI and the daemon. If the daemon isn't running, or your user doesn't have permission to access this socket, you'll see this error.

Typical symptoms

  • All Docker commands fail with the same error message
  • docker ps, docker run, docker images all return the socket error
  • The error appears immediately without any delay
  • Works when running with sudo but fails without it

Common causes

  1. Docker daemon service is not running
  2. Docker was recently installed but the service was not started
  3. System was rebooted and Docker is not configured to start on boot
  4. Current user is not in the docker group (Linux)
  5. Docker Desktop is not running (macOS/Windows)
  6. Docker socket file has incorrect permissions
  7. Docker was uninstalled or corrupted

How to fix "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"

1Check if Docker daemon is running

First, verify whether the Docker service is active:

bash
# On Linux with systemd
sudo systemctl status docker

# Or check if the process is running
ps aux | grep dockerd

If the service is inactive or the process isn't running, proceed to start it.

2Start the Docker service

Start the Docker daemon using your system's service manager:

bash
# On Linux with systemd
sudo systemctl start docker

# On older systems with SysVinit
sudo service docker start

# On macOS/Windows
# Open Docker Desktop application

After starting, verify it's running with docker info.

3Enable Docker to start on boot

To prevent this issue after reboots, enable the Docker service:

bash
sudo systemctl enable docker

This creates a symlink so Docker starts automatically when your system boots.

4Add your user to the docker group (Linux)

If Docker runs with sudo but not without it, add your user to the docker group:

bash
sudo usermod -aG docker $USER

Important: Log out and log back in for the group change to take effect. Alternatively, run newgrp docker to activate the group in your current session.

5Verify the socket permissions

Check that the Docker socket exists and has correct permissions:

bash
ls -la /var/run/docker.sock

The socket should be owned by root:docker with permissions srw-rw----. If permissions are wrong:

bash
sudo chmod 660 /var/run/docker.sock
sudo chown root:docker /var/run/docker.sock

Advanced notes

Rootless Docker: If you're using rootless Docker, the socket path differs. Check $XDG_RUNTIME_DIR/docker.sock or set the DOCKER_HOST environment variable accordingly.

WSL2 Users: Ensure Docker Desktop's WSL2 integration is enabled in Settings โ†’ Resources โ†’ WSL Integration. The Docker daemon runs in a separate WSL2 distro managed by Docker Desktop.

SELinux: On systems with SELinux enabled, you may need to adjust contexts: sudo chcon -t container_runtime_exec_t /usr/bin/dockerd

Frequently asked questions

What does "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is" mean?
This error occurs when the Docker CLI cannot communicate with the Docker daemon (dockerd). The daemon is the background service that manages containers, images, and networks. Without it running, no Docker commands can execute.
How do I fix "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is"?
The Docker daemon is not running or your user lacks permission to access the Docker socket. Start the daemon service or add your user to the docker group.
What causes "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is"?
Docker daemon service is not running Docker was recently installed but the service was not started System was rebooted and Docker is not configured to start on boot
Is the "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading