Docker Daemon Not Responding: Diagnose and Recover

Troubleshoot an unresponsive Docker daemon on Linux and Windows: confirm the hang, check processes and logs, find resource pressure, restart safely, and prevent recurrence.

Rao Aadil, India 7 min read

Confirm the daemon is actually unresponsive

A hanging docker ps is usually the first sign that the Docker daemon has stopped answering. Run it with a timeout on Linux to separate a hang from an immediate connection error:

timeout 5 docker ps

If the command returns Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? immediately, the client cannot reach the socket, which often means the daemon is not running at all. If it waits for five seconds and then exits with no output, the daemon is likely up but not answering.

Windows users should open PowerShell or cmd and run docker ps. If the prompt sits there with no output, the daemon may be unresponsive. There is no built-in timeout command that wraps another command, but you can observe whether the command returns quickly with an error or hangs.

Run docker info and docker version as well. If both hang, the daemon is not responding to API calls over /var/run/docker.sock on Linux or //./pipe/docker_engine on Windows. If docker version shows client information but then hangs before server info, the client is connecting but the daemon is not answering.

Before assuming the daemon is broken, rule out client-side issues. Check docker context ls to see which endpoint the client is targeting. A wrong DOCKER_HOST environment variable or an inactive Docker Desktop installation can produce an immediate error, not a hang. On Windows, if Docker Desktop is not running, docker ps usually fails quickly with an error about the named pipe, not with a hang.

Doing this with brynko devOps Agent

Inspect containers, read logs, check stats, restart services and run Compose stacks, just by describing what you want.

“why does this container keep restarting”

It reads the real state of the server before it says anything, shows you the exact command, and waits for your approval. Windows and Linux, over the SSH access you already have.

Download for WindowsSee what else it does

Check the daemon process and service state

Check the service state and process list on Linux:

systemctl status docker --no-pager
systemctl is-active docker
ps aux | grep dockerd

The daemon also depends on containerd, so check its status as well:

systemctl status containerd --no-pager

A healthy daemon shows active (running) in systemctl and a dockerd process that is not consuming 100% CPU. If the service is active but docker ps still hangs, the process may be alive but stuck. Look at the process state with ps -o stat,pcpu,pmem,etime,cmd -p <pid>, replacing <pid> with the dockerd PID from pgrep dockerd. A state of D (uninterruptible sleep) or a long elapsed time with almost no CPU time suggests the daemon is blocked.

Run PowerShell as Administrator on Windows and use:

Get-Service docker
Get-Process dockerd

For Docker Desktop, the service name may be com.docker.service; use Get-Service *docker* to list all Docker-related services. Check that the Docker Desktop process is running. A process that is alive but not responding will often show low CPU activity while you issue docker commands. Use Get-Process dockerd | Select-Object Id,CPU,StartTime to see if the process has been running for a long time with little work.

Read daemon and containerd logs to find why it's stuck

Journald usually captures the daemon logs on Linux:

journalctl -u docker -n 200 --no-pager
journalctl -u containerd -n 200 --no-pager

You can follow the log while reproducing the hang with journalctl -u docker -f in one terminal and docker ps in another. If journalctl returns no entries, persistent journaling may be disabled. Enable it by editing /etc/systemd/journald.conf, setting Storage=persistent, and restarting systemd-journald. If journald is not available, check /var/log/docker (may not exist on all distributions) or syslog for relevant entries.

Look for lines containing timeout, deadlock, OOM, failed to start, containerd crashed, or repeated starting daemon messages. These indicate the underlying cause.

Docker Desktop writes logs to %LOCALAPPDATA%\Docker\log.txt on Windows. Open that file or view the tail with PowerShell:

Get-Content $env:LOCALAPPDATA\Docker\log.txt -Tail 100

For Windows containers using the Docker Engine service, check the Application event log:

Get-EventLog -LogName Application -Source Docker -Newest 100

or use Event Viewer. Search for similar error strings.

Check resource exhaustion: memory, disk, and open files

Start with memory, disk, and file descriptors; a stuck daemon is often starved for one of them.

On Linux:

free -h
df -h /var/lib/docker
df -i /var/lib/docker

/var/lib/docker is the default data root. If Docker data is stored elsewhere, adjust the path. Low free memory, full disk, or inode exhaustion can all cause the daemon to hang. Check the daemon's open file limit:

PID=$(pgrep dockerd)
grep 'Max open files' /proc/$PID/limits

If the limit is low and the daemon manages many containers, it may run out of file descriptors.

Use PowerShell on Windows to inspect the dockerd process:

Get-Process dockerd | Select-Object Id,CPU,WorkingSet,Handles

Check free space on the drive where Docker data is stored (default C:\ProgramData\Docker for Windows containers or the Docker Desktop data directory). If the daemon is responsive enough to run docker stats, that will show per-container memory and CPU usage. If not, use Task Manager or top on Linux to see which process is consuming resources.

Safely restart the Docker daemon

If the daemon is truly stuck, restart it. Try a normal restart first on Linux:

sudo systemctl restart docker

If systemctl restart docker hangs or times out, send SIGTERM to the daemon directly and then start it:

sudo systemctl kill -s SIGTERM docker
sudo systemctl start docker

If that does not work, you may need SIGKILL, but try SIGTERM first to allow a clean shutdown. Note: by default, restarting the Docker daemon stops all running containers. To keep containers running across daemon restarts, enable live-restore in /etc/docker/daemon.json:

{
  "live-restore": true
}

After adding this, run sudo systemctl restart docker to apply. With live-restore enabled, subsequent daemon restarts will keep containers running, though you cannot change container configurations while the daemon is down.

For Windows, run PowerShell as Administrator:

Restart-Service docker

Or from an elevated cmd:

net stop docker
net start docker

For Docker Desktop, restart the application from the system tray or Task Manager. Always confirm before restarting because running containers may stop unless live-restore is configured (Linux) or the platform has an equivalent setting. Note any unsaved state or running jobs.

Verify the daemon recovered and containers are healthy

After restart, run:

docker ps
docker info

docker info should return the server version and storage driver without hanging. Check that your containers are running as expected. If containers restarted due to restart policies, read their logs to understand why:

docker logs <container>

Check overall disk usage with docker system df. Run the same commands from PowerShell on Windows and verify Docker Desktop shows a healthy status.

Prevent future daemon unresponsiveness

Fix the likely causes now, or the daemon will hang again.

Configure log rotation to keep container logs from filling the disk. On Linux, edit /etc/docker/daemon.json:

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}

On Docker Desktop, open Settings > Docker Engine and add the same JSON, then restart. For Windows containers, the daemon.json is usually located at C:\ProgramData\Docker\config\daemon.json.

Set resource limits on containers so one cannot starve the daemon. Use --memory, --cpus, and --pids-limit on docker run, or equivalent settings in Compose files. Enable container healthchecks so unhealthy containers are detected early. Keep Docker Engine and Docker Desktop updated, as older versions may contain daemon deadlock bugs.

Regularly prune unused images, containers, and volumes with docker system prune after confirming they are not needed.

Once the daemon is reachable, an AI agent can help identify which container triggered the problem. Ask it to "show me the logs for the api container, last 200 lines" or "which container is eating all the memory". It can restart that container with confirmation, but host-level daemon recovery still requires the manual service restart commands above.

Related reading

Recover from an unresponsive Docker daemon

Walk through the steps to confirm the daemon is hung, check services and logs, find resource exhaustion, restart safely, and prevent recurrence.

An AI teammate that builds, runs, fixes, deploys and operates your software, on your machine and on your servers. It reads the real state of your systems, shows you every command before it runs, and never touches production without your approval.

Works with Docker Docker Compose nginx IIS Tomcat MySQL / MariaDB PostgreSQL Redis Linux servers Windows servers AWS Jenkins Let's Encrypt Node.js Python Java .NET Go PHP
  • Every change asks first, and shows you the exact command or diff before it runs.
  • File edits are snapshotted and reversible. Deleted folders are archived, not removed.
  • Private key material never reaches the model, under any setting.
brynko devOps Agent
Docker

the checkout container keeps restarting

read container state checked health check listed ports

It restarts every 40 seconds, and it is the health check failing rather than the app. The check calls /healthz on port 8080, but the app is listening on 3000, so it never passes and Docker keeps killing it.

fix it

one line in compose restarted watched 5 minutes

Done. I corrected the health check port and restarted the service. It has stayed up since, and the check is passing.

Fixed · container healthy

Free download for Windows. 300 free credits on signup, no card, no subscription.

Questions

Common questions

Why does docker ps hang instead of giving an error?
When `docker ps` hangs, the client is waiting for a response from the daemon that never arrives. An immediate error like `Cannot connect to the Docker daemon` means the socket or named pipe is unreachable. A hang indicates the daemon is up but not processing API requests, often due to deadlock or resource exhaustion.
How do I restart the Docker daemon without stopping my running containers?
On Linux, enable `live-restore` in `/etc/docker/daemon.json` before the restart. Then `sudo systemctl restart docker` will keep containers alive. On Docker Desktop, check the settings for a similar option, but Windows containers typically stop when the Docker service stops.
What is the difference between Docker daemon and containerd when troubleshooting?
The Docker daemon (`dockerd`) handles the Docker API, image management, networking, and volumes. `containerd` manages the low-level container lifecycle. If `containerd` is down, the daemon may still respond to some commands but cannot start or stop containers. Always check both logs to isolate the failure.
Where are Docker daemon logs on Windows?
Docker Desktop writes logs to `%LOCALAPPDATA%\Docker\log.txt`. For Windows containers using the Docker Engine service, check the Application event log with `Get-EventLog -LogName Application -Source Docker` or in Event Viewer.
How do I know if the Docker daemon was killed by OOM?
On Linux, search kernel logs with `dmesg | grep -i oom` or `journalctl -k | grep -i oom` for entries mentioning `dockerd` or `containerd`. On Windows, check the Event Viewer for resource exhaustion or process termination events. The daemon logs may also contain `OOM` or `out of memory` messages immediately before the hang.

Keep reading