TL;DR: Start the Docker service. On systemd run `sudo systemctl start docker` and `sudo systemctl enable docker` so it survives reboots, then `docker ps` should list containers instead of the error. This happens because the docker CLI is just a client; it needs the dockerd server process running to do anything.

## The error

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

## Fix it

1. Check whether the service exists and its state:
   `sudo systemctl status docker`
   Expected: either `inactive (dead)` (fixable) or `Unit docker.service could not be found` (not installed).
2. Start it:
   `sudo systemctl start docker`
   Expected: no output, exit code 0.
3. Enable it at boot so this does not come back after a reboot:
   `sudo systemctl enable docker`
   Expected: `Created symlink /etc/systemd/system/multi-user.target.wants/docker.service ...`
4. Verify the client can reach the daemon:
   `docker ps`
   Expected: a container table (possibly empty), not the error.

## When this applies
- Fresh Linux install where Docker was installed but never started
- After a reboot, if the service was never enabled
- `docker context ls` shows the default unix socket context as current

## When this does NOT apply
- The error says "permission denied" instead (socket exists but your user cannot read it; fix is the docker group, separate skill)
- Docker Desktop on macOS/Windows (the daemon runs inside a VM; start the Desktop app instead)
- `DOCKER_HOST` points at a remote or tcp address (context problem, separate skill)

## Versions
Docker Engine 20.10 through 29.x on any systemd Linux distro. Non-systemd distros (Alpine/OpenRC) use `sudo service docker start` instead.

## Why it happens
`docker` is a thin client that talks to the `dockerd` daemon over a unix socket. Package installs create the systemd unit but do not always start or enable it, so the first `docker` command after install or reboot finds no socket listener.

## Edge cases
- WSL2 without systemd: enable systemd in /etc/wsl.conf or start dockerd manually in the background.
- If `systemctl start docker` fails, check `sudo journalctl -u docker --no-pager | tail -30` for the real cause (often a bad /etc/docker/daemon.json).
- Inside CI containers, you need docker-in-docker or a mounted socket; starting the service inside the job container is not the fix.
