BugMedic

“docker-compose: command not found”: switch to Compose v2

Use docker compose (space) instead of the retired docker-compose binary; install the compose plugin if it is missing.

By BugMedic editorial teamLast source review: 2026-09-28Windows, macOS, Linux

Use docker compose (space) — Compose v2 is a CLI plugin, while docker-compose (hyphen) is the retired v1 binary. If docker compose is missing too, install the docker-compose-plugin package.

Try these fixes in order

01

Try docker compose with a space

Check whether Compose v2 is already present as a plugin. A version output means you only need to change the invocation.

docker compose version
02

Install the Compose plugin if missing

On Linux Engine installs without the plugin, add the official docker-compose-plugin package, then re-run docker compose version.

sudo apt-get install docker-compose-plugin
03

Update scripts to the v2 syntax

Update scripts, Makefile targets, aliases, and CI steps that call docker-compose. Most v2 commands accept the same flags; the obsolete version: key in compose files can be removed.

04

Verify with a real project

Verify a real project still works end to end with the new command.

docker compose config
docker compose up -d

Interpret what you see

You typed docker-compose with a hyphen

What it suggests: Compose v1 (docker-compose, with a hyphen) was a separate Python tool and is retired. Compose v2 is a Go plugin invoked as docker compose with a space, and it ships with Docker Desktop and current Engine installs.

Next check: Run docker compose version to see whether v2 is already available.

docker compose (space) is also not found

What it suggests: Some Linux Engine installs omit the plugin package, so docker compose (space) is also missing.

Next check: Install the docker-compose-plugin package for your distribution.

The command worked on an older machine

What it suggests: Old tutorials, aliases, and CI scripts still call docker-compose. The fix is updating the invocation, not the Compose file.

Next check: Search your scripts and shell aliases for docker-compose and switch them to docker compose.

Why this happens

  • You typed docker-compose (hyphen), the retired v1 binary, which is no longer installed.
  • The Compose v2 plugin is not installed alongside Docker Engine on Linux.

Still not working?

Do not reinstall the old docker-compose v1 binary from random download links; it is unmaintained and will not receive fixes. Migrate scripts and aliases to docker compose and pin the plugin through your package manager.

Official sources

These steps are based on the linked documentation and general diagnostics. BugMedic has not independently tested every product and system configuration. Review commands before running them.

Related Docker guides