What is the Docker daemon, and how does the CLI reach it?

By Christophe Paka · Facts checked on 7 November 2026

You type docker run and Docker answers with an error about connecting to the daemon. You never installed anything called a daemon. You only installed Docker.

So what is the Docker daemon? It is the background program that does the work. The docker command you type is only a messenger. The figure below shows the three moving parts, the client, the host and the registry, and how one command travels between them. Once you see it, that error message stops being mysterious.

Docker architecture. A client with docker build, pull and run sends REST API requests to the daemon on the Docker host, which manages containers and images and pulls from or pushes to a registry such as Docker Hub.
Figure 3.1 Every command travels from the CLI to the daemon; the daemon does the work and talks to the registry.
Use this diagram on your site

Free to share in your blog post, docs, course or slides, as long as the credit link stays. Paste the code below where the figure should go.

How to read this figure

  1. Start with the client. The left column is the client: the docker CLI. The three boxes are commands you know: build, pull and run. The note says it is a messenger: it sends requests and does none of the work itself. The plain lines carry no arrowheads; read each one as the command going from the client to the daemon.

  2. Follow the lines to the host. Each command is a line that reaches the Docker daemon, called dockerd, in the middle column. The label says REST API: the CLI sends each order as a web style request, an API call, over a socket or over the network. A socket is a local file the daemon listens on; you do not need to touch it to follow along.

  3. Meet the daemon. The blue box says it listens for API requests and does all the work. It also manages two things below it, shown by the arrows: containers and images. Picture a restaurant: the daemon is the kitchen, and the docker command is the waiter who carries your order in.

  4. Read containers and images. Images are local and read only: ubuntu and nginx here. Containers are instances of images. The arrow labelled run goes from an image to a container, so web and db here are running copies of images.

  5. Look right at the registry. The right column is the registry, Docker Hub by default. It stores images between machines, and the figure notes that pulls are rate limited, a cap on how many Docker Hub allows. Pull moves an image from the registry to your local images. Push sends one back.

  6. Read the bottom bar. It sums up three verbs. Pull: registry to local images. Build: the daemon creates new layers into images. Run: the daemon starts a container from an image.

Key takeaways

  • Read an error about connecting to the daemon as: the daemon is not running, so start Docker Desktop, or on Linux follow the official install steps.
  • Run docker version to check both halves; it should print a Client section and a Server section.
  • Treat the Docker socket as a root key: whoever can write to that local file controls the daemon, and so the machine.

Try this: check that the client and daemon both answer

You need Docker installed and a terminal. This takes a minute and shows both halves of the figure working.

  1. Run docker version. Before you run it, predict how many sections the output will have, and why.
  2. Read the reply. You should see a Client section and a Server section, because the CLI and the daemon are two programs.
  3. If you see only the Client and an error about connecting, the daemon is not running. Start Docker Desktop. On Linux, the book's install chapter gives the steps; if you see "permission denied" instead, your user may not be allowed to talk to the daemon, and that chapter covers it too.
  4. Run docker run hello-world. Docker downloads a small test image from the registry and prints that your installation appears to be working.

Expected result: Two sections in the output, then a greeting from hello-world. You just saw the client send a command, the daemon do the work, and the registry supply an image.

Questions readers ask

Why does Docker say it cannot connect to the daemon?

The CLI could not reach the daemon, usually because the daemon is not running. On a Mac or Windows PC, start Docker Desktop. On Linux, check the install steps on the official page. Then run docker version again to confirm that a Server section appears.

What is the Docker socket, and is it safe to share?

By default, orders reach the daemon only from your own machine, through a local file: /var/run/docker.sock. Whoever can write to it controls the daemon. A dashboard such as Portainer, a web page for managing containers, gets the same power if it mounts (is given access to) that file, so run only one you trust.

Can the daemon run on a different machine from the CLI?

Yes. The CLI only sends requests, so the daemon can be local or on a remote machine. That is why anyone who can hand the CLI an order to a remote daemon controls the whole kitchen.

What are containerd and runc?

Below the daemon sits containerd, a background program you never talk to, like the shift manager. The daemon takes your order, containerd starts and watches the container, and runc builds its walls. See the walls in the next figure.

Sources: Docker overview (Docker docs); Install Docker Engine (Docker docs); Linux post-installation steps (Docker docs).

This figure is from Docker Made Crystal Clear, chapter 3.

The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.

Get the book

All diagrams