Docker & Containers

Install Docker Compose v2 on Linux Without Docker Desktop

Install the Compose v2 plugin from Docker's apt repository or the release binaries, then switch your scripts from docker-compose to docker compose.

SC
Samuel Chan
Head of Supertype Incubator2 min read

Installing Docker, without Docker Desktop?

From the documentation:

Docker Compose is a tool for defining and running multi-container applications.

Compose v2 changed the command from docker-compose to docker compose, and it installs differently from v1. Instead of a standalone Python program, it ships as a plugin for the Docker CLI. This guide covers installing the plugin on Linux and moving off v1.

Docker Desktop bundles Compose, and that's how most people get it. On Linux it comes with conditions. The Ubuntu install page asks for:

an x86-64 system with Ubuntu 26.04 LTS or 24.04 LTS

That rules out older LTS releases, ARM machines, and most servers, which don't run a desktop environment at all. A few of my machines fall into those groups, so I install Docker Engine and the Compose plugin directly. Both are free and need neither Docker Desktop nor a recent distro.

Installing Docker and Docker Compose on Linux

Compose runs on top of Docker Engine, so we install both from Docker's apt repository. These commands follow Docker's Ubuntu guide, which supports Ubuntu 22.04, 24.04 and 26.04.

Add Docker's GPG key:

$ sudo apt update
$ sudo apt install 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 your apt sources:

$ sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF

Install Docker Engine with the Compose plugin:

$ sudo apt update
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Check that both work:

$ sudo docker run hello-world
$ docker compose version

Installing Docker Compose from binaries

If you already have Docker Engine but your distro isn't covered by Docker's repository, or you'd rather not add another apt source, install the Compose plugin from its release binary instead.

  1. Create the plugin directory. Docker looks for CLI plugins in /usr/local/lib/docker/cli-plugins, so a binary there works for every user on the machine:

    $ sudo mkdir -p /usr/local/lib/docker/cli-plugins
  2. Download the latest release straight into that directory as docker-compose. $(uname -m) fills in your architecture (x86_64 or aarch64), so the same command works on Intel and ARM machines:

    $ sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m)" \
        -o /usr/local/lib/docker/cli-plugins/docker-compose

    To pin a specific version, swap latest/download for download/v2.11.0 (or whichever tag you need from the release page).

  3. Make the file executable with chmod +x:

    $ sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
  4. Verify that the installation was successful:

    $ docker compose version
    Docker Compose version v5.6.0

    Compose releases have moved past 2.x, but every version from 2 onward is the same docker compose plugin this guide covers.

Transitioning away from docker-compose (version 1)

Docker Compose V2 is a major version bump release of Docker Compose. It has been completely rewritten from scratch in Golang (V1 was in Python).

If you already have a pre-existing version of docker-compose (version 1), the installation of version 2 doesn't remove that legacy version:

$ docker-compose --version
docker-compose version 1.28.2, build 67630359

If you want to transition from that legacy docker-compose 1.xx to Compose V2, consider installing compose-switch to translate docker-compose ... commands into Compose V2's docker compose .... Post-transition, you can remove the legacy version and use Compose V2 exclusively.

If you have a local Compose file, you should now run docker compose up (instead of docker-compose up). For completeness sake, an example Compose file looks like the following:

services:
  web:
    build: .
    ports:
      - "5000:5000"
    volumes:
      - .:/code
  redis:
    image: redis

Further learning resources on Docker

If you make it this far, a good "next step" is Stane's write-up on Docker and the official documentation:

Taggeddockerdocker compose
Share
The Enterprise AI Agentic Stack
From the Supertype shelf

Like this piece? Take home The Enterprise AI Agentic Stack.

The same thinking runs all the way through this 12-chapter guide, written by Samuel Chan and ready to read in an afternoon.

Claude for Market Analysis
Learn it live with our engineers

Claude for Market Analysis

A hands-on workshop for building a personal market-monitoring system with Claude: screen IDX and SGX stocks, set up alerts in plain English, and build a live dashboard with an analyst built in. Beginner-friendly.

October 28, 2026Zoom Conferencing (Online)

Save your seatSeats from Rp490.000 (about $27)

Keep reading

The Essential Guide to Docker
Docker & Containers

The Essential Guide to Docker

A Python developer's guide to get started with Docker, Docker-Compose and Docker Desktop

SA
Stane Aurelius
18 min read

Field notes, straight to your inbox

We publish what we learn building analytics and AI systems for some of the largest enterprises in the region. Subscribe and we will send the next one your way.

The latest in AI and Enterprise Analytics

We do not resell your data. We respect your privacy and trust.