Sub topic 1
What you are installing: daemon, CLI, and plugins
Docker is not one program. It is a set of parts that work together, and the install steps in later chapters make more sense once you know which part each package provides. This chapter names the parts and shows how they connect.
Prerequisites
This chapter assumes you have the following:
- Basic command-line use in a terminal.
- A general idea of what containers and images are.
- Familiarity with your operating system's package manager or installer.
You do not need Docker installed yet. The commands shown here are only for illustration, and the later chapters walk through installing and verifying everything.
The client-server model
Docker uses a client-server design. You type commands into a client. The client sends them to a server process, which does the real work of building images and running containers.
- The daemon (
dockerd) is the server. It runs in the background, manages images, containers, networks, and volumes, and listens for requests on a Unix socket, usually/var/run/docker.sock. - The CLI (
docker) is the client. It turns commands such asdocker runinto API requests and sends them to the daemon. - containerd is the container runtime that the daemon relies on. It manages the container lifecycle and image storage, and it starts containers through a low-level runtime.
Because the CLI and daemon are separate programs, they can run on different machines. A common error message, "Cannot connect to the Docker daemon", means the CLI is working but cannot reach the daemon.
Plugins
The CLI can be extended with plugins. Two matter for most installations:
- Buildx (
docker buildx) is the build client. It adds features such as multi-platform builds and a more capable build backend. Current Docker versions use it behinddocker build. - Compose (
docker compose) reads a YAML file and starts several containers as one application. It is a CLI plugin, so the command has a space, not a hyphen. The older standalonedocker-composeis a separate legacy tool.
Plugins are installed as files in a CLI plugins directory, and the docker command finds them there. If a plugin package is missing, the matching subcommand fails even though the daemon works.
How packages map to components
On Ubuntu, Docker Engine is split into packages. This table maps each package from the install command in a later chapter to the component it provides.
| Package | What it provides |
|---|---|
| `docker-ce` | The daemon, `dockerd` |
| `docker-ce-cli` | The `docker` command |
| `containerd.io` | The containerd runtime |
| `docker-buildx-plugin` | The `docker buildx` subcommand |
| `docker-compose-plugin` | The `docker compose` subcommand |
Docker Desktop bundles all of these parts into one application. On macOS and Windows it also runs the daemon inside a lightweight virtual machine, because containers need a Linux kernel. The next chapter compares Desktop and Engine in detail.
Seeing the split for yourself
Once Docker is installed, you can see the two sides of the connection. The docker version command prints a Client section and a Server section.
docker version
docker context lsThe Client section describes the CLI. The Server section describes the daemon. If the Server section is missing or shows an error, the CLI is installed but cannot reach a running daemon. The docker context ls command lists the endpoints the CLI can talk to, which is how one CLI can control a local or a remote daemon.
Why the split matters
Knowing the parts helps when something breaks:
- If
dockeris not found, the CLI package is missing or not on yourPATH. - If
dockerruns but reports it cannot connect, the daemon is stopped, or your user cannot access its socket. - If
docker composeordocker buildxis not recognized, the plugin package is missing.
Each symptom points to a different component, so you can fix the right one instead of reinstalling everything.
Exercise
You run docker version and see a Client section, but the Server section reports that it cannot connect to the daemon. Which component is the likely problem, and which package provides it on Ubuntu?
Show answer
The daemon (dockerd) is not running or is not reachable. On Ubuntu it comes from the docker-ce package. The CLI works, so docker-ce-cli is installed.
Exercise
Why is the command docker compose up written with a space rather than a hyphen, and which package provides it on Ubuntu?
Show answer
Compose is a plugin to the docker CLI, so compose is a subcommand. The docker-compose-plugin package provides it. The hyphenated docker-compose is the older standalone tool.