Learn how to install Docker CE on Rocky Linux 8 with this step-by-step guide. Follow along to set up Docker’s community edition and start containerizing your applications efficiently. #centlinux #linux #docker
Table of Contents
What is Docker CE?
Docker CE, or Docker Community Edition, is a free and open-source version of the Docker platform. It provides the essential tools for building, shipping, and running containerized applications. Docker CE includes the Docker Engine, which is the runtime environment for containers, along with command-line tools and utilities for managing containers and images.
Key features of Docker CE include:
- Containerization: Docker CE allows you to package your applications and their dependencies into lightweight, portable containers that can run consistently across different environments.
- Isolation: Containers created with Docker CE offer process isolation, ensuring that applications running within them do not interfere with each other or the host system.
- Resource Efficiency: Docker CE optimizes resource utilization by sharing the host system’s kernel among containers, enabling efficient use of CPU, memory, and storage resources.
- Portability: Docker CE containers are portable across various platforms and cloud environments, making it easy to deploy applications consistently across development, testing, and production environments.
- Version Control: Docker CE allows you to version control your application’s containers and images, enabling collaboration among team members and facilitating rollbacks to previous versions if needed.
- Orchestration: While Docker CE itself provides basic container management capabilities, it can be integrated with orchestration tools like Docker Swarm or Kubernetes for managing containerized applications at scale.
Overall, Docker CE simplifies the process of building, deploying, and managing applications using containers, making it a popular choice for developers, DevOps teams, and organizations seeking agile and efficient software delivery practices.
In Red Hat Enterprise Linux (RHEL) 8 / CentOS 8 or later, Support of Docker has been removed by the vendor. Whereas a new containerization platform libpod (Podman’s Container Management Library) has been introduced as a replacement of Docker.
However, you can still install Docker and it’s dependencies on Rocky Linux 8 from third party yum repositories.

