Linux Cannot connectHigh

Docker Daemon Not Running: Causes and Quick Fix in Linux

This article explains what the 'Docker Daemon not running' error means in Linux and provides step-by-step instructions to start, diagnose, and configure the Docker service via systemd for major distributions.

Updated at February 16, 2026
5-10 min
Easy
FixPedia Team
Применимо к:Ubuntu 22.04+Debian 11+CentOS 8+/RHEL 8+Fedora 35+

What the "Cannot connect to the Docker daemon" Error Means

The Cannot connect to the Docker daemon error (or docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?) means that the docker client utility (for example, the docker ps command) cannot establish a connection with the background process—the Docker daemon (dockerd).

The daemon is the service that manages all Docker objects: images, containers, networks, volumes. Without a running daemon, any docker command is useless. The error appears immediately after entering the command and typically does not include a long stack trace.

Common Causes

  1. The Docker service is stopped. The most frequent cause. The daemon is simply not running on the system.
  2. The service failed to start. Docker attempted to start but encountered a problem (e.g., port conflict, error in daemon.json configuration, insufficient memory).
  3. Docker is not configured for autostart. After a computer reboot, the service does not start automatically.
  4. Port conflict. If a TCP port (e.g., -H tcp://0.0.0.0:2375) is specified in /etc/docker/daemon.json or in the launch arguments, and that port is already occupied by another application, the daemon will fail to start.
  5. Corrupted Docker files. Critical package files (binaries, configs) may have been damaged during an update or a crash.
  6. Insufficient user permissions. The user running docker may not have permission to access the /var/run/docker.sock socket (although this usually causes Permission denied rather than "daemon not running," it can be related).

Solution 1: Start and Check Service Status via systemd

On modern Linux distributions (Ubuntu, Debian, CentOS 7+, RHEL 7+, Fedora), Docker is managed via systemd.

  1. Check the service status:
    sudo systemctl status docker
    

    Look for the Active: line. If it shows inactive (dead) or failed — the service is not running.
  2. Start the service:
    sudo systemctl start docker
    
  3. Enable autostart (so you don't have to start it manually after each reboot):
    sudo systemctl enable docker
    

    You will see a symbolic link being created.
  4. Verify the daemon is running:
    sudo systemctl is-active docker
    

    The command should return active.
  5. Try running a Docker command:
    docker version
    

    Or
    docker ps
    

💡 Tip: If systemctl start docker finishes instantly without errors, but status shows failed, check the logs: sudo journalctl -u docker.service --no-pager -n 50.

Solution 2: Diagnostics via systemd Logs

If the service fails to start, its logs will contain the reason for the failure.

  1. View the latest log entries for the Docker service:
    sudo journalctl -u docker.service --no-pager -n 100
    

    Look for lines starting with docker[...]: or simply error messages (error, failed, cannot).
  2. Common errors in logs and their solutions:
    • Error starting daemon: pid file found, ensure Docker is not running or delete /var/run/docker.pid — delete the lock file: sudo rm /var/run/docker.pid and try again.
    • failed to start daemon: port is already allocated — port conflict. Find the process using the port (by default, for Unix sockets there is no conflict, but if TCP is used): sudo lsof -i :2375. Stop the conflicting process or change Docker's port in /etc/docker/daemon.json.
    • Error initializing graphdriver: overlay — issue with the storage driver (overlay/overlay2). Often resolved by updating the kernel or switching the driver in daemon.json.

Solution 3: Check and Configure the daemon.json File

Invalid JSON in /etc/docker/daemon.json can prevent startup.

  1. Validate the file's syntax:
    sudo cat /etc/docker/daemon.json | python3 -m json.tool > /dev/null && echo "JSON valid" || echo "JSON invalid"
    

    If the output is JSON invalid, edit the file (sudo nano /etc/docker/daemon.json) and fix errors (extra commas, incorrect quotes).
  2. Temporarily disable the configuration for testing:
    sudo mv /etc/docker/daemon.json /etc/docker/daemon.json.bak
    sudo systemctl restart docker
    

    If Docker starts after this — the problem is in the configuration. Restore your settings one by one, restarting the service after each change.

Solution 4: Check System Resources and Dependencies

The Docker daemon may require specific resources or kernel modules.

  1. Ensure the overlay kernel module is loaded (for the overlay2 driver):
    lsmod | grep overlay
    

    If the output is empty, load the module: sudo modprobe overlay.
  2. Check if there is enough space on the /var partition. Docker stores images and data there. If space runs out, the daemon may fail to start:
    df -h /var
    
  3. For RHEL/CentOS-based distributions: Ensure the containerd.io package is installed and running:
    sudo systemctl status containerd
    

Solution 5: Full Reinstallation of Docker (if other solutions fail)

  1. Remove Docker packages: For Debian/Ubuntu:
    sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    sudo rm -rf /var/lib/docker /etc/docker
    

    For RHEL/CentOS/Fedora:
    sudo yum remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    sudo rm -rf /var/lib/docker /etc/docker
    
  2. Reinstall Docker by following the official guide for your distribution. This ensures you get correct dependencies and configuration files.

Prevention

  • Always enable autostart: After the initial Docker installation, immediately run sudo systemctl enable docker.
  • Monitor kernel updates: After a kernel update (especially on RHEL-compatible distributions), a reboot may be required. Check Docker's status after rebooting.
  • Do not edit /etc/docker/daemon.json without validating syntax. Use a JSON validator or the python3 -m json.tool command.
  • Regularly check disk space, especially in /var/lib/docker. Container logs can grow very quickly.
  • Avoid running Docker manually (dockerd &). Always use systemctl so systemd can properly manage the process and capture its logs.

F.A.Q.

Why does Docker work after reboot but not after logging out?
What to do if `systemctl start docker` fails with an error?
Can lack of user permissions cause this error?
What is the difference between `dockerd` and `docker.service`?

Hints

Check the current status of the Docker service
Start the Docker service manually
Enable autostart for the service
Check for port conflicts
Reinstall Docker (last resort)
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community