Docker Error
Docker Error: Cannot Connect to the Docker Daemon
The docker CLI can't reach the Docker daemon (dockerd) — usually because it isn't running, or your user lacks permission to access its socket.
What This Error Means
This means the `docker` command-line client, which is just a client, could not communicate with the actual Docker daemon (dockerd) that does the real work — either the daemon process isn't running, or the client can't reach the Unix socket / TCP endpoint it uses to talk to the daemon.
Why It Occurs
Most commonly the Docker service simply isn't running on the machine, or (on Linux) the current user isn't a member of the `docker` group and therefore lacks permission to access `/var/run/docker.sock`.
Symptoms
- ⚠ Every `docker` command fails immediately with this error, not just specific ones
- ⚠ Message often includes "Is the docker daemon running?"
Common Causes
- • Docker service/daemon is not running
- • Docker Desktop isn't started (on macOS/Windows)
- • Current user isn't in the `docker` group on Linux (permission denied on the socket)
- • Docker was installed but the service was never enabled to start automatically
How to Fix It
- On Linux: check if the service is running: `sudo systemctl status docker` — if not, start it: `sudo systemctl start docker`
- On macOS/Windows: confirm Docker Desktop is actually running (check the system tray/menu bar icon)
- If the error specifically mentions "permission denied" rather than "connection refused", add your user to the docker group: `sudo usermod -aG docker $USER`, then log out and back in for the group change to take effect
- Enable Docker to start automatically on boot: `sudo systemctl enable docker`
| Command | Purpose |
|---|---|
| sudo systemctl status docker | Check whether the Docker daemon is running |
| sudo systemctl start docker | Start the Docker daemon |
| sudo usermod -aG docker $USER | Add your user to the docker group (requires logout/login to take effect) |
Verification
- ✓ `docker ps` runs successfully without error
- ✓ `systemctl status docker` shows "active (running)"
Prevention
- → Enable the Docker service so it survives reboots: `sudo systemctl enable docker`
- → Add new users to the docker group as part of onboarding, rather than discovering the permission gap later