Docker Installation Guide: Setup Docker on Linux, Windows, and macOS

  • Home
  • Blog
  • Docker Installation Guide: Setup Docker on Linux, Windows, and macOS
Learning By Kartikeya rajulapati 08 Jun 2026 11:42 PM
Docker Installation Guide: Setup Docker on Linux, Windows, and macOS
Get Docker up and running in minutes. Step-by-step instructions for installing Docker Desktop and Docker Engine on Windows, macOS, and major Linux distributions.

Installing Docker on Windows

For Windows 10/11 Pro, Enterprise, or Education

Enable Hyper-V and Containers
Open PowerShell as Administrator and run:

powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Enable-WindowsOptionalFeature -Online -FeatureName Containers -All

Restart your computer when prompted.

Download Docker Desktop
Go to docs.docker.com/desktop/setup/install/windows and download the stable release.

Run the installer

Double-click Docker Desktop Installer.exe

Keep Use WSL 2 instead of Hyper‑V checked (recommended)

Click OK and let the installation finish.

Restart your computer when asked.

For Windows 10/11 Home

Windows Home doesn’t include Hyper‑V, so you’ll use WSL 2 (Windows Subsystem for Linux).

Enable WSL
PowerShell as Admin:

powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart your PC.

Set WSL 2 as default

powershell
wsl --set-default-version 2

Install a Linux kernel update
Download and run from:
aka.ms/wsl2kernel

Install Docker Desktop
Same installer as above – Docker will automatically use WSL 2.

Post-installation on Windows

Launch Docker Desktop from the Start menu. You’ll see the whale icon in the system tray (it should turn green). Open a Command Prompt or PowerShell and test:

powershell
docker --version
docker run hello-world

Installing Docker on macOS

For Intel (x86_64) and Apple Silicon (M1/M2/M3)

Download Docker Desktop
From docs.docker.com/desktop/setup/install/mac – choose the correct chip version.

Install

Open the downloaded .dmg file

Drag the Docker icon into the Applications folder.

Launch Docker

Go to Applications → Docker

You’ll see a permission prompt – enter your macOS password.

The whale icon appears in the menu bar. Wait until it says “Docker Desktop is running”.

Verification

Open Terminal and run:

bash
docker --version
docker run hello-world

Note for Apple Silicon users: Some older images may not have ARM64 builds. Docker Desktop includes Rosetta 2 emulation for x86 containers – enable it in Settings → General → Use Rosetta for x86/AMD64 emulation.


Installing Docker on Linux

Ubuntu / Debian (Recommended method using Docker’s repo)

bash
# Update your package index
sudo apt update

# Install prerequisites
sudo apt install -y ca-certificates curl

# Add Docker’s official GPG key
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

# Add the repository
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 update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

RHEL / CentOS / Fedora

bash
# Remove older versions if any
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

# Install prerequisites
sudo yum install -y yum-utils

# Add Docker repository
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

# Install Docker Engine
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Start Docker
sudo systemctl start docker
sudo systemctl enable docker   # auto-start on boot

Post-installation Linux Steps (Important!)

By default, Docker commands require sudo. To run Docker as a non‑root user:

bash
# Create the docker group (it may already exist)
sudo groupadd docker

# Add your user to the docker group
sudo usermod -aG docker $USER

# Log out and back in (or run: newgrp docker)

After re‑logging in, test:

bash
docker run hello-world

Verifying Docker on Linux

bash
docker --version
docker run --rm hello-world
sudo systemctl status docker   # check the daemon status

Installing Docker Engine Only (No Desktop)

If you’re on a server or don’t want the GUI, you can install just the Docker Engine on Linux. For Windows Server, Microsoft provides Docker EE (Enterprise Edition). For macOS without GUI, consider using colima or lima – but Docker Desktop is the standard.


Common Installation Issues and Fixes

 
 
ProblemSolution
“Docker Desktop requires Hyper-V” (Windows)Enable Hyper-V as shown above, or use WSL 2 on Windows Home.
“Cannot connect to the Docker daemon” (Linux)Start the daemon: sudo systemctl start docker (or add user to docker group and reboot).
Permission denied for /var/run/docker.sock (Linux)Run sudo usermod -aG docker $USER and log out/in.
Docker Desktop won’t start on macOSCheck that no other virtualization software (VirtualBox, VMWare) is conflicting.
“Insufficient disk space”Docker stores images in ~/.docker or C:\Users\\AppData\Local\Docker. Move or clean up space.

Quick Install Using Convenience Scripts (Linux Only – Use with Care)

Docker provides a convenience script for testing/staging environments:

bash
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

⚠️ Do not use this script in production – it assumes default configurations and may update packages without your control.


Uninstalling Docker (If Needed)

Windows

Settings → Apps → Docker Desktop → Uninstall

Also remove %USERPROFILE%\.docker and %PROGRAMDATA%\Docker

macOS

Move Docker.app to Trash

Delete ~/.docker, ~/Library/Containers/com.docker.docker, and ~/Library/Group Containers/group.com.docker

Linux (Ubuntu/Debian)

bash
sudo apt purge docker-ce docker-ce-cli containerd.io
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

What’s Next After Installing Docker?

Now that Docker is installed, you can:

 

More Reads

Related Articles

Interested in our training?

To stay updated with regular alerts via email, subscribing is quick and hassle-free. Please fill out the subscription form below to receive timely updates. By providing your information, you will be added to our mailing list, keeping you informed about the latest news and announcements