Docker Tutorial — Client-Server Model

1 minute read

Docker uses a client-server architecture. The Docker CLI (client) sends commands to the Docker daemon (server), which does the actual work of building images and running containers.


The Architecture

You (type commands)
    │
    ▼
Docker CLI (client)
    │ REST API (usually via Unix socket)
    ▼
Docker Daemon (dockerd)
    │
    ├──► containerd (manages container lifecycle)
    │       │
    │       ▼
    │     runc (creates the container using Linux kernel features)
    │
    ├──► Image storage
    ├──► Volume management
    └──► Network management

Key Insight

The CLI and daemon can run on different machines. When you use Docker Desktop on macOS, the CLI runs on macOS but the daemon runs inside a Linux VM. When you use Docker in CI/CD, the CLI might run in one container while the daemon runs as a service.

# Default: CLI connects to local daemon via Unix socket
$ docker info
# Server: Docker Engine - Community

# Remote: CLI connects to daemon on another machine
$ docker -H tcp://remote-host:2376 info

Quick Reference

Docker CLI    → sends REST API requests
Docker Daemon → receives requests, manages containers/images/volumes/networks
containerd    → manages container lifecycle (start, stop, pause)
runc          → creates containers using Linux namespaces + cgroups

← Architecture Docker Daemon & containerd →

Updated: