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

**Code:** `daemon` · **Category:** Docker · **Seen on:** Docker, Linux

The docker CLI can’t talk to the Docker engine — it isn’t running, or your user can’t access the socket.

## Meaning

The `docker` command is just a client; the daemon does the work. On Linux the socket is root-owned unless you’re in the `docker` group. On macOS/Windows, Docker Desktop must be running.

## Common causes

- Docker daemon/Desktop not started
- User not in `docker` group (permission denied on docker.sock)
- DOCKER_HOST / context pointing elsewhere
- Rootless Docker uses a different socket path

## Quick fix

1. Start Docker: `sudo systemctl start docker` or open Docker Desktop
2. Add yourself to the group: `sudo usermod -aG docker $USER` then log out/in
3. Check `docker context ls` and `echo $DOCKER_HOST`

## Detailed fix by platform

### Linux

1. Enable and verify:

```bash
sudo systemctl enable --now docker
sudo usermod -aG docker $USER && newgrp docker
docker info
```


## How to diagnose

1. **Daemon** — Is it running?
2. **Permission** — “permission denied” on docker.sock?
3. **Context** — Which context/host is the CLI using?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/docker/cannot-connect-to-docker-daemon)
