DEV Community

Cover image for Installing Docker Compose
Megha Sharma
Megha Sharma

Posted on

Installing Docker Compose

Here are three common scenarios for installing Docker Compose:

Scenario one: Install Docker Desktop

The easiest and recommended way to get Docker Compose is to install Docker Desktop. Docker Desktop includes Docker Compose along with Docker Engine and Docker CLI which are Compose prerequisites.

Docker Desktop is available on:

  • Linux
  • Mac
  • Windows

If you have already installed Docker Desktop, you can check which version of Compose you have by selecting About Docker Desktop from the Docker menu.

Scenario two: Install the Compose plugin

If you already have Docker Engine and Docker CLI installed, you can install the Compose plugin from the command line, by either:

  • Using Docker’s repository
  • Downloading and installing manually

Scenario three: Install the Compose standalone

You can install the Compose standalone on Linux or on Windows Server.

πŸ‘‰ Install the Docker Compose plugin:

To install the Compose plugin on Linux, you can either:

  • Set up Docker’s repository on your Linux system.
  • Install Compose manually.

πŸ‘‰ Install using the repository:

  • Set up the repository. Find distro-specific instructions in:
    Ubuntu | CentOS | Debian | Raspberry Pi OS | Fedora | RHEL | SLES.

  • Update the package index, and install the latest version of Docker Compose:
    For Ubuntu and Debian, run:

$ sudo apt-get update
$ sudo apt-get install docker-compose-plugin
Enter fullscreen mode Exit fullscreen mode
  • For RPM-based distros, run:
$ sudo yum update
$ sudo yum install docker-compose-plugin
Enter fullscreen mode Exit fullscreen mode
  • Verify that Docker Compose is installed correctly by checking the version.
$ docker compose version
Enter fullscreen mode Exit fullscreen mode
  • Expected output:
Docker Compose version vN.N.N
Enter fullscreen mode Exit fullscreen mode

Where vN.N.N is placeholder text standing in for the latest version.

πŸ‘‰ Install the plugin manually:

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.26.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
Enter fullscreen mode Exit fullscreen mode

This command downloads the latest release of Docker Compose (from the Compose releases repository) and 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.
  • A different version of Compose, substitute v2.26.1 with the version of Compose you want to use.
  • For a different architecture, substitute x86_64 with the architecture you want.

Apply executable permissions to the binary:

$ chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
Enter fullscreen mode Exit fullscreen mode

or, if you chose to install Compose for all users:

$ sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
Enter fullscreen mode Exit fullscreen mode

Test the installation.

$ docker compose version


Docker Compose version v2.26.1
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ Install Compose standalone

On Linux:

To download and install Compose standalone, run:

$ curl -SL https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
Enter fullscreen mode Exit fullscreen mode

Apply executable permissions to the standalone binary in the target path for the installation.

Test and execute compose commands using docker-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.

GitHub now requires TLS1.2. In PowerShell, run the following:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12Run PowerShell as an administrator. When asked if you want to allow this app to make changes to your device, select Yes in order to proceed with the installation.
Enter fullscreen mode Exit fullscreen mode

Run the following command to download the latest release of Compose (v2.26.1):

 Start-BitsTransfer -Source "https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-windows-x86_64.exe" -Destination $Env:ProgramFiles\Docker\docker-compose.exe
Enter fullscreen mode Exit fullscreen mode

Test the installation.

docker-compose.exe version


Docker Compose version v2.26.1
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ Uninstall Docker Compose

Uninstalling Docker Compose depends on the method you have used to install Docker Compose.

  • Uninstalling the Docker Compose CLI plugin:

To remove the Compose CLI plugin, run:
Ubuntu, Debian:

$ sudo apt-get remove docker-compose-plugin
Enter fullscreen mode Exit fullscreen mode

RPM-based distros:

$ sudo yum remove docker-compose-plugin
Enter fullscreen mode Exit fullscreen mode
  • Manually installed:

If you used curl to install Compose CLI plugin, to uninstall it, run:

$ rm $DOCKER_CONFIG/cli-plugins/docker-compose
Enter fullscreen mode Exit fullscreen mode
  • Remove for all users:

Or, if you have installed Compose for all users, run:

$ rm /usr/local/lib/docker/cli-plugins/docker-compose
Enter fullscreen mode Exit fullscreen mode
  • Inspect the location of the Compose CLI plugin:

To check where Compose is installed, use:

$ docker info --format '{{range .ClientInfo.Plugins}}{{if eq .Name "compose"}}{{.Path}}{{end}}{{end}}'
Enter fullscreen mode Exit fullscreen mode

πŸ“ Liked this blog?
If you found this helpful, Buy me a coffee β˜•
πŸ’¬ Have questions or thoughts on Docker? Leave a comment below!
πŸ‘‰ Want more Docker content? Follow me on Dev
πŸ”— Explore More Docker Tutorials
Next Blog: Docker Compose overview
Medium Profile: Meghasharmaa

Top comments (0)