Skip to content

Install & Verify Docker

Docker Desktop is the recommended installation for macOS and Windows. It bundles the Docker daemon, the CLI, Docker Compose, and a lightweight Linux VM that hosts the container runtime.

  1. Download Docker Desktop from https://www.docker.com/products/docker-desktop.
  2. Run the installer and follow the prompts.
  3. Launch Docker Desktop from your Applications folder (macOS) or Start menu (Windows).
  4. Wait for the whale icon in the menu bar / system tray to stop animating — the daemon is ready.

Docker Desktop includes Docker Compose v2 (docker compose) out of the box. No separate installation is needed.

On Ubuntu or Debian, install the official Docker Engine packages:

Terminal window
# Add Docker's official GPG key
sudo apt-get update
sudo apt-get install -y ca-certificates curl
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 to apt sources
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
sudo apt-get update
# Install Docker Engine
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

For other distributions (Fedora, RHEL, Arch) the package names and package manager differ, but the general pattern is the same: add Docker’s official repository, then install the engine, CLI, and containerd packages. The official Docker docs list distro-specific instructions.

After installation, start the daemon and optionally enable it on boot:

Terminal window
sudo systemctl start docker
sudo systemctl enable docker

To run Docker commands without sudo, add your user to the docker group:

Terminal window
sudo usermod -aG docker $USER

Log out and back in for the group change to take effect.

Terminal window
docker version

Expected output (versions will differ):

Client: Docker Engine - Community
Version: 26.1.4
API version: 1.45
Go version: go1.21.11
Git commit: 5650f9b
Built: Wed Jun 5 11:29:39 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 26.1.4
API version: 1.45 (minimum version 1.24)
Go version: go1.21.11
Git commit: fc5ddd1
Built: Wed Jun 5 11:29:39 2024
OS/Arch: linux/amd64

Both a Client section and a Server section must appear. If the Server section is missing, the daemon is not running.

Terminal window
docker info

This prints the daemon’s full configuration — storage driver, number of containers and images, runtime, cgroup driver, and more. It is useful for troubleshooting and confirming the daemon is healthy.

Terminal window
docker run hello-world

Expected output:

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
Digest: sha256:...
Status: Downloaded newer image for hello-world:latest
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 which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

Seeing “Hello from Docker!” confirms the full pipeline is working: CLI, daemon, image pull from Docker Hub, and container execution.

docker version
docker run hello-world
Which operating systems use Docker Desktop as the recommended installation method?
What does `docker version` display that `docker --version` does not?
You run `docker version` and only see a Client section — no Server section. What does this most likely mean?
What is the purpose of running `docker run hello-world` after installing Docker?