Installing Docker
LEVEL 0
The Problem
You want to run containers. But Docker isn’t typically pre-installed on computers. Before we can do anything, we need to get Docker running on your machine.
The installation process differs by operating system. Let’s understand why and how.
LEVEL 1
The Concept — Docker's Home
The Concept
Remember: Docker containers use Linux kernel features. The Docker Engine is fundamentally a Linux technology.
So how does it run on Mac or Windows?
On Linux: Docker runs natively. The Docker Engine talks directly to the Linux kernel. No translation needed.
On Mac/Windows: Docker runs inside a lightweight Linux virtual machine. Docker Desktop handles this for you — it creates and manages a small Linux VM behind the scenes, and the Docker CLI on your host communicates with the Docker daemon inside that VM.
Think of it this way: on Mac or Windows, Docker Desktop builds a small Linux house inside your machine, and all your containers live in that house.
LEVEL 2
The Mechanics — Installation by Platform
The Mechanics
Linux Installation
On Linux, you install the Docker Engine directly. The exact steps vary by distribution:
- Add Docker’s official repository to your package manager
- Install the
docker-ce(Community Edition) package - Start the Docker daemon
- Add your user to the
dockergroup (so you don’t need sudo)
Mac/Windows Installation
On Mac and Windows, you install Docker Desktop:
- Download Docker Desktop from docker.com
- Run the installer
- Docker Desktop starts automatically
- A small Linux VM is created to run the Docker daemon
Docker Desktop also includes:
- Docker Compose
- A graphical interface for managing containers
- Kubernetes (optional)
- Automatic updates
LEVEL 3
Verifying the Installation
After installation, verify everything works:
docker --version
This shows the Docker CLI version. It proves the CLI is installed.
docker info
This shows detailed information about the Docker daemon. It proves the daemon is running and the CLI can communicate with it.
If you see an error like “Cannot connect to the Docker daemon,” either Docker isn’t running or there’s a permissions issue.
LEVEL 4
What's Actually Running
After installation, on a Linux system, you’ll have:
dockerd— the Docker daemon, running as a background service/var/run/docker.sock— the Unix socket where the CLI connects/var/lib/docker— where images, containers, and volumes are stored
On Mac/Windows with Docker Desktop:
- A Linux VM (using Apple’s Hypervisor Framework or Microsoft’s Hyper-V/WSL2)
- Inside that VM: dockerd, containerd, etc.
- On your host: just the Docker CLI, which tunnels to the VM