Docker Compose Installation on Windows
Here is a guide to install Docker Compose on Windows 10 and 11.
Prerequisites
Before you begin, ensure that Docker Desktop is installed and running on your Windows system. If you don't have Docker Desktop installed, follow the instructions here.
Install Docker Compose
Verify Docker Installation
First, ensure that Docker is installed on your system by running the following command in Command Prompt or PowerShell:
docker -v
You should see output similar to:
# Docker version 25.0.3, build 4debf41
If Docker is not installed, refer to the following instructions here
Download Docker Compose
Check the latest available version of Docker Compose on GitHub.
If you want to install a specific version of Docker Compose, you can just set it into the variable latest_version as shown in the example below:
latest_version="v1.29.2"
If you want to install the latest version, you can use the following command to fetch the latest version number:
latest_version=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
echo "Latest version is $latest_version"
Then, download Docker Compose using the command below, replacing <latest_version> with the version number you obtained:
curl -L "https://github.com/docker/compose/releases/download/<latest_version>/docker-compose-Windows-x86_64.exe" -o "C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe"
Add Docker Compose to Path
Make sure Docker Compose is accessible from the command line by adding it to your system PATH:
- Open the Start menu, search for "Environment Variables", and select "Edit the system environment variables".
- In the System Properties window, click on the "Environment Variables" button.
- In the Environment Variables window, under "System variables", select the "Path" variable and click "Edit".
- Click "New" and add the path to the directory where
docker-compose.exeis located, typicallyC:\Program Files\Docker\Docker\resources\bin. - Click "OK" to close all windows.
Verify the Installation
To verify that Docker Compose is installed correctly, open a new Command Prompt or PowerShell window and run the following command:
docker-compose -v
You should see output similar to:
# Docker Compose version v2.27.0
Note
The Docker Compose version may vary depending on the latest release.