Docker is not available in RHEL 8’s default AppStream repositories, so installing it requires adding the official Docker CE repository from Docker’s own package server. Unlike earlier RHEL versions, RHEL 8 ships with Podman as its native container runtime, but Docker CE remains a popular choice for teams migrating existing workflows. This tutorial walks through adding the Docker CE repo, installing the engine, starting the service, and verifying the installation with a test container. You will also learn how to grant a non-root user access to the Docker socket.
Prerequisites
- A running RHEL 8 server with a registered subscription or access to CentOS/RHEL-compatible repos
- A user account with
sudoor root privileges dnfandcurlavailable on the system- Outbound internet access to reach
download.docker.com
Step 1 — Remove Conflicting Packages
RHEL 8 ships with podman, buildah, and runc packages that can conflict with Docker CE. Remove them before proceeding to avoid dependency errors during installation.
sudo dnf remove -y podman buildah runc
These packages are safe to reinstall later if you want Podman back alongside Docker.
Step 2 — Add the Docker CE Repository
Docker CE does not ship in any default RHEL 8 channel. Add Docker’s official CentOS repository, which is compatible with RHEL 8, using dnf config-manager.
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
This writes the repo file to /etc/yum.repos.d/docker-ce.repo and enables it immediately.
Step 3 — Install Docker Engine
With the repository in place, install Docker CE, the CLI client, and the containerd.io runtime in a single command.
sudo dnf install -y docker-ce docker-ce-cli containerd.io
If dnf prompts you to import Docker’s GPG key, accept it. The key fingerprint is published at https://docs.docker.com/engine/install/ so you can verify it independently.
Step 4 — Enable and Start the Docker Service
Enable Docker with systemctl so it starts automatically at boot, then start it immediately in the same command.
sudo systemctl enable --now docker
sudo systemctl status docker
The status output should show active (running). If it reports a conflict with crio or containerd, stop those services first and then rerun the enable command.
Step 5 — Verify with a Test Container
Pull and run the official hello-world image to confirm the engine, network, and registry access all work correctly.
sudo docker run hello-world
A successful run prints a message beginning with Hello from Docker!. If you see a connection error, check that your system’s firewall allows outbound HTTPS traffic on port 443.
Step 6 — Add a Non-Root User to the Docker Group
Running Docker as root is a security risk in daily use. Add your account to the docker group so you can run container commands without sudo. Replace username with your actual login name.
sudo usermod -aG docker username
newgrp docker
docker run hello-world
The newgrp docker command activates the new group membership in the current shell without requiring a logout. On RHEL 8, be aware that the Docker socket at /var/run/docker.sock grants root-equivalent access to anyone in the docker group, so restrict membership accordingly.
Conclusion
You now have Docker CE running on RHEL 8 with the service enabled at boot and your user account configured for passwordless access. Because Docker is not in the standard RHEL repos, remember to pin a repository version or use a specific package version in automation scripts to avoid surprise upgrades. RHEL 8’s native Podman is a drop-in alternative for most use cases and does not require a daemon, making it a strong choice for production workloads where the Docker socket presents an unnecessary attack surface.
Next steps: How to Install Docker Compose on RHEL 8, How to Use Docker Volumes and Bind Mounts on RHEL 8, and How to Configure Docker Networking on RHEL 8.