What is Docker Compose?
Docker Compose is a tool provided by Docker that simplifies the process of defining and running multi-container Docker applications. It allows you to use a YAML file to configure the services, networks, and volumes required for your application and then spin up all the containers with a single command.
Here are the key features and components of Docker Compose:
- YAML Configuration: Docker Compose uses a simple YAML file to define the services that make up your application, along with their configuration options, dependencies, volumes, and networking requirements.
- Multi-Container Applications: With Docker Compose, you can define and manage multi-container applications, where each service runs in its own container. This makes it easy to decompose complex applications into smaller, manageable components.
- Service Dependencies: Docker Compose allows you to specify dependencies between services, ensuring that containers are started in the correct order and that they can communicate with each other as needed.
- Volume and Network Configuration: You can define volumes and networks for your Docker Compose services directly in the YAML file, making it easy to manage data persistence and network communication between containers.
- Environment Variables and Secrets: Docker Compose supports the use of environment variables and secrets, allowing you to parameterize your configuration and securely pass sensitive information to your containers.
- Lifecycle Management: Docker Compose provides commands for managing the lifecycle of your application, including starting, stopping, and restarting containers, as well as scaling services up or down to accommodate changes in demand.
Overall, Docker Compose streamlines the process of working with Docker containers, especially for development and testing environments, by providing a simple and consistent way to define, configure, and manage multi-container applications.
Docker.io vs Docker-CE
Docker.io and Docker CE (Community Edition) are closely related but refer to slightly different aspects of the Docker ecosystem:
- Docker.io: Docker.io refers to the core Docker software and the Docker Engine, which is the runtime environment for Docker containers. It encompasses the fundamental tools and components needed to create, manage, and run containers on a host system. Docker.io is the upstream open-source project that forms the basis for Docker CE and Docker EE (Enterprise Edition).
- Docker CE (Community Edition): Docker CE is a specific distribution of Docker that is geared towards individual developers, small teams, and community contributors. It includes the Docker Engine, as well as additional tools and utilities for building, shipping, and running containers. Docker CE is free to use and is distributed under an open-source license.
In summary, Docker.io represents the broader Docker ecosystem, including the core Docker software, while Docker CE is a specific edition of Docker tailored for community users and developers, providing an easy-to-use platform for containerization.
Read Also: How to run Keycloak Docker Container
Environment Specification
We are using a minimal Rocky Linux 8 virtual machine with following specifications.
- CPU – 3.4 Ghz (2 cores)
- Memory – 2 GB
- Storage – 20 GB
- Operating System – Rocky Linux 8.6 (Green Obsidian)
- Hostname – docker-01.centlinux.com
- IP Address – 192.168.116.128 /24
For this setup, you’ll need a reliable Linux server environment. Many enthusiasts and developers prefer using a compact Mini PC or a VPS for their home lab and experimentation with Rocky Linux and other Linux server technologies. A Mini PC offers an energy-efficient, always-on solution that you can physically manage in your workspace.
[Limited Time Mini PC Offers – Click and Save!]
While a VPS from providers like Rose Hosting delivers scalable performance and remote access without hardware maintenance.
[Discover the Power of Rose Hosting VPS – Limited Time Offer!]
Both options are excellent for practicing Docker registry setups and broader Linux server administration. If you’re interested, you can find recommended Mini PCs and VPS hosting options through the affiliate links below, which support this blog at no extra cost to you.
Disclaimer: Some of the links in this post are affiliate links. If you choose to purchase through them, I may earn a small commission at no additional cost to you, helping support ongoing content creation.
Update your Linux Operating System
By using a SSH client, login to docker-01.centlinux.com as root user.
Refresh yum cache by executing following command.
dnf makecacheExecute following dnf command to update your Linux operating system.
dnf update -yIf the above command updates your Linux Kernel, then reboot your operating system with newly installed Kernel.
rebootVerify the versions of your Linux Kernel and operating system.
cat /etc/rocky-release
uname -rOutput:
Rocky Linux release 8.6 (Green Obsidian)
4.18.0-372.13.1.el8_6.x86_64
Install Docker CE on Rocky Linux 8
Docker CE is also available to download from Docker’s official website. However, there is a better way to install it from Docker yum repository.
For this purpose, add Docker yum repository by using dnf command.
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repoBuild cache of newly installed yum repositories.
dnf makecacheOutput:
Rocky Linux 8 - AppStream 1.6 kB/s | 4.8 kB 00:02
Rocky Linux 8 - BaseOS 1.7 kB/s | 4.3 kB 00:02
Rocky Linux 8 - Extras 1.2 kB/s | 3.5 kB 00:02
Docker CE Stable - x86_64 28 kB/s | 26 kB 00:00
Metadata cache created.
Now, you can easily install Docker CE on Linux by using a dnf command.
dnf install -y docker-ceEnable and start Docker service.
systemctl enable --now docker.serviceVerify the status of Docker service.
systemctl status docker.serviceOutput:
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor pres>
Active: active (running) since Thu 2022-06-30 21:18:32 PKT; 16s ago
Docs: https://docs.docker.com
Main PID: 4460 (dockerd)
Tasks: 7
Memory: 35.2M
CGroup: /system.slice/docker.service
└─4460 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/contai>
Jun 30 21:18:30 rockylinux-01.centlinux.com dockerd[4460]: time="2022-06-30T21:>
Jun 30 21:18:30 rockylinux-01.centlinux.com dockerd[4460]: time="2022-06-30T21:>
Jun 30 21:18:30 rockylinux-01.centlinux.com dockerd[4460]: time="2022-06-30T21:>
Check the version of Docker Engine.
docker versionOutput:
Client: Docker Engine - Community
Version: 20.10.17
API version: 1.41
Go version: go1.17.11
Git commit: 100c701
Built: Mon Jun 6 23:03:11 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
Git commit: a89b842
Built: Mon Jun 6 23:01:29 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.6
GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc:
Version: 1.1.2
GitCommit: v1.1.2-0-ga916309
docker-init:
Version: 0.19.0
GitCommit: de40ad0
You have successfully install Docker CE on Rocky Linux 8.
Create your First Docker Container
Search Docker Hub for official image of Alpine Linux.
docker search alpine --filter is-official=trueOutput:
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
alpine A minimal Docker image based on Alpine Linux… 8944 [OK]
Pull the Alpine Linux image to local Docker platform.
docker pull alpineOutput:
Using default tag: latest
latest: Pulling from library/alpine
2408cc74d12b: Pull complete
Digest: sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest
List the locally available Docker images.
docker imagesOutput:
REPOSITORY TAG IMAGE ID CREATED SIZE
alpine latest e66264b98777 5 weeks ago 5.53MB
Create a Docker Container from Alpine Linux image and start /bin/sh shell, so you can execute some test commands over there.
docker run -it --rm alpine /bin/shExecute test commands on Alpine Linux shell.
cat /etc/os-release
uname -r
exitOutput:
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.16.0
PRETTY_NAME="Alpine Linux v3.16"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
4.18.0-372.13.1.el8_6.x86_64
Install Docker Compose on Rocky Linux
You can optionally install docker-compose software, if you want to run multiple Docker containers as a single service.
Download latest version of docker-compose from GitHub by using curl command.
curl -L https://github.com/docker/compose/releases/download/v2.6.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-composeGrant execution permissions to docker-compose file.
chmod +x /usr/local/bin/docker-composeExecute docker-compose command to check it’s version.
docker-compose versionOutput:
Docker Compose version v2.6.1
Read Also: Setup a Private Docker Registry in Rocky Linux 8
Final Thoughts
Installing Docker Community Edition (CE) on Rocky Linux 8 is a straightforward process that empowers you to leverage containerization technology for efficient application deployment and management. By setting up Docker CE, you have access to a robust platform for creating, deploying, and running containers, ensuring lightweight and consistent software environments.
This guide walked you through the entire process, from configuring the necessary repository and installing Docker CE to starting the Docker service and verifying its functionality. Whether you’re running containers for development, testing, or production, Docker CE provides a versatile solution for container orchestration.
With Docker installed, you can now explore its powerful features, including creating custom images, pulling pre-built images from Docker Hub, and managing containers efficiently. For an enhanced experience, you may also consider integrating Docker Compose for multi-container applications or setting up a private Docker registry for secure image storage. Docker CE opens the door to a new level of flexibility and scalability in managing your software ecosystem.
Optimize your cloud infrastructure and secure your servers with my AWS and Linux administration services. Let’s ensure your systems run smoothly. Connect with me now! if you need any guidance or advice related to your Linux VPS.
FAQs
1. Can I install Docker CE on Rocky Linux 8 without root or sudo privileges?
No, installing Docker CE requires root or sudo access to add repositories and manage system services.
2. How do I verify Docker CE installation was successful on Rocky Linux 8?
Run following commands to check Docker version and service status.
docker --version
sudo systemctl status docker3. Will Docker CE on Rocky Linux 8 work with SELinux enabled?
Yes, but you may need to configure SELinux policies or set it to permissive mode for some Docker operations.
4. How can I enable Docker to start automatically on Rocky Linux 8 boot?
Use following command to enable Docker daemon to start at system boot.
sudo systemctl enable docker5. Is it possible to use Docker CE with Firewalld enabled on Rocky Linux 8?
Yes, but you must configure Firewalld to allow Docker’s network traffic for container communication.
Recommended Courses
If you’re serious about mastering containerization, Docker Mastery: with Kubernetes + Swarm from a Docker Captain by Bret Fisher is one of the best courses available. Taught by a seasoned Docker Captain, this course takes you from Docker fundamentals all the way to advanced topics like Kubernetes and Swarm orchestration.
Whether you’re a system administrator, developer, or DevOps enthusiast, this hands-on training will give you the real-world skills you need to excel in modern cloud environments. It’s a must-have investment in your career if you want to stay ahead in the competitive world of DevOps and cloud computing.
Disclaimer: This post contains affiliate links. If you purchase through these links, I may earn a small commission at no extra cost to you. This helps support my blog and allows me to continue creating valuable content for you.

Leave a Reply
Please log in to post a comment.