How to Install Docker Compose on AlmaLinux 10

Published: 2026-06-28
Google AdSense 广告位 (待申请通过后开启)

Docker Compose is a tool used to define and run multi-container Docker applications. Instead of running multiple `docker run` commands manually, you can define services, networks, and volumes in a single YAML file and start everything with one command.

This guide explains how to install Docker Compose on AlmaLinux 10, verify the installation, and run a simple example project.

---

Prerequisites

Before installing Docker Compose, make sure:

* Docker is already installed

* You have sudo privileges

* The system is updated

Check Docker installation:

docker -v

Check Docker service status:

systemctl status docker

If Docker is not installed, install it first:

* How to Install Docker on AlmaLinux 10

---

Method 1: Install Docker Compose Plugin (Recommended)

Modern Docker versions include Docker Compose as a plugin.

Install it using DNF:

sudo dnf install docker-compose-plugin -y

Verify installation:

docker compose version

> Note: The correct command is `docker compose` (with a space), not `docker-compose`.

---

Method 2: Install Standalone Docker Compose (Legacy)

If you need the old standalone version:

Download the binary:

sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose

Apply executable permission:

sudo chmod +x /usr/local/bin/docker-compose

Verify installation:

docker-compose --version

---

Step 3. Create a Simple Docker Compose Project

Create a project directory:

mkdir docker-compose-demo
cd docker-compose-demo

Create a `docker-compose.yml` file:

version: "3.9"

services:
  web:
    image: nginx:latest
    ports:
      - "8080:80"

---

Step 4. Start the Service

Run the container:

docker compose up -d

Check running containers:

docker ps

Now open your browser:

http://localhost:8080

You should see the Nginx welcome page.

---

Step 5. Stop the Service

To stop containers:

docker compose down

---

Common Issues

### docker: command not found

Docker is not installed or not running.

Check service:

systemctl start docker
systemctl enable docker

---

### docker compose command not found

You may be using an older Docker version.

Install the Compose plugin:

sudo dnf install docker-compose-plugin -y

---

### Permission denied

Run Docker without sudo by adding user to docker group:

sudo usermod -aG docker $USER
newgrp docker

---

Docker Compose vs Docker Run

| Feature             | docker run   | docker compose |
| ------------------- | ------------ | -------------- |
| Multiple containers | Hard         | Easy           |
| Configuration       | Command line | YAML file      |
| Reusability         | Low          | High           |
| Production use      | Limited      | Recommended    |

---

Related Articles

* How to Install Docker on AlmaLinux 10

* How to Install Node.js on AlmaLinux 10

* How to Install Nginx on AlmaLinux 10

* How to Install Redis on AlmaLinux 10

* How to Install PostgreSQL on AlmaLinux 10

---

Conclusion

Docker Compose simplifies managing multi-container applications on AlmaLinux 10. It is essential for modern development workflows, especially when working with microservices, Node.js applications, databases, and reverse proxies.

Once installed, you can quickly deploy full-stack environments using simple YAML configuration files.

Explore More

Technology Guides →

How to Install Docker on AlmaLinux 10

Southeast Asia Insights →