How to Install and use Docker Compose on Ubuntu 24.10
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a Compose file to configure your application's services. Then, using a single command, you create and start all the services from your configuration.
Update Your System
First, make sure your package list is up to date,
apt update -y
apt upgrade -y
Install Docker
If Docker is not already installed on your system, you can install it using the following commands,
apt install docker.io
Output:
root@server:~# apt install docker.io
Installing:
docker.io
Installing dependencies:
bridge-utils containerd dns-root-data dnsmasq-base pigz runc ubuntu-fan
Suggested packages:
ifupdown aufs-tools cgroupfs-mount | cgroup-lite debootstrap docker-buildx docker-compose-v2 docker-doc rinse zfs-fuse | zfsutils
Summary:
Upgrading: 0, Installing: 8, Removing: 0, Not Upgrading: 0
Download size: 71.8 MB
Space needed: 272 MB / 44.9 GB available
Continue? [Y/n]
Install Docker Compose
To install Docker Compose, you can use the below commands. You may need to download the latest version of Docker Compose from the official GitHub repository,
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
Output:
root@server:~# curl -L "https://github.com/docker/compose/releases/latest/download/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
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 61.0M 100 61.0M 0 0 33.2M 0 0:00:01 0:00:01 --:--:-- 52.4M
The above command will download and install the latest version of Docker Compose.
Verify Docker Compose Version
Check if Docker Compose was installed successfully by running,
docker-compose --version
Output:
root@server:~# docker-compose --version
Docker Compose version v2.30.1
Done.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS