This article is written for those who were searching for a detailed and simple for the understanding guide on how to install Docker Compose on Ubuntu Server.
Docker Compose is a tool for managing the containers that make up a distributed application. Moreover, you can manage not only containers but also connected folders, networks, and other settings.
In this guide, we will consider the case when you already have a server with the Ubuntu Server 18.04 LTS operating system installed on it.
You can read more about how to install Ubuntu Server 18.04 LTS in my guide «Installing Ubuntu Server 18.04 LTS».
Also on the server must be installed Docker Engine – Community.
You can learn how to install Docker Engine – Community on Ubuntu Server by reading «Installing Docker Engine – Community on Ubuntu Server».
In addition, OpenSSH must be installed on the server, and port 22 must be open in order to be able to connect to the server using the SSH protocol.
To install OpenSSH on the server, you can use the command:
sudo apt-get install openssh-server
If you plan to connect to the server using the Windows operating system, you can use PuTTY, a freeware client for various remote access protocols, including SSH, Telnet, rlogin.
This guide covers connecting to a server using the iTerm2 terminal emulator installed on the macOS operating system.
Connect to the server on which it is planned to install Docker Compose.
Download the current stable version of Docker Compose with the command:
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Allow the execution of the binary file using the command:
sudo chmod +x /usr/local/bin/docker-compose
Now you need to make sure that Docker Compose is installed correctly. To do this, run the command:
Judging by the message received, Docker Compose is installed correctly.