You have two options for in­stalling Docker on Red Hat En­ter­prise Linux 9. Although creating a re­pos­it­ory is re­com­men­ded, manual in­stall­a­tion is also possible.

How to install Docker on Red Hat 9

Docker’s open platform sim­pli­fies de­vel­op­ment across multiple locations or machines and fa­cil­it­ates seamless team col­lab­or­a­tion. Because ap­plic­a­tions and their de­pend­en­cies can be sent and executed together in Docker con­tain­ers, per­form­ance is also massively improved. A popular com­bin­a­tion is Docker with Red Hat En­ter­prise Linux 9. The pro­pri­et­ary Linux dis­tri­bu­tion is now regarded as one of the most robust, secure and flexible solutions spe­cific­ally for companies. Its com­pat­ib­il­ity with numerous software packages also speaks in favour of the platform. We explain how to install Docker on Red Hat En­ter­prise Linux (RHEL).

Tip

In our Digital Guide you will also find com­pre­hens­ive in­struc­tions for in­stalling Docker on RHEL 8.

What re­quire­ments must be met?

To install Docker on RHEL 9, you need to take a few pre­lim­in­ary steps. First, ensure you have a virtual machine running the ap­pro­pri­ate version of Red Hat En­ter­prise Linux. Our Digital Guide provides in­struc­tions on how to install RHEL 9. You’ll also need ad­min­is­trat­or priv­ileges for this virtual machine. Ad­di­tion­ally, a stable internet con­nec­tion is essential for down­load­ing all the required packages. Once these con­di­tions are met, you can proceed with the in­stall­a­tion.

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

The simplest way to install Docker on Red Hat En­ter­prise Linux 9 is through an rpm re­pos­it­ory. Begin by setting up this re­pos­it­ory and then proceed with the following steps. We recommend this approach, as it also sim­pli­fies future updates. Here’s the process:

Remove old versions of Docker

Before in­stalling a new version of Docker, it’s important to uninstall any older versions along with all related de­pend­en­cies. This process will also remove the package manager Podman. Afterward, you’ll use the YUM (Yellowdog Updater, Modified) package man­age­ment system for the necessary steps. The code for this process is as follows:

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

If no old versions can be found, YUM will inform you.

Update system

Before you carry out the in­stall­a­tion, it makes sense to update your entire system first. This will ensure that all files and de­pend­en­cies are up to date. This in­struc­tion can be used for this purpose:

yum update
bash

Create re­pos­it­ory

The in­stall­a­tion is carried out via a re­pos­it­ory. If you want to create this directory, you will need the yum-utils package, which contains the YUM con­fig­ur­a­tion manager. Use the following two command lines to install yum-utils, start the manager and create a new re­pos­it­ory for Docker on RHEL 9:

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

Install current version or any version

To install the latest version of Docker on Red Hat En­ter­prise Linux 9, use the following command. This will install the Docker engine along with the con­tainerd runtime and the Docker Compose or­ches­tra­tion tool.

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

In some cases, you will be asked for the GPG key. Compare the stored key with this com­bin­a­tion of numbers. If both match, confirm that they are correct.

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

If you want to use a specific version of Docker for RHEL 9, you can view a list of all available options from the re­pos­it­ory and select the version that suits your needs. An example of such a list looks 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

Decide on the desired version and enter the full version name in the following command instead of the place­hold­er ‘version_name’. These names are always struc­tured according to the same principle: Name of the package (in this case ‘docker-ce’), then a hyphen and followed by the version number. For the first option from the list above, this would be the correct name: docker-ce-3:24.0.0-1.el8.

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

Check Docker

To ensure that the in­stall­a­tion of Docker on Red Hat En­ter­prise Linux 9 was suc­cess­ful, start the platform with this command:

sudo systemctl start docker
bash

Then create the Docker image ‘hello-world’. If this works as expected, the in­stall­a­tion was suc­cess­ful.

sudo docker run hello-world
bash

How to install Docker on RHEL 9 manually

There is also the option of in­stalling Docker on RHEL 9 without creating a re­pos­it­ory.

Remove all old versions of Docker on RHEL 9

First, delete all old versions of Docker on Red Hat En­ter­prise Linux 9 and the package manager Podman. This code could be used 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

Download rpm file

Go to the official Docker download page and download the desired rpm file.

Start in­stall­a­tion

To start the in­stall­a­tion of Docker on Red Hat En­ter­prise Linux 9, use the following command. Instead of the place­hold­er ‘path/to/your/package’, enter the location of the rpm file.

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

Check in­stall­a­tion

When the in­stall­a­tion is complete, start Docker with this command:

sudo systemctl start docker
bash

Create the ‘hello-world’ Docker image. If this works, it means that the in­stall­a­tion was suc­cess­ful.

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