Want to install Docker on Rocky Linux 10 fast and hassle-free? Discover this step-by-step guide that grabs your attention, walks you through every command, and gets Docker running in minutes. Don’t miss out—master containerization today before you fall behind! #centlinux #linux #docker
Table of Contents
Introduction
What is Docker?
Imagine being able to package up your application with everything it needs to run—libraries, dependencies, configurations—into a neat, lightweight unit. That’s what Docker does. Docker is a containerization platform that allows developers and system administrators to build, ship, and run applications inside isolated environments called containers. These containers run on any system that supports Docker, regardless of the underlying infrastructure. This means you can develop on your laptop, test on a staging server, and deploy to production seamlessly, without the “it works on my machine” headache.
Docker containers are incredibly fast and resource-efficient compared to traditional virtual machines. They don’t require a full-blown OS per instance; instead, they share the host system’s kernel. That’s why you can spin up and tear down Docker containers in seconds, not minutes. Plus, Docker offers a robust ecosystem with Docker Hub (a central registry for images), Docker Compose for multi-container setups, and Docker Swarm or Kubernetes for orchestration.

Why install Docker on Rocky Linux 10?
Rocky Linux 10 is a powerful, community-driven enterprise OS designed to be a drop-in replacement for CentOS, especially after CentOS moved away from its traditional release model. If you’re looking for stability and long-term support but still want to leverage cutting-edge DevOps tools like Docker, Rocky Linux 10 is an ideal choice.
Here’s why Docker on Rocky Linux 10 makes sense:
- Enterprise Grade Stability: Rocky Linux is binary-compatible with RHEL, which makes it extremely stable for production workloads.
- Lightweight and Secure: Rocky Linux’s minimal installation footprint makes it a perfect base for Docker setups.
- Compatible and Flexible: Although Rocky Linux defaults to Podman (a Docker alternative), Docker can still be installed and used reliably with full support.
- Perfect for CI/CD and Microservices: Whether you’re running a CI/CD pipeline or deploying a microservices architecture, Docker on Rocky Linux offers the speed and flexibility needed for modern DevOps practices.
By the end of this guide, you’ll have Docker up and running smoothly on your Rocky Linux 10 system, ready to power your containers.
Preparing Your Rocky Linux 10 System
System Requirements for Docker
Before diving into the installation, it’s crucial to ensure your system meets Docker’s minimum requirements. While Docker is lightweight, it still needs some baseline system resources to function properly. Here’s what you should verify:
- Operating System: Rocky Linux 10 (64-bit only)
- Kernel Version: 3.10 or later (Rocky Linux 10 uses a compatible version)
- Architecture: x86_64 (also known as amd64)
- Minimum RAM: 2 GB (4 GB recommended)
- Disk Space: At least 10 GB of available space
- Internet Access: Required to fetch packages and Docker images
You can verify your system info with the following commands:
uname -r # Check kernel version
arch # Confirm architecture
cat /etc/os-release # Check Rocky Linux version
Having sufficient system resources ensures Docker runs smoothly without hitting bottlenecks when spinning up multiple containers.
Recommended Training: Docker Mastery: with Kubernetes +Swarm from a Docker Captain

