3.9 KiB
| description | keywords | toc_max | title | linkTitle | aliases | weight | |||
|---|---|---|---|---|---|---|---|---|---|
| Step-by-step instructions for installing the Docker Compose plugin on Linux using a package repository or manual method. | install docker compose linux, docker compose plugin, docker-compose-plugin linux, docker compose v2, docker compose manual install, linux docker compose | 3 | Install the Docker Compose plugin | Plugin |
|
10 |
This page contains instructions on how to install the Docker Compose plugin on Linux from the command line.
To install the Docker Compose plugin on Linux, you can either:
[!NOTE]
These instructions assume you already have Docker Engine and Docker CLI installed and now want to install the Docker Compose plugin.
Install using the repository
-
Set up the repository. Find distribution-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 -
For RPM-based distributions, run:
$ sudo yum update $ sudo yum install docker-compose-plugin
-
-
Verify that Docker Compose is installed correctly by checking the version.
$ docker compose version
Update Docker Compose
To update the Docker Compose plugin, run the following commands:
-
For Ubuntu and Debian, run:
$ sudo apt-get update $ sudo apt-get install docker-compose-plugin -
For RPM-based distributions, run:
$ sudo yum update $ sudo yum install docker-compose-plugin
Install the plugin manually
[!WARNING]
Manual installations don’t auto-update. For ease of maintenance, use the Docker repository method.
-
To download and install the Docker 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/{{% param "compose_version" %}}/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-composeThis command downloads and installs the latest release of Docker 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
{{% param "compose_version" %}}with the version of Compose you want to use. - For a different architecture, substitute
x86_64with the architecture you want.
- 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