Docker is an open source container platform that packages applications and their dependencies into lightweight, portable containers. It runs on Linux, macOS, and Windows, and has become the standard tool for building, shipping, and running containerized workloads in development and production.
This guide covers installing Docker Engine (CE) 29.x on Rocky Linux 10 and AlmaLinux 10 from the official Docker repository, along with Docker Compose plugin setup and basic container operations. For the full installation reference, see the Docker Engine installation docs for RHEL.
Prerequisites
- A server or VM running Rocky Linux 10 or AlmaLinux 10
- Root or sudo access
- Internet connectivity for package downloads
Step 1: Update System Packages
Start by updating your system packages to the latest available versions.
sudo dnf -y update
Reboot if kernel packages were updated.
sudo reboot
Step 2: Add Docker CE Repository
Docker packages are not included in the default Rocky Linux or AlmaLinux repositories. Add the official Docker CE repo using dnf config-manager.
Install the dnf-plugins-core package which provides the config-manager plugin.
sudo dnf install -y dnf-plugins-core
Add the Docker CE stable repository.
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
Verify the repository is available.
sudo dnf repolist
You should see docker-ce-stable listed among the enabled repositories.
Step 3: Install Docker Engine on Rocky Linux 10 / AlmaLinux 10
Install Docker Engine, the CLI tools, containerd runtime, and the Compose plugin in one command.
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
This installs Docker Engine 29.x, containerd, Docker Buildx for multi-platform builds, and Docker Compose as a CLI plugin (accessed via docker compose instead of the older standalone docker-compose binary).
Step 4: Start and Enable Docker Service
Enable Docker to start on boot and start the service immediately.
sudo systemctl enable --now docker
Verify the service is running.
systemctl status docker
The service should show active (running) with the enabled preset:
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: disabled)
Active: active (running)
Check the installed Docker version.
docker --version
You should see Docker Engine 29.x confirmed:
Docker version 29.3.0, build 7d4bcd8
Verify the Docker Compose plugin version as well.
docker compose version
Compose v5.x should be installed alongside the engine:
Docker Compose version v5.1.1
Step 5: Run Docker as a Non-Root User
By default, Docker commands require root privileges. Add your user to the docker group to run containers without sudo.
sudo usermod -aG docker $USER
newgrp docker
Verify by running a command without sudo.
docker info --format '{{.ServerVersion}}'
Step 6: Configure Firewall for Docker
Docker manages its own iptables rules for container networking. If you run firewalld and need to expose container ports to external networks, allow the specific ports your containers use.
For example, to allow a container running on port 8080:
sudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --reload
For containers that communicate between hosts (Swarm, overlay networks), also open ports 2377/tcp (cluster management), 7946/tcp+udp (node communication), and 4789/udp (overlay network).
Step 7: Test Docker Installation
Pull and run the hello-world image to confirm everything works.
docker run hello-world
If Docker is working correctly, you will see a confirmation message from the container:
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
Run an interactive Alpine container to test pulling and running a real image.
docker run -it alpine sh
This drops you into a shell inside the Alpine container. Run a quick check and exit:
/ # cat /etc/os-release
NAME="Alpine Linux"
/ # exit
Step 8: Docker Compose Quick Test
Create a simple Compose file to verify the plugin works. This runs an Nginx container on port 8080.
mkdir -p ~/docker-test && cd ~/docker-test
Create the Compose file.
vi ~/docker-test/compose.yaml
Add the following content:
services:
web:
image: nginx:alpine
ports:
- "8080:80"
Start the service in detached mode.
cd ~/docker-test
docker compose up -d
Verify the container is running and Nginx responds.
docker compose ps
The container should show as running with port 8080 mapped:
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
docker-test-web-1 nginx:alpine "/docker-entrypoint.…" web 5 seconds ago Up 4 seconds 0.0.0.0:8080->80/tcp
Confirm Nginx is responding on port 8080.
curl -s http://localhost:8080 | head -3
You should see the default Nginx welcome page HTML:
<!DOCTYPE html>
<html>
<head>
Clean up the test.
docker compose down
cd ~ && rm -rf ~/docker-test
Useful Docker Commands Reference
| Command | Description |
|---|---|
docker ps | List running containers |
docker ps -a | List all containers including stopped |
docker images | List downloaded images |
docker pull image:tag | Download an image from Docker Hub |
docker stop container_id | Stop a running container |
docker rm container_id | Remove a stopped container |
docker rmi image_id | Remove an image |
docker logs container_id | View container logs |
docker exec -it container_id sh | Open shell inside a running container |
docker system prune -a | Remove all unused containers, images, and networks |
Conclusion
Docker Engine and Compose are installed and running on Rocky Linux 10 / AlmaLinux 10. From here, you can build container images, deploy multi-container applications with Compose, or set up a Kubernetes cluster for orchestration at scale. For production, configure log rotation for container logs, set resource limits on containers, and use Portainer for web-based container management.