Updating the System Packages
It’s always a smart idea to begin by updating your system packages. This makes sure you’re working with the latest software libraries and security patches. Run the following commands to update your Rocky Linux 10 machine:
sudo dnf update -y
sudo dnf upgrade -y
This step will update your entire system, including the kernel, core utilities, and any installed software. Once the upgrade is complete, it’s recommended to reboot your system if any kernel-related packages were updated:
sudo reboot
After rebooting, verify the system is up-to-date:
dnf check-update
A clean and updated system reduces the chances of running into compatibility issues when installing Docker or any other critical software.
Read Also: How to Upgrade Rocky Linux 9 to 10
Setting Up the Required Repositories
Docker is not available in the default Rocky Linux 10 repositories, so we’ll need to add Docker’s official repository to our system. First, we need to ensure dnf-plugins-core
is installed. This package provides tools for managing DNF repositories and package versions.
sudo dnf install -y dnf-plugins-core
Next, add Docker’s official repository:
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Yes, you read that right—despite using Rocky Linux, we’re pointing to the CentOS repository. Why? Because Rocky Linux is binary-compatible with RHEL/CentOS, meaning the Docker packages built for CentOS will work just fine on Rocky Linux.
Once added, verify that the repo is correctly set up:
sudo dnf repolist
This should show the Docker CE repo in the list. At this point, your system is ready to begin the installation of Docker.
Fruit of the Loom Eversoft Fleece Elastic Bottom Sweatpants with Pockets, Relaxed Fit, Moisture Wicking, Breathable
$8.87 (as of July 22, 2025 12:53 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Installing Docker on Rocky Linux 10
Step-by-Step Installation Process
Installing Docker on Rocky Linux 10 involves a few clear steps, and we’ll walk through each one with precision.
Installing the Docker Engine
Now that the Docker repo is added, let’s install the Docker Engine, Docker CLI, and the container runtime.
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
What do these packages mean?
docker-ce
: The Community Edition of Dockerdocker-ce-cli
: Command-line tools for interacting with Dockercontainerd.io
: A high-performance container runtimedocker-buildx-plugin
: For advanced builds using BuildKitdocker-compose-plugin
: Enables Docker Compose v2
This command pulls in all dependencies and sets up Docker on your system.
Read Also: How to Run Docker in Docker Container (DinD)
Starting and Enabling Docker
Once installed, you need to start the Docker service and ensure it runs on boot:
sudo systemctl start docker
sudo systemctl enable docker
You can verify that Docker is running with:
sudo systemctl status docker
If you see “active (running)” in green, congratulations—Docker is successfully installed and running!
Verifying Docker Installation
Let’s make sure Docker is working as expected by running the classic hello-world container:
sudo docker run hello-world
This will pull a test image from Docker Hub, create a container, and print a success message if everything’s working properly. If this command runs without errors, you’ve got a fully functional Docker setup on Rocky Linux 10.
Post-Installation Steps
Managing Docker as a Non-Root User
By default, Docker commands need to be run with sudo
, which can be a bit inconvenient and error-prone, especially in automation scripts. Fortunately, you can configure Docker to be used by a non-root user by adding that user to the docker
group.
Here’s how to do it:
- Create the Docker group if it doesn’t already exist:
sudo groupadd docker
- Add your user to the Docker group:
sudo usermod -aG docker $USER
- Apply the new group membership:
- You need to log out and back in (or reboot) for the group change to take effect.
- Verify by running Docker without sudo:
docker run hello-world
If it runs successfully, you’ve now configured Docker for non-root use. Keep in mind that giving users access to Docker is essentially giving them root privileges on the system, because they can mount the entire filesystem or escape the container in certain ways. Only grant this access to trusted users.
Configuring Docker to Start on Boot
It’s useful to have Docker start automatically whenever your system boots up, especially for production environments or services that rely on Docker containers.
You can enable Docker to start on boot using this command:
sudo systemctl enable docker
To double-check the service’s status, you can run:
sudo systemctl is-enabled docker
If it returns enabled
, Docker is set to start during system boot.
Want to ensure everything is working correctly after a restart? Just reboot your system:
sudo reboot
Then after login, run:
docker ps
If the Docker daemon starts and the command works without issue, the configuration was successful.
150 PCS Romance Book Stickers for Kindle, Holographic Bookish Sticker Pack Reading Glitter Vinyl Decals for Laptop Ebook Readers Water Bottles Journal Scrapbook Waterproof
$9.99 (as of July 27, 2025 22:12 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Testing Docker with a Sample Container
Let’s test Docker a bit further by pulling and running a real-world container, such as an NGINX web server. NGINX is a lightweight and powerful web server often used in development and production environments.
Here’s how to do it:
- Pull the NGINX image:
docker pull nginx
- Run the container:
docker run -d -p 8080:80 --name webserver nginx
- Check the running containers:
docker ps
- Test in a browser or with curl:
- Open your browser and go to
http://localhost:8080
- or run:
curl http://localhost:8080
- Open your browser and go to
You should see the NGINX welcome page. This proves that Docker is running properly, ports are mapped correctly, and containers are serving traffic as expected.
To stop and remove the container:
docker stop webserver
docker rm webserver
This quick test gives you a strong foundation to start building and deploying your own applications using Docker containers.
Common Issues and Troubleshooting
Docker Daemon Not Starting
One of the most frequent issues after installation is the Docker daemon not starting. You can troubleshoot this by checking the service status:
sudo systemctl status docker
If it’s inactive or failed, try restarting it:
sudo systemctl restart docker
If the issue persists, inspect the Docker logs for errors:
journalctl -u docker.service
Common reasons include:
- Incomplete installation or missing dependencies
- Conflicting container runtimes
- Kernel modules not loaded
Make sure overlay
and br_netfilter
modules are loaded:
sudo modprobe overlay
sudo modprobe br_netfilter
If the Docker service still won’t start, a reboot usually helps. If it doesn’t, consider reinstalling Docker or checking SELinux and firewall rules.
Permission Denied Errors
If you get a “permission denied” error when running Docker commands, it’s likely due to not using sudo
, or your user not being in the docker
group.
Here’s how to fix it:
- Try running the command with
sudo
. - Ensure you added your user to the Docker group:
sudo usermod -aG docker $USER
- Log out and back in, or reboot.
If you still see errors, check file permissions on the Docker socket:
ls -l /var/run/docker.sock
It should show something like:
srw-rw---- 1 root docker 0 Jul 28 11:45 /var/run/docker.sock
If the socket isn’t group-writable or belongs to the wrong group, it may block access.
Network Configuration Problems
Another common issue is Docker containers being unable to connect to external networks or each other. This could be due to:
- Firewalld blocking traffic
- IP forwarding not being enabled
- Docker’s bridge network not properly created
To fix these:
- Allow forwarding:
sudo sysctl net.ipv4.ip_forward=1
- To make it permanent:
echo "net.ipv4.ip_forward = 1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
- Check Docker’s network config:
docker network ls
- Restart Docker to recreate default networks:
sudo systemctl restart docker
- Allow traffic through Firewalld (if enabled):
sudo firewall-cmd --zone=public --add-masquerade --permanent
sudo firewall-cmd --reload
These steps should resolve most Docker networking issues on Rocky Linux 10.
Uninstalling Docker (If Needed)
Completely Removing Docker
Sometimes, you might want to remove Docker from your Rocky Linux 10 system—maybe to reinstall it cleanly or because you no longer need it. Whatever the reason, uninstalling Docker is straightforward.
Start by stopping the Docker service:
sudo systemctl stop docker
Then, remove all Docker-related packages:
sudo dnf remove -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
To ensure all dependencies and additional files are also removed, you can clean up using:
sudo dnf autoremove -y
This command removes orphaned packages that were installed as dependencies for Docker but are no longer needed.
Cleaning Up Docker Dependencies
Docker leaves behind various files and directories after uninstallation, including containers, images, volumes, and configuration files. If you’re looking for a clean slate, delete them manually:
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
You may also want to check for leftover configuration files:
sudo rm /etc/docker/daemon.json
Finally, remove the Docker group if it’s no longer needed:
sudo groupdel docker
After completing these steps, Docker will be completely removed from your system, including all its data and settings. Be cautious with this process, as it permanently deletes all container data.
Rosabella Moringa Capsules – Pure Moringa Powder, Energy, Skin, Immune & Gut Health Superfood, Rich in Antioxidants, Essential Vitamins & Amino Acids, Natural Green Superfood Supplement – 60 Count
$29.99 (as of July 28, 2025 13:57 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Advanced Docker Configurations on Rocky Linux
Setting Up Docker Compose
Docker Compose is a tool that allows you to define and manage multi-container Docker applications using a simple YAML file. It’s especially useful for complex projects where you need to run a database, backend service, and frontend simultaneously.
If you installed Docker using the official repository, Docker Compose v2 should already be available as a plugin. You can verify it with:
docker compose version
If it’s not installed, you can add it manually:
sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
To test the installation:
docker-compose --version
Create a simple docker-compose.yml
file:
version: '3'
services:
web:
image: nginx
ports:
- "8080:80"
Run it using:
docker-compose up -d
Docker Compose simplifies orchestration and keeps your configuration code organized and repeatable.
Working with Docker Volumes and Networks
Understanding how to manage volumes and networks is essential for building robust and persistent container environments.
Volumes allow data to persist even when the container is removed:
docker volume create myvolume
docker run -v myvolume:/data busybox
To inspect volumes:
docker volume ls
Networks enable containers to communicate with each other. Docker provides different network drivers:
bridge
(default)host
none
overlay
(for Docker Swarm)
Create and connect a custom bridge network:
docker network create mynet
docker run -d --name container1 --network=mynet nginx
docker run -d --name container2 --network=mynet busybox sleep 3600
Now container2
can reach container1
via the container name.
These advanced features are fundamental for any serious Docker-based development or deployment workflow.
Docker Security Best Practices
While Docker offers convenience and power, it also introduces new attack surfaces. Securing your Docker environment is crucial, especially on production servers.
Here are essential Docker security practices:
- Use trusted base images – Always pull from official repositories.
- Minimize image size – Smaller images have fewer vulnerabilities.
- Scan images regularly – Use tools like
docker scan
or external scanners like Trivy. - Avoid running containers as root – Use non-root users within your Dockerfiles.
- Limit container capabilities – Use the
--cap-drop
flag to remove unnecessary permissions. - Enable user namespaces – Isolate container users from the host system.
- Set resource limits – Prevent containers from consuming all system resources.
- Keep Docker and dependencies updated – Always run the latest stable versions.
- Audit and rotate secrets – Avoid hardcoding passwords in Dockerfiles or Compose files.
- Monitor container activity – Use logging tools and container security solutions.
Security should be an integral part of your Docker strategy, not an afterthought.
Using Docker for Application Deployment
Deploying a Simple Web App
Let’s go practical and show how Docker can help you deploy a basic web app. Say you have a Node.js application. First, create a simple app.js
:
const http = require('http');
const port = 3000;
http.createServer((req, res) => {
res.write('Hello from Docker on Rocky Linux!');
res.end();
}).listen(port);
Now write a Dockerfile
:
FROM node:18
WORKDIR /app
COPY app.js .
EXPOSE 3000
CMD ["node", "app.js"]
Build the Docker image:
docker build -t my-node-app .
Run the container:
docker run -d -p 3000:3000 my-node-app
Visit http://localhost:3000
and you’ll see your app running—fully containerized.
This workflow can be replicated for almost any programming language or framework, enabling fast, reliable deployments.
Containerizing a Custom Application
Let’s say you have a Python Flask app. The process is nearly identical:
- Create the Flask app (
app.py
):
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return "Hello from Flask and Docker!"
- Create a
requirements.txt
:
flask
- Create a Dockerfile:
FROM python:3.11
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
EXPOSE 5000
CMD ["python", "app.py"]
- Build and run:
docker build -t flask-app .
docker run -d -p 5000:5000 flask-app
Your Flask app is now Dockerized and running, proving how easy it is to deploy applications in containers using Rocky Linux 10 as the host OS.
Conclusion
Installing Docker on Rocky Linux 10 is a smart move if you’re aiming to build a modern, containerized development or production environment. Despite Rocky Linux defaulting to Podman, Docker can still be fully installed and used without any compatibility issues. Whether you’re just experimenting or preparing for a full-scale microservices deployment, Docker makes it incredibly easy to build, test, and ship your applications in isolated environments.
From preparing your system to handling post-install configurations and exploring advanced usage like Docker Compose, volumes, and networks—this guide has walked you through the entire process step-by-step. You’ve also learned how to secure Docker, troubleshoot common issues, and even deploy a couple of sample applications.
Docker transforms how you develop and deploy software. It simplifies everything from spinning up test environments to scaling apps in production. Combined with the rock-solid stability of Rocky Linux 10, you’ve got a powerful foundation for any tech stack.
Now that Docker is running smoothly on your system, it’s time to explore further. Try integrating Docker with CI/CD pipelines, or experiment with orchestration tools like Docker Swarm or Kubernetes. The container revolution is well underway—don’t just watch it happen. Be a part of it.
From setting up scalable AWS solutions to managing complex Linux environments, I’ve got you covered. Visit my Fiverr profile to get started.
Frequently Asked Questions (FAQs)
1. Is Docker compatible with Rocky Linux 10 out-of-the-box?
Not entirely. Docker is not available in the default Rocky Linux repositories, but it is fully compatible once the official Docker repository is added. All Docker CE components work seamlessly after installation.
2. Do I need to use Podman instead of Docker on Rocky Linux?
No. While Podman is the default container engine for Rocky Linux due to its daemonless and rootless features, Docker remains fully usable and may be preferred due to its ecosystem, tooling, and broader support in enterprise environments.
3. How can I update Docker safely?
Use the official Docker repository to update safely. Run:
sudo dnf update docker-ce docker-ce-cli containerd.io
Make sure to stop containers if needed, and always test updates in a staging environment before deploying to production.
4. What is the difference between Docker CE and EE?
Docker CE (Community Edition) is free and open-source, ideal for developers and smaller teams. Docker EE (Enterprise Edition) includes additional features like certified images, security scanning, and enterprise support. For most use cases, CE is sufficient.
5. Can I run Docker in production on Rocky Linux 10?
Absolutely. Rocky Linux 10 is stable, secure, and enterprise-ready, making it a great host OS for Docker in production environments. Just ensure your system is hardened, monitored, and configured with best practices for container security.
Leave a Reply
Please log in to post a comment.