Technology Sharing

Install Docker Compose on Linux

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

Docker Compose is a tool for defining, running, and managing multi-container Docker applications. It configures services through YAML files and enables one-click starting and stopping of all services.

Here are the steps on how to install Docker Compose on Linux systems

1. Download the Docker Compose executable

wget https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 

This command downloads the version of Docker Compose from the GitHub release page. v2.16.0 The Docker Compose executable forx86_64 Architecture of Linux system.

Note: Because it is a gitup address, the download speed may be very slow or even fail to download. You can choose to download it locally and then upload it to the server, or you can use the one I downloaded.

Extraction code: Andy(Depending on the system architecture, there are x86 and ARM)

2. Move and rename the file

mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose 

Move the downloaded Docker Compose executable to /usr/local/bin Directory and renameddocker-compose, which makes it more convenient to call it from the command line.

3. Grant execution permissions

chmod +x /usr/local/bin/docker-compose 

4. Verify the installation

docker-compose --version 

As shown in the figure: