Install Docker Compose CLI plugin
Estimated reading time: 6 minutes
In this page you can find instructions on how to install Compose Plugin for Docker CLI in:
- Linux
 - Windows Server
 
Compose Prerequisites
- Docker Compose requires Docker Engine.
 - Docker Compose plugin requires Docker CLI.
 
Installing Compose on Linux systems
In this section you can find various routes for installing Compose in Linux.
Installation Methods
- Installing Docker Desktop for Linux is the easiest and recommended installation route. Check the Desktop for Linux supported platforms page to verify the supported Linux distributions and architectures.
 
The following other methods are possible:
- 
    
Using the automated convenience scripts (for testing and development environments). These scripts install Docker Engine and Docker CLI with the Compose plugin. For this route, go to the Docker Engine install page and follow the provided instructions. After Desktop for Linux this is the recommended route.
 - 
    
Setting up Docker’s repository and using it to install Docker CLI Compose plugin. See the Install using the repository section in this page. This is the second best route.
 - 
    
Installing the Docker CLI Compose plugin binary manually. See the Install the plugin manually section in this page. Note that this option requires you to manage upgrades manually as well.
 
Install using the repository
Note
These instructions assume you already have Docker Engine and Docker CLI installed and now want to install the Compose plugin. For other Linux installation methods see this summary.
To run Compose as a non-root user, see Manage Docker as a non-root user.
If you have already set up the Docker repository jump to step 2.
- 
    
Set up the repository. Go to the “Set up the repository” section of the chosen Linux distribution. found in the Docker Engine installation pages to check the instructions.
 - 
    
Update the
aptpackage index, and install the latest version of Docker Compose: 
Or, if using a different distro, use the equivalent package manager instructions.
```console
$ sudo apt-get update
$ sudo apt-get install docker-compose-plugin
```
Alternatively, to install a specific version of Compose CLI plugin:
  
a. List the versions available in your repo:
  ```console
  $ 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. From the list obtained use the version string you can in the second column to specify the version you wish to install. 
  
c. Install the selected version:
  ```console
  $ sudo apt-get install docker-compose-plugin=<VERSION_STRING>
  ```
where `<VERSION_STRING>` is, for example,`2.3.3~ubuntu-focal`.
- 
    
Verify that Docker Compose is installed correctly by checking the version.
$ docker compose version Docker Compose version v2.3.3 
Install the Plugin manually
Note
These instructions assume you already have Docker Engine and Docker CLI installed and now want to install the Compose plugin.
Note as well this option requires you to manage upgrades manually. Whenever possible we recommend any of the other installation methods listed. For other Linux installation methods see this summary.
To run Compose as a non-root user, see Manage Docker as a non-root user.
- 
    
To download and install the Compose CLI plugin, run:
$ 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-composeThis command downloads the latest release of Docker Compose (from the Compose releases repository) and installs Compose for the active user under
$HOMEdirectory.To install:
- Docker Compose for all users on your system, replace 
~/.docker/ cli-pluginswith/usr/local/lib/docker/cli-plugins. - A different version of Compose, substitute 
v2.5.0with the version of Compose you want to use. 
 - Docker Compose for all users on your system, replace 
 - 
    
Apply executable permissions to the binary:
$ chmod +x $DOCKER_CONFIG/cli-plugins/docker-composeor, if you chose 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 
Note
Compose standalone: If you need to use Compose without installing the Docker CLI, the instructions for the standalone scenario are similar. Note the target folder for the binary’s installation is different as well as the compose syntax used with the plugin (space compose) or the standalone version (dash compose).
- To download and install Compose standalone, run:
    
$ curl -SL https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose - Apply executable permissions to the standalone binary in the target path for the installation.
 - Test and execute compose commands using 
docker-compose. 
Note
If the command
docker-composefails after installation, check your path. You can also create a symbolic link to/usr/binor any other directory in your path. For example:$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Install Compose on Windows Server
Follow these instructions if you are running the Docker daemon and client directly on Microsoft Windows Server and want to install Docker Compose.
- 
    
Run a PowerShell as an administrator. When asked if you want to allow this app to make changes to your device, click Yes in order to proceed with the installation.
 - 
    
GitHub now requires TLS1.2. In PowerShell, run the following:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - 
    
Run the following command to download the latest 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.exeNote
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 --versioncommand on the subsequent step with no additional configuration.To install a different version of Compose, substitute
v2.5.0with the version of Compose you want to use. - 
    
Test the installation.
$ docker compose version Docker Compose version v2.5.0