Skip to content
Commitpedia
Log in Join & edit

Install Docker on Linux, macOS and Windows

Docker Desktop or Docker Engine? Pick the right one for your OS, install it, and confirm with docker run hello-world. Covers the WSL 2 requirement on Windows and running docker without sudo on Linux.

Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?

Edit history of Install Docker on Linux, macOS and Windows: 1 recorded edit
Edit history · 1 edit
Type
Article
Edits
1
Editors
1
First issued
15 Oct 2026
Last edit
15 Oct 2026
Reading
3 min

Which option to pick

There are two products. Docker Engine is the daemon and command-line client; it runs natively on Linux only and is free and open source (Apache 2.0). Docker Desktop bundles Engine inside a lightweight virtual machine together with a graphical dashboard, Compose, Kubernetes and automatic updates; it is the way to get Docker on macOS and Windows, and it also exists for Linux desktops. Docker Desktop is free for personal use, education and small businesses, but companies above Docker’s size threshold need a paid subscription, so on a work laptop check with your IT department. On Linux servers and for most Linux developers, Engine is the normal choice.

Step: Linux (Docker Engine)

The maintained way is Docker’s own package repository for your distribution; the entry on installing Docker Engine on Ubuntu and Debian has the full steps. For a quick setup on a test machine Docker also provides a convenience script that detects the distribution and sets up the repository for you:

Check before you run this

  • Runs with administrator rights. Make sure you understand every line.
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
newgrp docker

Read a script before piping it to sh with root rights; the download step above lets you do that. Docker itself recommends the repository method for production systems. The usermod line lets your user run docker without sudo; it takes effect in new login sessions, and newgrp docker applies it to the current shell. Careful: members of the docker group effectively have root access on the machine.

Step: macOS (Docker Desktop)

brew install --cask docker

Or download Docker.dmg from the Docker Desktop page, choosing the Apple Silicon or Intel build, and drag it to Applications. Start Docker Desktop from Applications once; it asks for permission to install its helper and then shows a whale icon in the menu bar. The docker command only works while the application is running. If you prefer a lighter, command-line-only setup, Colima and OrbStack are popular alternatives that run Docker Engine in a VM without Docker Desktop.

Step: Windows (Docker Desktop)

Docker Desktop on Windows uses WSL 2 (Windows Subsystem for Linux) as its backend. Enable it first in an administrator PowerShell, then reboot if asked:

wsl --install
wsl --update

Then install Docker Desktop:

winget install Docker.DockerDesktop

Or run the installer from the Docker Desktop page. Keep Use WSL 2 instead of Hyper-V selected. Log out and back in when the installer asks, start Docker Desktop from the Start menu, and wait until the status in the bottom-left corner says the engine is running. In Settings, Resources, WSL integration, enable your Linux distributions so docker works inside them as well as in PowerShell.

Check it works

docker version
docker run hello-world
docker compose version

docker version must show both a Client and a Server section; if the server part is missing, the daemon is not running or not reachable. hello-world downloads a tiny image and prints a confirmation message.

Common problems

  • Cannot connect to the Docker daemon ... Is the docker daemon running?: on macOS and Windows start Docker Desktop; on Linux run sudo systemctl start docker and sudo systemctl enable docker.
  • permission denied while trying to connect to the Docker daemon socket on Linux: your user is not in the docker group yet, or you have not logged in again since adding it.
  • Windows: WSL 2 installation is incomplete or Docker Desktop will not start: run wsl --update and make sure virtualization is enabled in the BIOS/UEFI.
  • Windows: docker works in PowerShell but not inside Ubuntu (WSL): enable the distribution under WSL integration in Docker Desktop settings instead of installing Docker Engine inside WSL.
  • macOS: an image built on an Apple Silicon Mac does not run on an amd64 server. Build with docker build --platform linux/amd64 or a multi-platform build.

Official documentation

Did this work for you?

No votes yet. Be the first.

If it did not work, the report form below tells the editors what went wrong.

See also

  • 0055 Docker basics: images, containers and the commands you need An image is a read-only package of an app and its dependencies, and a container is a running instance of it. Learn… Beginner · Explains an idea · Linux, macOS, Windows Article Docker basics 15 Oct 2026
  • 0056 Docker Compose: run a small web app with a database Docker Compose describes several containers, their ports, volumes and environment in one compose.yaml file, then starts them all with docker compose up. Intermediate · Step by step · Linux, macOS, Windows Article Docker basics · Docker Compose 15 Oct 2026
  • 0250 Containerize a Node.js app and run it with PostgreSQL using Docker Compose Package a small Node.js web app in a multi-stage Docker image, then run it next to PostgreSQL with Docker Compose, named volumes,… Intermediate · Guided project · Linux, macOS, Windows Article Docker basics · Docker Compose · PostgreSQL 15 Oct 2026
  • 0268 What is a container? A container is a lightweight box that packs a program with everything it needs so it runs the same on any computer. Beginner · Explains an idea · Any system Article Docker basics 15 Oct 2026
  • 0327 Docker images, containers and volumes explained An image is a read-only template, a container is a running copy of it with a thin writable layer, and a volume… Beginner · Explains an idea · Linux, macOS, Windows Article Docker basics 15 Oct 2026
  • 0328 Install Docker Engine on Ubuntu and Debian Set up Docker's official apt repository, install Docker Engine with the Compose and Buildx plugins, run hello-world and let your user run… Beginner · Step by step · Linux Article Docker basics · Packages & updates 15 Oct 2026

Repos in the wild

History

Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.

  1. Dominik +4,043 chars

Report a problem

Something wrong, unsafe or copied? Tell the editors.
What is wrong?