Install Docker Compose

  • Docker is a containerization platform that lets you package and run applications in isolated environments called containers.

  • Docker Compose is a tool that lets you define and run multi-container applications using a simple YAML configuration file (e.g. docker-compose.yml).

Installation

macOS

Install Docker Desktop for Macarrow-up-right, which includes both Docker and Docker Compose.

Alternative: using Homebrew (CLI only, no GUI):

brew install docker docker-compose

Linux

Follow the official guide: https://docs.docker.com/engine/install/arrow-up-right

Debian/Ubuntu

sudo apt update
sudo apt install docker.io docker-compose
sudo systemctl enable --now docker
sudo usermod -aG docker $USER

Log out and log back in to apply group changes.

Quick setup for Fedora/RHEL

You may also need to install the Docker plugin for Compose v2:

After adding your user to the docker group, log out and log back in or run newgrp docker.

Windows

Install Docker Desktop for Windows, which includes Docker Engine and Docker Compose.

Requires WSL 2 (Windows Subsystem for Linux). Installation instructions: https://docs.docker.com/desktop/install/windows-install/arrow-up-right

Docker install verification

Create a simple docker-compose.yml file (starting nginx on port 99):

Run it

Stop it

You'll need to run this in a separate terminal from where you ran docker compose up

Last updated