Docker Engine & Docker Compose v2 on Rocky Linux 9 – Enterprise-Grade Containerization on a Stable RHEL-Compatible Platform
Docker Engine and Docker Compose v2 provide a robust, developer-friendly, and production-ready platform for containerized applications. Paired with Rocky Linux 9, a RHEL-compatible Linux distribution, this combination ensures long-term support, system stability, and enterprise compatibility for modern container workflows.
Why Use Rocky Linux 9 for Docker?
Rocky Linux 9 is a binary-compatible clone of Red Hat Enterprise Linux 9, designed as a drop-in replacement for CentOS. It’s an ideal base for containerized workloads due to:
- Predictable release cadence and extended support
- Native SELinux enforcement for enhanced security
- Compatibility with OCI container runtimes and orchestration tools
- High stability and minimal system changes between updates
Docker can be seamlessly integrated with Rocky Linux 9 to support everything from development to large-scale production deployments.
Docker Engine on Rocky Linux 9
Docker Engine is the core technology used to build and manage containers. On Rocky Linux 9, it includes:
dockerd
– The long-running Docker daemondocker
CLI – Used to manage containers, images, networks, and volumescontainerd
– A high-performance container runtime used internallyrunc
– A low-level runtime for executing container processes
Supported Kernel Features on Rocky Linux 9:
Feature | Function |
---|---|
Cgroups v2 | Fine-grained resource isolation (CPU, memory, I/O) |
OverlayFS | Layered filesystem support for efficient images |
Namespaces | Isolate processes, users, mounts, and networks |
Seccomp | Restricts container syscalls for security |
SELinux | Controls container access to host resources |
Systemd | Manages Docker as a native system service |
Docker on Rocky Linux 9 benefits from enterprise-grade kernel stability and full integration with security subsystems.
Docker Compose v2 on Rocky Linux 9
Docker Compose v2 is written in Go and packaged as a Docker CLI plugin, replacing the older Python-based Compose v1.
Use it via:
docker compose up
rather than the legacy docker-compose
command.
Features of Compose v2 on Rocky Linux 9:
- Integrated into Docker CLI for a unified interface
- YAML-based service definitions (
docker-compose.yml
) - Supports container networks, volumes, environment files, and health checks
- Works with Docker Swarm for multi-node deployment
- Offers enhanced performance and error handling over Compose v1
Compose v2 is ideal for both local development environments and automated CI/CD pipelines.
Security Features
Rocky Linux 9 emphasizes secure defaults, and Docker leverages these features effectively:
Component | Role in Container Security |
---|---|
SELinux (enforcing) | Restricts file and process access inside containers |
Auditd | Logs system events including Docker activities |
Firewalld | Manages network access and port forwarding |
Systemd | Isolates Docker processes with system slices and units |
Rootless Docker | Available for non-privileged container execution |
Organizations that follow NIST, FIPS, or CIS benchmarks can integrate Docker with Rocky Linux’s compliance tools and security profiles.
Use Cases for Docker + Compose on Rocky Linux 9
- Application development: Quickly prototype and iterate on container-based services
- Microservices: Build distributed service stacks with shared networks and persistent volumes
- Self-hosted platforms: Deploy apps like GitLab, Portainer, Nextcloud, and Matomo
- CI/CD automation: Use containers to test, build, and deploy across GitLab, Jenkins, and GitHub Actions
- Production clusters: Run stable workloads in Docker Swarm or integrate with Kubernetes
- Legacy modernization: Package traditional apps into containers using Compose
The long-term support and consistent behavior of Rocky Linux 9 make it an excellent base for long-lived container services.
Rocky Linux 9 as a Base Image
The official rockylinux:9
container image is:
- Minimal by design for small footprint
- Compatible with
dnf
and RPM-based toolchains - SELinux-aware for security-focused builds
- Trusted and maintained by the Rocky Enterprise Software Foundation
This makes it ideal for organizations looking to maintain consistency across host and container layers.
Comparison to Other Host OSes
Feature | Rocky Linux 9 | Ubuntu 24.04 | Debian 12 |
---|---|---|---|
Kernel version | 5.14 (RHEL-based) | 6.8 (cutting-edge) | 6.1 (stable LTS) |
Security framework | SELinux (Enforcing) | AppArmor | AppArmor |
Support model | 10-year lifecycle | 5+ years | ~5 years |
Docker integration | Community maintained | Official Docker support | Community maintained |
System complexity | Medium | Medium | Low |
Rocky Linux is ideal for teams that need RHEL compatibility and security hardening, especially in regulated industries or hybrid cloud environments.
Docker Engine and Docker Compose v2 on Rocky Linux 9 offer a powerful, enterprise-ready container stack built on top of a stable, security-hardened operating system. Whether you’re managing developer environments, hosting production services, or deploying across a hybrid infrastructure, this combination provides long-term support, consistent behavior, and seamless integration with modern DevOps pipelines.
For organizations seeking a CentOS replacement with full Docker support and upstream compatibility, Rocky Linux 9 is a reliable and scalable platform.
Step 1: Set Up a Server Instance on Shape.Host
Before installing Docker, you’ll need a Rocky Linux 9 VPS. Shape.Host offers fast, secure, and scalable cloud infrastructure that is ideal for running containerized applications.
To create your VPS:
Go to https://shape.host and log in.
Click “Create” in the dashboard.
Choose “Instance” as the resource type.

Select your preferred data center location.

Choose Rocky Linux 9 (64-bit) as your OS.
Pick a plan with at least 2 CPUs, 2 GB RAM, and 20 GB SSD.

Click “Create Instance” and wait for it to be provisioned.

Note the IP address from the Resources section.

Connect to Your Instance
On Linux/macOS:
ssh root@your_server_ip
On Windows (with PuTTY):
- Download PuTTY.
- Launch PuTTY and enter the server’s IP into the Host Name field.
- Use Port
22
and Connection typeSSH
. - Click Open and log in as
root
.
Step 2: Install Docker Engine & Docker Compose v2
Follow these step-by-step commands, each matching the terminal history exactly:
1. Update system packages:
dnf update

2. Install necessary dependencies:
dnf install curl gnupg lsb-release ca-certificates yum-utils

3. Add Docker’s official repository:
tee /etc/yum.repos.d/docker-ce.repo > /dev/null <<EOF
[docker-ce-stable]
name=Docker CE Stable - \$basearch
baseurl=https://download.docker.com/linux/centos/9/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
EOF

4. Install Docker Compose plugin:
dnf install docker-compose-plugin

5. Install Docker Engine and related components:
dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

6. Start the Docker service:
systemctl start docker
7. Enable Docker to start on boot:
systemctl enable docker
8. Confirm Docker is running:
systemctl status docker

9. Verify Docker Compose v2 installation:
docker compose version

Step 3: Run a Test Using Docker Compose
Let’s test your setup using a simple Docker Compose configuration.
1. Create a directory and move into it:
mkdir ~/compose-test && cd ~/compose-test
2. Create a docker-compose.yml
file:
nano docker-compose.yml

Paste the following contents:
services:
hello:
image: hello-world
Save and exit (CTRL+O
, ENTER
, then CTRL+X
).

3. Run the container:
docker compose up
You should see output from the hello-world
image, confirming everything is working.

You’ve now installed Docker Engine and Docker Compose v2 on Rocky Linux 9, and verified the installation by running a container. This setup is ideal for running microservices, CI/CD pipelines, and cloud-native applications.
For performance-optimized cloud hosting, deploy your containers on Shape.Host Linux SSD VPS—fast, flexible, and developer-friendly.
Start now at https://shape.host.