Skip to content

Install Docker Compose in CentOS 7

In this post, you will learn how to install Docker Compose in CentOS 7 and other CentOS versions. Docker Compose helps to define and run multi-container Docker applications.

Download the latest Docker Compose binary to your host

[anand@dev ~]$ sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   638  100   638    0     0   3585      0 --:--:-- --:--:-- --:--:--  3584
100 16.7M  100 16.7M    0     0  42.4M      0 --:--:-- --:--:-- --:--:-- 42.4M

You can replace 1.25.5 with the latest version of the Docker Compose from this page.

Make the binary executable

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

Check Docker Compose version

[anand@dev ~]$ docker-compose --version
docker-compose version 1.25.5, build 8a1c60f6

Create a PATH to your local/bin

Do this only if you see the error -bash: docker-compose: command not found in the previous step. This command puts Docker Compose in the PATH

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Fin.

See also  List all networks in a docker setup

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.