Docker has become the de-facto standard for containerizing applications, enabling developers to package applications with all dependencies in isolated environments. However, many developers run into a confusing situation:
They successfully install Docker, but when they try to run docker-compose, they get an error like:
docker-compose: command not found
In this blog, we’ll explore why this happens, explain the difference between Docker and Docker Compose, and provide simple solutions to get Docker Compose installed and working.
✅ Understanding the Difference: Docker vs Docker Compose
- Docker is the core engine that allows you to build, run, and manage containers.
- Docker Compose is a separate tool designed to help define and run multi-container Docker applications. It uses a
docker-compose.ymlfile to configure services, networks, and volumes in one place.
They are related but installed separately.
✅ Why Docker Compose Might Not Be Installed
1️⃣ Separate Installation
On many systems, installing Docker does not automatically install Docker Compose.
For example:
- Installing Docker via the official convenience script or package manager often installs only the Docker Engine.
- Older distributions do not bundle Docker Compose by default.
2️⃣ Docker Compose v2 vs v1 Confusion
- Docker Compose v1: A standalone Python-based executable called
docker-compose. - Docker Compose v2: Now integrated as a Docker CLI plugin.
Depending on your installation method, you may need to use:
docker compose
(with a space) instead of:
docker-compose
If docker-compose is not found, check if the newer docker compose works.
✅ ✅ How to Install Docker Compose
✅ Option A – Install as a Docker CLI Plugin (Recommended)
If you have Docker v20.10+, Docker Compose v2 is often available as a plugin.
Test by running:
docker compose version
If that works, no further installation is needed.
✅ Option B – Install Docker Compose Manually
If docker compose does not work, you can install Docker Compose manually.
Step 1 – Download the Binary
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Step 2 – Apply Execute Permission
sudo chmod +x /usr/local/bin/docker-compose
Step 3 – Verify Installation
docker-compose --version
✅ Option C – Install via Package Manager (Linux)
For Ubuntu/Debian:
sudo apt update
sudo apt install docker-compose
However, this may install an older version.
✅ ✅ Best Practices
- Prefer using
docker compose(without hyphen) if supported — it ensures better compatibility and is actively maintained. - Avoid using outdated package manager versions unless necessary.
- Always check your Docker version:
docker --version
✅ Conclusion
If Docker is installed but docker-compose is not found, it’s likely because Docker Compose is not bundled by default.
The best approach today is to use the built-in Docker Compose plugin via:
docker compose up
If unavailable, manually installing the docker-compose binary ensures you’re ready to run multi-container applications reliably.