Script Valley
Docker: Complete Course
Docker FundamentalsLesson 1.2

How to install Docker on Linux, Mac, and Windows

Docker Desktop, Docker Engine on Linux, apt install, brew install, WSL2 backend, post-install steps, docker group

Installing Docker

Docker installation paths

Installation differs by OS. Choose the path that matches your machine.

Linux (Ubuntu/Debian)

sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

After install, add your user to the docker group so you don't need sudo every time:

sudo usermod -aG docker $USER
newgrp docker

macOS

Download Docker Desktop from docker.com/products/docker-desktop or install via Homebrew:

brew install --cask docker

Open Docker Desktop and wait for the whale icon in the menu bar to stop animating — the daemon is ready.

Windows

Download Docker Desktop for Windows. Enable WSL2 integration in Settings → Resources → WSL Integration. Docker Desktop handles everything else automatically.

Verify the install

docker --version
docker run hello-world

Both commands should succeed. If docker run fails with a socket permission error on Linux, log out and back in so the group change takes effect.

Up next

Docker images vs containers explained

Sign in to track progress