This page contains information on how to install Docker Compose. You can run Compose on macOS, Windows, and 64-bit Linux.
Docker Compose relies on Docker Engine for any meaningful work, so make sure you have Docker Engine installed either locally or remote, depending on your setup.
On desktop systems like Docker Desktop for Mac and Windows, Docker Compose is included as part of those desktop installs.
On Linux systems, you can install Docker Compose with the Docker Engine using the convenience script. Select the install Docker Engine page for your distribution and then look for instructions on installing using the convenience script.
Otherwise, you should first install the Docker Engine for your OS and then refer to this page for instructions on installing Compose on Linux systems.
To run Compose as a non-root user, see Manage Docker as a non-root user.
Follow the instructions below to install Compose on Mac, Windows, Windows Server, or Linux systems.
Install a different version
The instructions below outline installation of the current stable release (v2.5.0) of Compose. To install a different version of Compose, replace the given release number with the one that you want.
Compose releases are also listed and available for direct download on the Compose repository release page on GitHub.
To install the Python version of Compose, follow instructions in the Compose v1 GitHub branch.
Docker Desktop for Mac includes Compose along with other Docker apps, so Mac users do not need to install Compose separately. For installation instructions, see Install Docker Desktop on Mac.
Docker Desktop for Windows includes Compose along with other Docker apps, so most Windows users do not need to install Compose separately. For install instructions, see Install Docker Desktop on Windows.
If you are running the Docker daemon and client directly on Microsoft Windows Server, follow the instructions in the Windows Server tab.
Follow these instructions if you are running the Docker daemon and client directly on Microsoft Windows Server and want to install Docker Compose.
Start an “elevated” PowerShell (run it as administrator). Search for PowerShell, right-click, and choose Run as administrator. When asked if you want to allow this app to make changes to your device, click Yes.
In PowerShell, since GitHub now requires TLS1.2, run the following:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Then run the following command to download the current stable release of Compose (v2.5.0):
Invoke-WebRequest "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-Windows-x86_64.exe" -UseBasicParsing -OutFile $Env:ProgramFiles\Docker\docker-compose.exe
Note
On Windows Server 2019, you can add the Compose executable to
$Env:ProgramFiles\Docker
. Because this directory is registered in the systemPATH
, you can run thedocker-compose --version
command on the subsequent step with no additional configuration.
To install a different version of Compose, substitute
v2.5.0
with the version of Compose you want to use.
Test the installation.
$ docker compose version
Docker Compose version v2.5.0
You can install Docker Compose in different ways, depending on your needs:
As Docker Compose is now part of the Docker CLI it can be installed via a convenience script with Docker Engine and the CLI.
Choose your Linux distribution and follow the instructions.
If you already follow the instructions to install Docker Engine, Docker Compose should already be installed.
Otherwise, you can set up the Docker repository as mentioned in the Docker Engine installation, choose your Linux distribution and go to the Set up the repository
section.
When finished
Update the apt
package index, and install the latest version of Docker Compose, or go to the next step to install a specific version:
$ sudo apt-get update
$ sudo apt-get install docker-compose-plugin
To install a specific version of Docker Engine, list the available versions in the repo, then select and install:
a. List the versions available in your repo:
$ apt-cache madison docker-compose-plugin
docker-compose-plugin | 2.3.3~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable arm64 Packages
b. Install a specific version using the version string from the second column, for example, 2.3.3~ubuntu-focal
.
$ sudo apt-get install docker-compose-plugin=<VERSION_STRING>
Verify that Docker Compose is installed correctly by checking the version.
$ docker compose version
Docker Compose version v2.3.3
On Linux, you can download the Docker Compose binary from the Compose repository release page on GitHub and copying it into $HOME/.docker/cli-plugins
as docker-compose
. Follow the instructions from the link, which involve running the curl
command in your terminal to download the binaries. These step-by-step instructions are also included below.
Run this command to download the current stable release of Docker Compose:
$ DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
$ mkdir -p $DOCKER_CONFIG/cli-plugins
$ curl -SL https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
This command installs Compose for the active user under $HOME
directory. To install Docker Compose for all users on your system, replace ~/.docker/cli-plugins
with /usr/local/lib/docker/cli-plugins
.
To install a different version of Compose, substitute
v2.5.0
with the version of Compose you want to use.
Apply executable permissions to the binary:
$ chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
or if you choose to install Compose for all users
$ sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
Test the installation.
$ docker compose version
Docker Compose version v2.5.0
You can use Compose as a standalone binary without installing the Docker CLI.
$ curl -SL https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
To install a different version of Compose, substitute
v2.5.0
with the version of Compose you want to use.
$ sudo chmod +x /usr/local/bin/docker-compose
Note:
If the command
docker-compose
fails after installation, check your path. You can also create a symbolic link to/usr/bin
or any other directory in your path.For example:
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Test the installation.
$ docker-compose --version
Docker Compose version v2.5.0
To uninstall Docker Compose if you installed using curl
:
$ rm $DOCKER_CONFIG/cli-plugins/docker-compose
or if you choose to install Compose for all users
$ sudo rm /usr/local/lib/docker/cli-plugins/docker-compose
Got a “Permission denied” error?
If you get a “Permission denied” error using either of the above methods, you probably do not have the proper permissions to remove
docker-compose
. To force the removal, prependsudo
to either of the above commands and run again.
compose, orchestration, install, installation, docker, documentation
© 2019 Docker, Inc.
Licensed under the Apache License, Version 2.0.
Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.
Docker, Inc. and other parties may also have trademark rights in other terms used herein.
https://docs.docker.com/compose/install/