How to Install Docker on Windows, Mac, and Linux
Docker has become one of the most widely used tools in modern software development — and for good reason. It lets you package applications and their dependencies into portable containers that run consistently across different environments. Whether you're a developer, sysadmin, or just curious about containerization, getting Docker installed is your first practical step.
Here's what you need to know before you begin.
What Docker Actually Does (And Why Installation Varies)
Before installing anything, it helps to understand what Docker is doing under the hood. Docker uses OS-level virtualization to run isolated containers — lightweight environments that share the host machine's kernel rather than emulating an entire operating system the way traditional virtual machines do.
On Linux, Docker runs natively, because containers are a Linux technology at their core. On Windows and macOS, Docker needs a lightweight Linux virtual machine running in the background to make this work. That distinction matters because it affects system requirements, performance, and which installation method applies to you.
System Requirements You Should Check First
Before downloading anything, confirm your machine meets the baseline requirements:
| Platform | Minimum Requirement |
|---|---|
| Windows | Windows 10/11 64-bit (Pro, Enterprise, or Home with WSL 2) |
| macOS | macOS 12 Monterey or later (Intel or Apple Silicon) |
| Linux | 64-bit OS; kernel version 3.10 or higher recommended |
On Windows, Docker Desktop uses WSL 2 (Windows Subsystem for Linux 2) by default — a faster and more efficient backend than the older Hyper-V method. You'll want to ensure WSL 2 is enabled before or during installation. On older Windows versions, compatibility may be limited or require manual configuration.
Installing Docker on Windows 🖥️
- Download Docker Desktop from the official Docker website (docker.com). Always use the official source.
- Run the installer and follow the setup wizard. It will prompt you to enable WSL 2 integration if it's not already active.
- Restart your machine when prompted.
- After restarting, launch Docker Desktop. On first run, it may take a minute or two to initialize.
- Open a terminal (Command Prompt or PowerShell) and type
docker --versionto confirm the installation worked.
If WSL 2 isn't installed, Windows will typically guide you through that process during Docker setup. You may also need to enable virtualization in your BIOS/UEFI settings — this is a common stumbling block on machines where it's disabled by default.
Installing Docker on macOS 🍎
- Download Docker Desktop for Mac from docker.com. Make sure you select the correct version — Intel chip or Apple Silicon (M1/M2/M3) — as these are separate downloads.
- Open the
.dmgfile and drag Docker to your Applications folder. - Launch Docker from Applications. You'll be prompted to authorize it with your system password.
- Wait for Docker to start (the whale icon in your menu bar will stop animating when it's ready).
- Open Terminal and run
docker --versionto verify.
Apple Silicon users generally have a smooth experience with Docker Desktop, though some older container images built only for amd64 architecture may require the Rosetta 2 compatibility layer or a multi-platform image.
Installing Docker on Linux
Linux installation varies by distribution, but the general approach is consistent:
- Remove any old Docker packages your system might have pre-installed (often outdated versions labeled
docker.ioordocker-engine). - Set up Docker's official repository for your distribution. Docker maintains repositories for Ubuntu, Debian, Fedora, CentOS, and others.
- Install Docker Engine using your package manager —
apt,dnf, oryumdepending on your distro. - Start and enable the Docker service so it runs on boot:
sudo systemctl enable --now docker - Add your user to the docker group to run Docker commands without
sudo:sudo usermod -aG docker $USER, then log out and back in. - Run
docker run hello-worldto confirm everything is working.
Linux users dealing with server environments or CI/CD pipelines often install Docker Engine directly rather than Docker Desktop, since Docker Desktop's GUI is less relevant in headless or remote scenarios.
Docker Desktop vs. Docker Engine — What's the Difference?
This is a distinction worth understanding before you install:
- Docker Desktop — a graphical application that bundles Docker Engine, Docker CLI, Docker Compose, and a GUI dashboard. Designed for developers on Windows and macOS. Includes automatic updates and a visual interface for managing containers and images.
- Docker Engine — the core runtime, installed via command line. Standard on Linux servers and production environments. No GUI, lighter footprint.
Both use the same underlying technology and the same docker commands.
Common Post-Installation Issues
Even with a clean install, a few issues come up regularly:
- "Cannot connect to Docker daemon" — usually means the Docker service isn't running. On Linux:
sudo systemctl start docker. On Desktop apps: make sure Docker Desktop is open and fully initialized. - WSL 2 not installed (Windows) — Docker will prompt you, but the fix is running
wsl --installin PowerShell as Administrator. - Permission denied (Linux) — your user isn't in the docker group yet, or you haven't logged out and back in after adding yourself.
- Virtualization disabled — requires a BIOS change, which varies by motherboard manufacturer.
The Variables That Shape Your Experience
Getting Docker installed cleanly depends on a handful of factors that differ from one machine to the next: your operating system version, whether virtualization is enabled in firmware, your chip architecture, how your network or firewall handles Docker's image pulls, and whether you're working locally or on a remote server.
A developer setting up Docker Desktop on a new MacBook Pro is going to have a fundamentally different experience than a sysadmin configuring Docker Engine on a bare Ubuntu server — even though the end result, running containers, is the same. Which setup fits your situation depends entirely on what you're trying to build, how you're working, and what your machine is running.