Installing Docker on Windows Mac and Linux
Docker runs on all major operating systems. The installation steps differ slightly between platforms. This topic walks you through each one clearly. By the end, you will have Docker running and ready to use.
What You Are Installing
On all platforms, you install Docker Desktop — a complete package that includes the Docker Engine, the Docker CLI, Docker Compose, and a graphical dashboard. Docker Desktop handles everything you need as a beginner and an intermediate user.
Installing Docker on Windows
System Requirements
- Windows 10 or 11 (64-bit, version 21H2 or later)
- WSL 2 (Windows Subsystem for Linux 2) enabled
- Virtualization enabled in BIOS (most modern computers have this on by default)
Steps
Open your browser and go to docker.com. Click "Get Docker" and then "Docker Desktop for Windows." The download is an .exe installer file around 500 MB.
Run the installer. When it asks "Use WSL 2 instead of Hyper-V," keep that option checked. WSL 2 gives better performance. Click Install and let it finish.
After installation, restart your computer. Open Docker Desktop from the Start menu. Docker Desktop starts the Docker Daemon in the background. You see the Docker whale icon in your system tray when it is running.
Open PowerShell or Windows Terminal and type:
docker --version
You see output like Docker version 25.0.3, build 4debf41. Docker is ready.
Installing Docker on macOS
System Requirements
- macOS 12 (Monterey) or later
- Apple Silicon (M1/M2/M3) or Intel chip — Docker Desktop supports both
Steps
Go to docker.com and download Docker Desktop for Mac. Pick the right version — Apple Silicon if your Mac has an M-series chip, or Intel chip for older Macs.
Open the downloaded .dmg file. Drag the Docker icon into your Applications folder. Open Docker from Applications. macOS asks for your password to install the helper tools — enter it.
Wait for the Docker whale icon to appear in your menu bar and stop animating. That means Docker is running. Open your Terminal and run:
docker --version
You get a version number. Installation complete.
Installing Docker on Linux (Ubuntu)
Linux gets the Docker Engine directly — no full Docker Desktop is required (though a Linux version of Docker Desktop exists too). The Engine approach is lighter and preferred on servers.
Steps
Open your terminal. Remove any old versions of Docker that might conflict:
sudo apt-get remove docker docker-engine docker.io containerd runc
Update your package list and install dependencies:
sudo apt-get update sudo apt-get install ca-certificates curl gnupg
Add Docker's official GPG key and repository:
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 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
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 Docker so it starts automatically on boot:
sudo systemctl start docker sudo systemctl enable docker
Add your user to the docker group so you do not need sudo for every command:
sudo usermod -aG docker $USER newgrp docker
Verify the installation:
docker --version
Checking Everything Works — The Hello World Test
On any platform, run this one command after installation:
docker run hello-world
Expected output: Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image. 4. The Docker daemon streamed that output to the Docker client.
If you see this output, Docker is installed correctly and working.
Common Installation Problems and Fixes
Problem: "Cannot connect to the Docker daemon" error on Linux.
Fix: Run sudo systemctl start docker to start the daemon, then try again.
Problem: Docker Desktop hangs on startup on Windows.
Fix: Open PowerShell as Administrator and run wsl --update, then restart Docker Desktop.
Problem: Permission denied on Linux when running docker commands.
Fix: Make sure you ran the usermod command above, then log out and log back in.
