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 versionNote 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-composeInstall 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-composeVerify:
docker-compose --versionWhy 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.
| Command | Status |
|---|---|
docker-compose | Legacy standalone binary |
docker compose | Modern plugin (recommended) |
Check If Compose Is Already Installed
docker info | grep -i composeIf 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/binIf 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.