Skip to content
docker: 'compose' is not a docker command

docker: 'compose' is not a docker command

DodaTech 2 min read

The “docker: ‘compose’ is not a docker command” error means you are trying to use docker compose (v2 plugin) but the Docker Compose plugin is not installed. Docker ships Compose v1 as docker-compose (standalone) and v2 as a docker subcommand.

What It Means

The compose subcommand is not registered in your Docker CLI. Docker Compose is not bundled with the base Docker engine and must be installed separately — either as the standalone docker-compose binary or as the official CLI plugin.

Why It Happens

  • Docker Compose was never installed.
  • You installed Docker from a minimal package that excludes plugins.
  • You upgraded Docker but the plugin was not upgraded or was removed.
  • You are using docker compose (v2) but only have docker-compose (v1) installed.
  • The plugin directory (~/.docker/cli-plugins/) does not contain docker-compose.

How to Fix It

1. Install the Docker Compose plugin (Linux)

sudo apt update
sudo apt install docker-compose-plugin -y

For RHEL / Fedora:

sudo yum install docker-compose-plugin

2. Verify the plugin is installed

docker compose version

Expected output: Docker Compose version v2.24.0

3. Install the standalone docker-compose (v1)

sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Verify:

docker-compose --version

4. Install via pip (alternative)

pip install docker-compose

This installs the standalone v1 binary.

5. Install the plugin manually (all distros)

mkdir -p ~/.docker/cli-plugins
curl -SL "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose

FAQs

What is the difference between 'docker-compose' and 'docker compose'?
docker-compose (v1) is a standalone Python binary. docker compose (v2) is a Go-based plugin integrated into the Docker CLI. Docker recommends using the v2 plugin (docker compose) for new projects.
Why does 'docker compose' work on my other machine but not this one?
Docker Compose v2 is included with Docker Desktop (macOS/Windows) but is an optional plugin on Linux. On this machine, you likely installed Docker Engine without the plugin. Run sudo apt install docker-compose-plugin to fix it.
Can I have both v1 and v2 installed at the same time?
Yes, they coexist without conflict. docker-compose calls the standalone binary and docker compose calls the plugin. You can uninstall v1 with sudo apt remove docker-compose (or pip uninstall docker-compose) once v2 is working.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro