Applies to: Docker Engine on Linux; error messages tested with the Docker CLI 29.8.1 (docker:cli image) and 29.1.3 (Ubuntu 24.04 docker.io package)
To check whether the Docker daemon is running, run docker info. If it prints a Server section with a server version, the daemon is up and your user can reach it. If it prints an error instead, the daemon is stopped, you have no permission to use it, or the client is looking in the wrong place. On a Linux server with systemd you can also run:
sudo systemctl is-active docker
It prints active when Docker is running.
What the Docker daemon is
Docker has two parts. The daemon, dockerd, runs in the background and does the real work: according to Docker, it “listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes”. The docker command you type is only a client that sends requests to the daemon, normally through the socket file /var/run/docker.sock. That is why docker version can print the Client part and then fail: the client works, but nothing answers on the other side.
Check it step by step
- Ask Docker itself. A working setup shows the server details:
$ docker info | grep -E 'Server Version|Running' Running: 9 Server Version: 29.1.3
- Ask systemd for the service state and the last log lines:
sudo systemctl status docker. More about reading this output in checking the status of a service with systemctl. - If the service failed to start, read the daemon log. Docker names this command:
sudo journalctl -xu docker.service. See useful journalctl examples for filtering by time.
The error messages and what to do
Cannot connect to the Docker daemon. Is the docker daemon running?
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
We got this when the socket file existed but no daemon listened on it, which is what you see after the service stopped or crashed. Start it and check that it stays up:
sudo systemctl start docker sudo systemctl status docker
If it stops again, the reason is in sudo journalctl -xu docker.service. Look at the last lines before the service stopped; if you changed /etc/docker/daemon.json recently, check that change first.
failed to connect to the docker API ... no such file or directory
failed to connect to the docker API at unix:///var/run/docker.sock; check if the path is correct and if the daemon is running: dial unix /var/run/docker.sock: connect: no such file or directory
This is how the Docker 29 client reports a missing socket file: Docker isn’t installed as a service on this machine, it has never been started, or you only installed the client package. Install the Engine as described in installing Docker on Debian and Ubuntu, then start it.
permission denied while trying to connect
permission denied while trying to connect to the docker API at unix:///var/run/docker.sock
The daemon is running, but your user may not open the socket. According to Docker, the socket is owned by root and is accessible to members of the docker group. Run the command with sudo, or add your user to the group and log in again:
sudo usermod -aG docker $USER
Docker warns that the docker group “grants root-level privileges to the user”, so only add people who may be root anyway.
The client connects to the wrong address
Cannot connect to the Docker daemon at tcp://127.0.0.1:2375. Is the docker daemon running?
If the address in the message is not the socket you expect, the DOCKER_HOST variable or a Docker context sends the client elsewhere. Check both and go back to the local daemon:
echo $DOCKER_HOST unset DOCKER_HOST docker context ls docker context use default
On a Mac or Windows PC with Docker Desktop, the daemon runs inside Docker Desktop’s virtual machine: open the Docker Desktop app and wait until it has started. Its context is called desktop-linux.
Start Docker automatically at boot
According to Docker’s post-installation steps:
sudo systemctl enable docker.service sudo systemctl enable containerd.service
Once the daemon runs, list your containers and read their output with docker compose logs.
Official documentation: Troubleshooting the Docker daemon and Linux post-installation steps.
Ucartz services for this topic
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
- Hire an expert: engineers per 15 minutes, per hour or per month, with no contract.
