Installing Docker
Docker ships in two flavors. Docker Desktop is a polished application for macOS and Windows that bundles the engine, CLI, a GUI, and a built-in Kubernetes. Docker Engine is the standalone daemon you install directly on Linux servers. Choose Desktop for local development on a Mac or PC, and Engine for production hosts and CI runners.
macOS and Windows: Docker Desktop
Docker Desktop runs the Linux-based Docker Engine inside a lightweight VM and exposes it through a native app.
- Download the installer from docker.com/products/docker-desktop.
- On macOS, drag Docker.app into
/Applications. On Windows, run the.exeand accept the WSL 2 backend when prompted. - Launch Docker Desktop and wait for the whale icon in the menu bar / system tray to stop animating.
On Windows, Docker Desktop requires the WSL 2 backend. If the installer reports it is missing, run
wsl --installin an elevated PowerShell, reboot, then start Docker Desktop again.
On Apple Silicon Macs, Docker runs ARM64 images natively and emulates amd64 images via Rosetta when needed. Prefer multi-architecture images for the best performance.
Linux: Docker Engine
On Linux you install the engine straight onto the host. The official convenience script handles repositories and dependencies across most distributions:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
For Ubuntu/Debian using the package repository directly:
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo $VERSION_CODENAME) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
To run Docker without sudo, add your user to the docker group, then log out and back in:
sudo usermod -aG docker $USER
The
dockergroup grants root-equivalent access to the host. Only add trusted users to it.
Verifying the installation
First confirm the client and daemon are both present and talking to each other:
docker version
Output:
Client:
Version: 27.1.1
API version: 1.46
Go version: go1.21.12
Server: Docker Engine - Community
Engine:
Version: 27.1.1
API version: 1.46 (minimum version 1.24)
If the Server block is missing, the daemon is not running — start Docker Desktop, or on Linux run sudo systemctl start docker.
Now run the canonical smoke test, which pulls a tiny image and runs it once:
docker run hello-world
Output:
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
Seeing this message confirms the full pipeline works: the CLI reached the daemon, the daemon pulled an image from Docker Hub, created a container, and ran it. You are ready to start working with images and containers.