Docker Compose installation depends on your operating system and whether you already have Docker installed
Docker Compose is a tool that lets you define and run multiple Docker containers as a single application using a YAML configuration file. Before you install Compose, you need Docker itself running on your machine. The installation process differs between Windows, Mac, and Linux, and the easiest path on each platform uses your system's package manager or Docker's official installer.
On Windows and Mac, Docker Desktop includes Compose automatically — you do not need a separate installation step. On Linux, you install Compose as a standalone tool using your distribution's package manager or by downloading the binary directly from Docker's GitHub releases page. This guide walks through each platform so you can get Compose running in under ten minutes.
Key Takeaways
- Windows and Mac users get Docker Compose included with Docker Desktop, so installation happens in one step when you install Docker Desktop.
- Linux users must install Docker first, then add Compose separately using apt, yum, or by downloading the binary file directly.
- After installation, verify Compose is working by running docker-compose --version in your terminal.
- You need administrator or sudo access on your machine to complete the installation on any platform.
- Docker Compose requires Docker Engine 1.12 or newer to function, so check your Docker version before starting.
Installing Docker Compose on Windows
Windows users get Docker Compose bundled with Docker Desktop, so you only need to install Docker Desktop itself. Download the installer from Docker's official website (docker.com/products/docker-desktop), then run the executable file and follow the setup wizard. The installer asks whether you want to use WSL 2 (Windows Subsystem for Linux 2) as the backend — this is the recommended option for most users because it performs better than Hyper-V.
After Docker Desktop finishes installing, restart your computer. Open PowerShell or Command Prompt and type docker-compose --version to confirm Compose is installed and working. You should see output showing the version number, such as "Docker Compose version 2.x.x". If you see a "command not found" error, Docker Desktop may not have finished starting up — wait a minute and try again, or restart your computer.
Installing Docker Compose on Mac
Mac users also receive Docker Compose as part of Docker Desktop. Visit docker.com/products/docker-desktop and download the installer for your processor type — Apple Silicon Macs need the ARM64 version, while older Intel-based Macs need the x86_64 version. Open the downloaded .dmg file and drag the Docker icon into your Applications folder.
Launch Docker from Applications, then open Terminal and run docker-compose --version to verify the installation. Docker Compose should be ready to use immediately. If the command is not found, make sure Docker Desktop is running — you should see the Docker icon in your menu bar at the top of the screen.
Installing Docker Compose on Linux
Linux users must install Docker Engine first, then add Docker Compose separately. The exact steps depend on your Linux distribution. For Ubuntu and Debian-based systems, open a terminal and run these commands in order:
- sudo apt update
- sudo apt install docker.io
- sudo apt install docker-compose
For Red Hat, CentOS, and Fedora systems, use yum instead:
- sudo yum install docker
- sudo yum install docker-compose
After installation completes, start the Docker service by running sudo systemctl start docker, then verify both Docker and Compose are working with docker --version and docker-compose --version. Both commands should return version numbers.
Installing Docker Compose from the binary on Linux
If your Linux distribution does not have Docker Compose in its package manager, or if you need a newer version than the package manager offers, you can download the binary directly from Docker's GitHub releases page. This method works on any Linux system with curl installed.
Run these commands in order, replacing VERSION with the actual version number you want (check github.com/docker/compose/releases for the latest):
- sudo curl -L "https://github.com/docker/compose/releases/download/VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- docker-compose --version
The first command downloads the correct binary for your system. The second command makes it executable. The third command verifies the installation worked. If you see a version number, Docker Compose is ready to use.
Verifying your installation and troubleshooting
After installation on any platform, open a terminal or command prompt and run docker-compose --version. You should see output like "Docker Compose version 2.20.0" or similar. If you see an error instead, Docker Compose is not installed correctly.
The most common issue is that Docker itself is not running. On Windows and Mac, make sure Docker Desktop is open — you should see the Docker icon in your system tray or menu bar. On Linux, run sudo systemctl start docker to start the Docker service. If you still see errors after Docker is running, try restarting your terminal or command prompt window, as your system may not have reloaded the PATH variable that tells it where to find the docker-compose command.
If you installed Compose on Linux using the binary method and get a "permission denied" error, you may have missed the chmod +x step. Run that command again with the correct path to your docker-compose file.
What to do after installation
Once Docker Compose is installed and verified, you can start using it to manage containerized applications. Create a file named docker-compose.yml in your project directory and define your services inside it. A basic example might define a web service running a specific Docker image and a database service with environment variables and volume mounts.
Run docker-compose up in the directory containing your docker-compose.yml file to start all services defined in that file. Use docker-compose down to stop and remove the containers. These two commands handle the setup and teardown of your entire application stack, which is why Docker Compose is useful for development and testing workflows.
Frequently Asked Questions
Do I need to install Docker before installing Docker Compose?
Yes. Docker Compose is a tool that orchestrates Docker containers, so Docker Engine must be installed first. On Windows and Mac, Docker Desktop includes both, so you only run one installer. On Linux, you install Docker Engine separately, then add Compose afterward.
Can I use Docker Compose on older versions of Docker?
Docker Compose requires Docker Engine 1.12 or newer. Check your Docker version by running docker --version. If your version is older than 1.12, update Docker first before installing or upgrading Compose.
What is the difference between Docker Compose v1 and v2?
Version 2 is the current release and is faster and more reliable than v1. Most new installations get v2 automatically. If you have v1 installed, you can upgrade by reinstalling Docker Compose using the same method you used originally.
Why does docker-compose command not work even though I installed it?
The most common cause is that Docker is not running. On Windows and Mac, open Docker Desktop. On Linux, run sudo systemctl start docker. If Docker is running and the command still does not work, restart your terminal window so it reloads the system PATH.
Can I install Docker Compose without administrator access?
No. Installing Docker Compose requires administrator or sudo privileges on all platforms because it places files in system directories and modifies system settings. You need these permissions to complete the installation.