What is Docker Compose?
Docker Compose is a tool that lets you define and execute multi-container Docker applications. With Docker Compose you will use YAML files to configure application’s services and, once they are defined, with only one command we can create and execute all the services as described in configuration.
In order to carry out the actions described in this article we will need to have:
- A server running the system Ubuntu 20.04.
- Docker installed following the steps described in How to install Docker in Ubuntu 20.04.
Installing Docker Compose
We will use the Docker Composer’s official repository to ensure we install the latest version.
Important: Before installing, we should check what is the latest version available in Docker Composer’s releases web and we should modify VERSION variable value in the next commands:
VERSION=1.27.0 sudo curl -L "https://github.com/docker/compose/releases/download/$VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
At last we will check that Docker Compose was installed correctly and that it is working in our system: