How to Install and Use Docker Compose on Debian 13 (Trixie)
Docker Compose is a tool that lets you define and run multi-container Docker applications using a simple YAML file.
Prerequisites
- Docker must already be installed and running.
(If not, see how to install Docker on Debian 13)
Check Docker Compose Plugin Availability
Docker Compose v2 is installed as a plugin by default when you install Docker via Docker’s APT repository.
Check if it's already available:
docker compose version
If this shows a version (e.g., Docker Compose version v2.24.0), you're done!
(Alternative) Install Docker Compose Manually
If needed, install manually:
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-linux-x86_64 \
-o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
Verify:
docker compose version
Create a Docker Compose YAML File
Create a directory for your project:
mkdir myapp && cd myapp
Create a docker-compose.yml file:
nano docker-compose.yml
Example content for a simple Nginx container:
version: '3.8'
services:
web:
image: nginx:latest
ports:
- "80:80"
Start the Application
Start the containers in detached mode:
docker compose up -d
List running services:
docker compose ps
To see logs:
docker compose logs
Stop the services:
docker compose down
Autocomplete (Optional)
Enable bash completion:
curl -SL https://raw.githubusercontent.com/docker/compose/cli-plugin-main/contrib/completion/bash/docker-compose \
-o /etc/bash_completion.d/docker-compose
Then reload your shell or run:
source /etc/bash_completion.d/docker-compose
Conclusion
You now have Docker Compose installed and ready on Debian 13.
You can manage multi-container apps easily using a single YAML file.
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