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 daemon
  • docker CLI – Used to manage containers, images, networks, and volumes
  • containerd – A high-performance container runtime used internally
  • runc – A low-level runtime for executing container processes

Supported Kernel Features on Rocky Linux 9:

FeatureFunction
Cgroups v2Fine-grained resource isolation (CPU, memory, I/O)
OverlayFSLayered filesystem support for efficient images
NamespacesIsolate processes, users, mounts, and networks
SeccompRestricts container syscalls for security
SELinuxControls container access to host resources
SystemdManages 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:

ComponentRole in Container Security
SELinux (enforcing)Restricts file and process access inside containers
AuditdLogs system events including Docker activities
FirewalldManages network access and port forwarding
SystemdIsolates Docker processes with system slices and units
Rootless DockerAvailable 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

FeatureRocky Linux 9Ubuntu 24.04Debian 12
Kernel version5.14 (RHEL-based)6.8 (cutting-edge)6.1 (stable LTS)
Security frameworkSELinux (Enforcing)AppArmorAppArmor
Support model10-year lifecycle5+ years~5 years
Docker integrationCommunity maintainedOfficial Docker supportCommunity maintained
System complexityMediumMediumLow

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.

Shape.host Resources dashboard with Create > Instance highlighted.

Select your preferred data center location.

Shape.host instance form with the data center location selector highlighted.

Choose Rocky Linux 9 (64-bit) as your OS.

Pick a plan with at least 2 CPUs, 2 GB RAM, and 20 GB SSD.

Shape.host instance form with the operating system image selector highlighted.

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

Shape.host instance form with the Create Instance button highlighted.

Note the IP address from the Resources section.

Shape.host Resources dashboard with the server IP address highlighted.

Connect to Your Instance

On Linux/macOS:

ssh root@your_server_ip

On Windows (with PuTTY):

  1. Download PuTTY.
  2. Launch PuTTY and enter the server’s IP into the Host Name field.
  3. Use Port 22 and Connection type SSH.
  4. 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
Terminal showing DNF/YUM package management commands and output.

2. Install necessary dependencies:

dnf install curl gnupg lsb-release ca-certificates yum-utils
Terminal showing DNF/YUM package management commands and output.

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
Terminal showing yum commands or output during Add Dockers official repository:.

4. Install Docker Compose plugin:

dnf install docker-compose-plugin
Terminal showing DNF/YUM package management commands and output.

5. Install Docker Engine and related components:

dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Terminal showing DNF/YUM package management commands and output.

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
Terminal showing systemd service management commands or output.

9. Verify Docker Compose v2 installation:

docker compose version
Terminal showing the installed 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
Terminal showing file and directory setup commands.

Paste the following contents:

services:
  hello:
    image: hello-world

Save and exit (CTRL+O, ENTER, then CTRL+X).

Terminal showing the GNU nano editor and configuration text.

3. Run the container:

docker compose up

You should see output from the hello-world image, confirming everything is working.

Terminal showing container image download progress.

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.