Skip to content

docker-compose: command not found — How to Fix

If you’re getting docker-compose: command not found on a modern Linux system, it’s likely because Docker has changed how Compose is installed.

Quick Fix

docker compose version

Note the space instead of the hyphen. Modern Docker includes Compose as a plugin — the command is docker compose (not docker-compose).

If that works, just use docker compose going forward.

If docker compose Also Fails

Install the Compose plugin:

# Ubuntu / Debian
sudo apt update && sudo apt install docker-compose-plugin

# Fedora / RHEL
sudo dnf install docker-compose-plugin

# Arch Linux
sudo pacman -S docker-compose

Install Standalone docker-compose (Legacy)

If your Docker version doesn’t support plugins, install the standalone binary:

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

Why You’re Seeing This

Docker Compose was originally a standalone Python script (docker-compose). In 2023, Docker integrated Compose as a native plugin (docker compose). Many systems ship Docker without the standalone binary, so the hyphenated command no longer works out of the box.

CommandStatus
docker-composeLegacy standalone binary
docker composeModern plugin (recommended)

Check If Compose Is Already Installed

docker info | grep -i compose

If you see compose:, the plugin is already installed — just use docker compose instead of docker-compose.

Common Issues

Permission Denied

If the standalone binary gives permission errors:

sudo chmod +x /usr/local/bin/docker-compose

“command not found” After Installation

Ensure /usr/local/bin is in your PATH:

echo $PATH | grep /usr/local/bin

If not, add it to your shell config (~/.bashrc or ~/.zshrc):

export PATH="/usr/local/bin:$PATH"

Need more Docker help? Check our grep command guide for searching Docker logs.