Skip to content

How to Fix Docker Daemon Not Running Error

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix Docker Daemon Not Running Error. We cover key concepts, practical examples, and best practices.

You run docker ps and see Cannot connect to the Docker daemon. Is the docker daemon running? — the Docker daemon is not running or the socket is unreachable.

The Problem

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

This error means the dockerd process is not running, or your user cannot access the socket.

Step-by-Step Fix

Step 1: Check if dockerd is running

sudo systemctl status docker

Expected output when stopped:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
   Active: inactive (dead)

Step 2: Start the Docker daemon

sudo systemctl start docker

Verify it started:

sudo systemctl status docker

Expected output:

● docker.service - Docker Application Container Engine
   Active: active (running) since ...

Step 3: Enable Docker on boot

sudo systemctl enable docker

Step 4: Verify the socket exists

ls -la /var/run/docker.sock

Expected:

srw-rw---- 1 root docker 0 ... /var/run/docker.sock

Step 5: Test connection

docker ps

Expected:

CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

If you still see a permission error, add your user to the docker group:

sudo usermod -aG docker $USER
newgrp docker

Prevention Tips

  • Enable Docker to start on boot with sudo systemctl enable docker
  • Monitor the Docker service with systemctl status docker or monitoring tools
  • After system updates, verify Docker is running
  • Do not manually stop dockerd unless troubleshooting
  • Use journalctl -u docker to check daemon logs if it crashes

Common Mistakes with daemon not running

  1. Using return to exit a function early instead of wrapping a pure value in the monad
  2. Mixing let bindings with <- bindings in do notation, producing type errors
  3. Overlapping type class instances that cause GHC to reject the program with ambiguous dispatch errors

These mistakes appear frequently in real-world DOCKER code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Why does Docker daemon stop unexpectedly?

The daemon may stop due to out-of-memory conditions, disk space exhaustion, or configuration errors. Check journalctl -u docker --since "5 minutes ago" for crash reasons. Increase system memory or free disk space if needed.

Can I run Docker without systemd?

Yes. Start the daemon manually with sudo dockerd & or configure your init system (Upstart, SysVinit, or openrc) to manage it. On WSL2, use sudo service docker start.

What if /var/run/docker.sock is missing?

The socket is created by dockerd when it starts. If it's missing, dockerd failed to start. Check journalctl -u docker for errors, reinstall Docker if the binary is corrupted, or check if another process is blocking port 2375/2376.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro