DevOpsDocker

How to Install Docker on Windows, Mac, and Linux (2026 Guide)

Step-by-step guide to installing Docker on Windows, macOS, and Linux. Covers Docker Desktop, Docker Engine, post-install verification, and your first container run.

TT
Daniel Brooks
5 min read
How to Install Docker on Windows, Mac, and Linux (2026 Guide)

Getting Docker installed is the first practical step in the course. The installation differs slightly by operating system — macOS and Windows use Docker Desktop, while Linux installs Docker Engine directly. This guide covers all three, plus how to verify your install and run your very first container.


Before You Install: System Requirements

macOS

  • macOS 12 (Monterey) or later
  • Apple Silicon (M1/M2/M3) or Intel processor
  • 4 GB RAM minimum (8 GB recommended)

Windows

  • Windows 10/11 64-bit (Home or Pro)
  • WSL 2 enabled (Windows Subsystem for Linux)
  • Virtualisation enabled in BIOS/UEFI
  • 4 GB RAM minimum

Linux

  • 64-bit OS (Ubuntu 20.04+, Debian 11+, Fedora 38+, RHEL 8+ are all supported)
  • Root or sudo access

Install Docker on macOS

The recommended way on macOS is Docker Desktop, which bundles Docker Engine, Docker CLI, Docker Compose, and a local Kubernetes cluster in one app.

Step 1: Download Docker Desktop

Go to docker.com/products/docker-desktop and download the correct installer for your Mac (Apple Silicon or Intel).

Step 2: Install the Application

Open the downloaded .dmg file and drag Docker to your Applications folder. Launch Docker from Applications or Spotlight.

Step 3: Complete Setup

Docker Desktop will walk you through accepting the subscription agreement and initial configuration. Once the whale icon in the menu bar stops animating, Docker is running.

Step 4: Verify

Open Terminal and run:

bash
docker --version
docker run hello-world

You should see Docker's version string, then a message from the hello-world container confirming everything works.


Install Docker on Windows

Docker Desktop on Windows requires WSL 2. If you haven't enabled it yet, start there.

Step 1: Enable WSL 2

Open PowerShell as Administrator and run:

powershell
wsl --install

This installs WSL 2 and Ubuntu by default. Restart your machine when prompted.

Step 2: Enable Virtualisation

Make sure virtualisation is enabled in your BIOS/UEFI. On most modern machines it is already on. You can verify in Task Manager → Performance → CPU — look for "Virtualisation: Enabled."

Step 3: Download and Install Docker Desktop

Download Docker Desktop for Windows from docker.com. Run the installer. When prompted, ensure Use WSL 2 instead of Hyper-V is checked. Follow the wizard and restart when requested.

Step 4: Verify

Open PowerShell or Windows Terminal and run:

powershell
docker --version
docker run hello-world

Install Docker on Linux

On Linux, you install Docker Engine directly. The following instructions are for Ubuntu/Debian. For other distributions, see the Docker Engine installation docs.

Step 1: Uninstall Old Versions

bash
sudo apt-get remove docker docker-engine docker.io containerd runc

Step 2: Set Up the Repository

bash
# Update apt and install prerequisites
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg

# Add Docker's official GPG key
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
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Add the repository
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

Step 3: Install Docker Engine

bash
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Step 4: Start and Enable Docker

bash
sudo systemctl start docker
sudo systemctl enable docker

Step 5: Run Docker Without sudo (Recommended)

bash
sudo usermod -aG docker $USER
newgrp docker

Log out and back in for the change to take effect.

Step 6: Verify

bash
docker --version
docker run hello-world

Verify Your Installation

Regardless of OS, these commands confirm Docker is installed and working:

bash
# Check Docker Engine version
docker --version

# Check Docker Compose version
docker compose version

# Run a test container
docker run hello-world

The hello-world run checks your local image cache, pulls the hello-world image from Docker Hub, creates and starts a container from it, prints a confirmation message, and exits. If you see "Hello from Docker!", your installation is complete.


What Docker Desktop Gives You

For macOS and Windows users, Docker Desktop includes:

FeatureDescription
Docker EngineThe core container runtime
Docker CLIdocker command in terminal
Docker Composedocker compose command
Docker ScoutImage vulnerability scanning
Local KubernetesSingle-node K8s cluster (enable in settings)
GUI DashboardView containers, images, volumes visually

You'll mostly use the CLI throughout this course, but the Docker Desktop dashboard is helpful for inspecting running containers visually.


Enabling Kubernetes in Docker Desktop

You won't need this until Part 2 of the course, but it's worth enabling now so it's ready:

  1. Open Docker Desktop
  2. Go to Settings → Kubernetes
  3. Check Enable Kubernetes
  4. Click Apply & restart

This spins up a single-node Kubernetes cluster locally, which you'll use from Lesson 6 onwards.


Previous: Lesson 1 — What Is Docker? | Next: Lesson 3 — Docker Images & Containers


Part of the Docker & Kubernetes Mastery course.

External references: