Docker Compose Installation on Ubuntu
Here is a guide to install Docker on Ubuntu.
Install docker-compose and its dependencies
Install docker
First, make sure docker is installed on your system by running the following command:
docker -v
You should see output similar to:
# Docker version 25.0.3, build 4debf41
If Docker is not installed, refer to the following instructions here.
Install docker-compose
Note: check the last available version on GitHub
If you want to install a specific version, you can set the VERSION variable to the desired version.
If you want to install the latest version, you can run the following command:
LATEST_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
Then, you can run the following command to install docker-compose:
sudo curl -L "https://github.com/docker/compose/releases/download/$LATEST_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Verify the installation
To verify that docker-compose is installed correctly, run the following command:
docker-compose -v
You should see output similar to:
# Docker Compose version v2.27.0
Note
The docker-compose version may vary depending on the latest release.