Docker Compose Command Not Found? Fixes for v1 vs v2
A docker compose command not found error almost always comes down to one of two things: you’re typing the old hyphenated command on a system that only has the new plugin, or the Compose plugin simply isn’t installed. Both are quick to fix once you know which one you’re facing, and the fix is not to download an old docker-compose binary from a years-old tutorial.
This guide explains the v1 vs v2 split, walks through a diagnosis order, and gives the official install commands as documented by Docker in December 2026, when Docker’s Linux install page referenced Compose v5.6.0.
docker-compose vs docker compose: why the name changed
Docker Compose has existed in two very different forms:
| Feature | Compose v1 | Compose v2 and later |
|---|---|---|
| Command | docker-compose up |
docker compose up |
| Written in | Python | Go |
| How it’s installed | Separate program (pip, distro package or binary) | Docker CLI plugin (docker-compose-plugin), or bundled with Docker Desktop |
| Status | “no longer maintained” | Current; v5.6.0 shown on Docker’s install page |
version: key in files |
Used | Ignored |
Docker’s retired-products page says Compose v1 “has been superseded by Compose v2 (docker compose), which is written in Go and integrates with the Docker CLI,” and that “Compose v1 is no longer maintained, and users should migrate to Compose v2.” The Compose FAQ confirms that v1 “was written in Python, and is invoked with docker-compose.”
There’s one more hyphenated variant to know about: the standalone build of modern Compose, a single binary you download to /usr/local/bin/docker-compose. Docker says this method “is not recommended and is only supported for backward compatibility purposes,” and that it “uses the -compose syntax instead of the current standard syntax compose.”
Diagnose it in order
- Read the exact error.
docker-compose: command not foundmeans the hyphenated program isn't on your PATH. An error sayingcomposeis not a docker command (wording varies by Docker version) means the Docker CLI is installed but the Compose plugin isn't. - Try the space form. Run
docker compose version. If it prints a version, Compose v2 is installed and you only need to change how you type the command. - Check that Docker itself is installed. Run
docker version. Ifdockeris also not found, install Docker Engine first (step-by-step below). - Check where Docker came from. Run
apt policy docker-ce docker.ioon Debian or Ubuntu. Docker's packages and the distribution's own packages shouldn't be mixed. - Look for an old v1 binary. Run
which -a docker-composeanddocker-compose --version. A 1.x version is the unmaintained Python tool and should be removed. - Install the plugin from Docker's repository, then verify with
docker compose version.
The checks as commands:
docker compose version
docker version
apt policy docker-ce docker.io
which -a docker-compose
docker-compose --version
docker compose version tests the plugin; docker version shows client and server versions; apt policy shows which repository each package would come from (or that it isn’t installed); which -a lists every docker-compose file on your PATH; and the last command reveals whether a hyphenated binary is v1 (1.x) or a standalone v2+ build.
Fix 1: You have v2, just use the space
If docker compose version works, you’re done. Replace docker-compose with docker compose in commands, notes and scripts:
docker compose up -d
docker compose ps
docker compose logs -f
Your existing docker-compose.yml files keep working; Compose v2 accepts that filename (the preferred name is compose.yaml), and per Docker’s FAQ it ignores the old top-level version: element.
If you have years of muscle memory or documentation using the hyphen, a shell alias for your own interactive use is fine:
echo "alias docker-compose='docker compose'" >> ~/.bashrc
source ~/.bashrc
The first line appends the alias to your Bash startup file and the second reloads it in the current shell. Aliases don’t apply to scripts or cron jobs, so update those to the space form instead.
Fix 2: Install the Compose plugin (Debian and Ubuntu)
If Docker Engine is already installed from Docker’s official apt repository, Docker’s Linux install page uses:
sudo apt-get update
sudo apt-get install docker-compose-plugin
docker compose version
docker-compose-plugin places the Compose binary in Docker’s CLI plugin directory, so docker discovers it as the compose subcommand. On RPM-based distributions with Docker’s repository, the same page uses sudo yum update and sudo yum install docker-compose-plugin.
If apt says the package can’t be found, Docker’s repository isn’t configured on that machine, usually because Docker was installed from the distribution’s own packages. Docker’s Debian and Ubuntu install pages first remove conflicting packages (including docker.io, docker-compose, and on Ubuntu docker-compose-v2), then add Docker’s repository and install everything together:
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Our step-by-step guide to installing Docker Compose on Ubuntu covers the full repository setup with an explanation of every line. As of December 2026, Docker’s Debian page supports Debian 13 (Trixie) and Debian 12 (Bookworm).
Fix 3: Remove an old v1 docker-compose
If docker-compose --version reports 1.x, remove it so it can’t be run by accident. How depends on how it was installed:
sudo apt remove docker-compose
sudo rm -f /usr/local/bin/docker-compose
pip uninstall docker-compose
Use only the line that matches your install: the apt package from your distribution, a binary downloaded into /usr/local/bin, or a Python pip install. Then install the plugin as in Fix 2.
Fix 4: Manual plugin install (no package manager)
When you can’t use a repository (for example on a minimal or unusual distribution), Docker documents a manual plugin install. For your user only:
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v5.6.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
The first line uses your existing Docker config directory or defaults to ~/.docker. The plugin goes into its cli-plugins folder, is downloaded from Docker’s GitHub releases (v5.6.0 is the version in Docker’s example as of December 2026; check the releases page for newer ones, and pick the file for your CPU architecture), and is made executable. For all users, Docker’s page installs to /usr/local/lib/docker/cli-plugins/docker-compose instead. Manual installs don’t update themselves, which is the main reason the repository method is preferred.
Keeping Compose current after the fix
Installing from Docker’s repository means Compose is updated together with the rest of your system packages, so there’s nothing extra to remember:
sudo apt update && sudo apt upgrade
docker compose version
The first line refreshes package lists and installs available upgrades, including docker-compose-plugin and Docker Engine; the second confirms the version you’re now running. Before upgrading a server that runs important stacks, note the current version and skim the Compose release notes on GitHub, because major releases occasionally change defaults or deprecate options.
If you used the manual plugin install, updating means downloading the newer release file to the same path and making it executable again. If you ever find two copies (one in ~/.docker/cli-plugins and one installed system-wide), remove the one you don’t want, so it’s clear which version runs. docker compose version tells you which one the CLI is actually using.
Special cases
| Situation | What’s going on | Fix |
|---|---|---|
| Windows or macOS | Docker Desktop includes Compose with Engine and CLI | Update or reinstall Docker Desktop; check version under About Docker Desktop |
| Works as your user, not with sudo | Plugin installed under ~/.docker/cli-plugins only |
Install system-wide via apt or into /usr/local/lib/docker/cli-plugins |
| CI or script fails, terminal works | Script uses docker-compose or a different PATH |
Change the script to docker compose |
permission denied ... docker.sock |
Compose found, but no access to the daemon | Use sudo or add a trusted user to the docker group |
| Synology, TrueNAS or other appliances | Vendor ships its own Docker build | Follow the vendor’s docs; don’t mix in Docker’s apt packages |
docker group is equivalent to root on that host, so only add accounts you trust.After the fix
Once docker compose version prints a version, you’re on supported tooling. If you’re converting older notes, docker compose vs docker run shows how to turn long commands into a compose.yaml, and docker compose down vs stop explains which command keeps your data. Browse the Docker section for more.
Frequently asked questions
Is docker-compose the same as docker compose?
They do the same job, but docker-compose with a hyphen is either the old Python v1 tool or the legacy standalone binary, while docker compose with a space is the v2 plugin integrated into the Docker CLI. Docker recommends the plugin.
Can I just alias docker-compose to docker compose?
Yes, for your own shell, an alias is a harmless convenience for muscle memory or old notes. For scripts, it's better to update them to use docker compose directly.
Do my old docker-compose.yml files still work with v2?
Generally yes. Compose v2 still accepts docker-compose.yml, although compose.yaml is the preferred name, and the FAQ says it ignores the top-level version element.
Why does sudo docker compose work but not without sudo, or vice versa?
A plugin installed manually under your home directory is only found for your user, not root. Install it system-wide from Docker's repository, or into /usr/local/lib/docker/cli-plugins, so both work.
Sources
- Install the Docker Compose plugin: Docker Docs
- Overview of installing Docker Compose: Docker Docs
- Install the Docker Compose standalone: Docker Docs
- Deprecated and retired Docker products and features: Docker Docs
- How Compose works: Docker Docs
- Frequently asked questions (Compose): Docker Docs
- Install Docker Engine on Debian: Docker Docs
- Install Docker Engine on Ubuntu: Docker Docs
We research every guide from manufacturer documentation, government and standards bodies, and other primary sources, which are cited at the end of each article. We do not accept payment for coverage. Read our editorial policy to see how articles are researched, fact-checked and updated, or tell us if something is out of date.