Skip to content

Installation

First PublishedByAtif Alam

This page covers installing Docker so you can build and run containers. You can use Docker Engine (CLI + daemon) or Docker Desktop (adds a GUI and simpler setup on Mac/Windows).

Install Docker Engine using your distro’s package manager. Example for Ubuntu/Debian:

Terminal window
# Add Docker's official GPG key and repo
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Start and enable the daemon:

Terminal window
sudo systemctl start docker
sudo systemctl enable docker

Add your user to the docker group so you can run docker without sudo:

Terminal window
sudo usermod -aG docker $USER
# Log out and back in for the group to take effect
  • Option A — Docker Desktop: Download from docker.com/products/docker-desktop. Includes Docker Engine, CLI, Compose, and a GUI. Easiest for most users.
  • Option B — Colima + CLI: Install Docker CLI and use Colima to run the daemon in a lightweight VM: brew install docker colima then colima start.
  • Recommended: Install WSL2 (Windows Subsystem for Linux), then install Docker Engine inside your WSL2 distro (same as Linux above). Alternatively, install Docker Desktop for Windows and enable the WSL2 backend so containers run inside WSL2.

Run the official hello-world image:

Terminal window
docker run hello-world

You should see a message that Docker is working. Then try:

Terminal window
docker version
docker info
  • On Linux, install Docker Engine and the Compose plugin via the official Docker repo; add your user to the docker group.
  • On macOS and Windows, Docker Desktop is the simplest option; on Windows use the WSL2 backend.
  • Confirm with docker run hello-world and docker version.