Installing Docker Compose
Learn how to install Docker Compose: Set up this essential tool to define and manage multi-container Docker applications with ease.
Published Dec 8, 2024
Here are two common scenarios for installing Docker Compose:
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.
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
You can install the Compose standalone on Linux or on Windows Server.
To install the Compose plugin on Linux, you can either:
- Set up Dockerโs repository on your Linux system.
- Install Compose manually.
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:
- For RPM-based distros, run:
- Verify that Docker Compose is installed correctly by checking the version.
Expected output:
Where
vN.N.N
is placeholder text standing in for the latest version.To download and install the Compose CLI plugin, run:
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:
or, if you chose to install Compose for all users:
Test the installation:
On Linux:
To download and install Compose standalone, run:
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:
Run the following command to download the latest release of Compose (v2.26.1):
Test the installation:
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:
RPM-based distros:
- Manually installed:
If you used
curl
to install Compose CLI plugin, to uninstall it, run:- Remove for all users:
Or, if you have installed Compose for all users, run:
- Inspect the location of the Compose CLI plugin:
To check where Compose is installed, use:
ย