You can install Docker on Red Hat either via a re­pos­it­ory or manually. Only a few steps are required for both options.

How to install Docker on Red Hat 8

First released in 2013, Docker is a free software that has become one of the top container solutions for de­vel­op­ment and system ad­min­is­tra­tion. It enables users to deploy and run ap­plic­a­tions within Docker con­tain­ers, allowing for faster usage by including necessary de­pend­en­cies. Docker is highly re­com­men­ded, par­tic­u­larly when used with Red Hat En­ter­prise Linux (RHEL). RHEL is known as one of the most popular and reliable Linux dis­tri­bu­tions for busi­nesses, praised for its stability, security, and high com­pat­ib­il­ity with a wide range of software packages. Below, we will guide you through the process of in­stalling Docker on RHEL 8.

Tip

Are you using a newer version of the Linux platform? In our Digital Guide you will also find in­struc­tions on how to install Docker on RHEL 9.

What re­quire­ments must be met?

Before you start in­stalling Docker on Red Hat En­ter­prise Linux 8, there are some pre­requis­ites that need to be fulfilled. You need a virtual machine with RHEL 8 installed on it and you can find out how this works in our Digital Guide. You must also have admin priv­ileges for this machine. It is also important that you have an internet con­nec­tion so that you can download the necessary packages. Once these re­quire­ments have been met, you can start in­stalling Docker on RHEL 8.

Steps for in­stalling Docker on Red Hat En­ter­prise Linux 8

We explain how to add Docker via the cor­res­pond­ing re­pos­it­ory. We recommend this method as this makes in­stall­a­tion and future updates easier.

Remove old versions of Docker

You only need to perform the first step if there is already an older version of Docker on the system. In this case, you should delete all de­pend­en­cies as well as this version. The package manager Podman will also be removed. You will need the following code for this:

sudo yum remove docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-engine \
    podman \
    runc
bash

Yum is the package man­age­ment system YUM (Yellowdog Updater, Modified).

Bring the system up to date

The first step you should always take is to update your entire system. To do this, open a terminal and use the update command to update all files and de­pend­en­cies so you have the latest version. This is the ap­pro­pri­ate command for this:

yum update
bash

Create re­pos­it­ory

You will need to set up a re­pos­it­ory for Docker, which is necessary for the in­stall­a­tion process. Begin by in­stalling the yum-utils package, as it includes the con­fig­ur­a­tion manager for yum. Once that’s done, you can create the re­pos­it­ory using the following commands:

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
bash

Carry out in­stall­a­tion

Now, starting from the new re­pos­it­ory, you can begin the actual Docker in­stall­a­tion on Red Hat En­ter­prise Linux 8. To add the current version of the engine, conainerd (a runtime en­vir­on­ment) and the or­ches­tra­tion tool Docker Compose, enter this command:

sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
bash

If you’re asked for the GPG key, it is as follows:

060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
bash

Check it and confirm if there is a match.

If you want to install a specific version of Docker on RHEL 8 instead, first display all available options from the re­pos­it­ory. This looks something like this:

yum list docker-ce --showduplicates | sort -r
docker-ce.s390x    3:24.0.0-1.el8    docker-ce-stable
docker-ce.s390x    3:23.0.6-1.el8    docker-ce-stable
<...>
bash

Select the desired version and replace the place­hold­er ‘version_name’ in the following command with the cor­res­pond­ing name. This always consists of the name of the package (docker-ce), a hyphen and the version number. An example would be this variant: docker-ce-3:24.0.0-1.e18. The command reads like this:

sudo yum install docker-ce-version_name docker-ce-cli-version_name containerd.io docker-buildx-plugin docker-compose-plugin
bash

Check Docker

To check whether the in­stall­a­tion of Docker on Red Hat En­ter­prise Linux 8 was suc­cess­ful, you should now start the platform. To do this, use this command:

sudo systemctl start docker
bash

Then initiate a ‘hello-world’ Docker image to test the func­tion­al­ity of the platform. The following command can be used for this:

sudo docker run hello-world
bash

How to manually install Docker on RHEL 8

If you do not have access to a re­pos­it­ory, manual in­stall­a­tion is also possible. The steps required for this are as follows:

Remove old versions of Docker

If you still have an old version of Docker on Red Hat En­ter­prise Linux 8, you should delete it first. This is the cor­res­pond­ing code:

sudo yum remove docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-engine \
    podman \
    runc
bash

You will receive a no­ti­fic­a­tion if there is no previous version stored.

Download rpm file

Now go to the official Docker download page and select the ap­pro­pri­ate variant for RHEL 8. Then download the cor­res­pond­ing rpm file.

Start in­stall­a­tion

To install Docker on RHEL 8, use the command below. Be sure to replace path/to/your/package with the actual path where the file is stored.

sudo yum install path/to/your/package.rpm
bash

Check in­stall­a­tion

To check whether the in­stall­a­tion was suc­cess­ful, start Docker again using the following command:

sudo systemctl start docker
bash

Now run the ‘hello-world’ Docker image to check its func­tion­al­ity:

sudo docker run hello-world
bash
Compute Engine
The ideal IaaS for your workload
  • Cost-effective vCPUs and powerful dedicated cores
  • Flex­ib­il­ity with no minimum contract
  • 24/7 expert support included
Go to Main Menu