# How to install Docker on Red Hat Enterprise Linux 8

You can install Docker on Red Hat either via a repository 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 development and system administration. It enables users to deploy and run **applications within [Docker containers](https://www.ionos.com/digitalguide/server/know-how/docker-container/)**, allowing for faster usage by including necessary dependencies. Docker is highly recommended, particularly when used with Red Hat Enterprise Linux (RHEL). RHEL is known as one of the most popular and reliable [Linux distributions](https://www.ionos.com/digitalguide/server/know-how/linux-the-cost-effective-alternative-to-windows/) for businesses, praised for its **stability, security, and high compatibility** with a wide range of software packages. Below, we will guide you through the process of installing Docker on RHEL 8.

Tip Are you using a newer version of the Linux platform? In our Digital Guide you will also find instructions on [how to install Docker on RHEL 9](https://www.ionos.com/digitalguide/server/configuration/docker-on-rhel-9/).

## What requirements must be met?

Before you start installing Docker on Red Hat Enterprise Linux 8, there are some prerequisites that need to be fulfilled. You need a virtual machine with [RHEL 8 installed](https://www.ionos.com/digitalguide/server/configuration/install-red-hat-8/) on it and you can find out how this works in our Digital Guide. You must also have **admin privileges** for this machine. It is also important that you have an internet connection so that you can download the necessary packages. Once these requirements have been met, you can start installing Docker on RHEL 8.

## Steps for installing Docker on Red Hat Enterprise Linux 8

We explain how to add Docker via the corresponding repository. We recommend this method as this makes installation 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 dependencies as well as this version. The package manager Podman will also be removed. You will need the following code for this:

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

Yum is the package management 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 dependencies so you have the latest version. This is the appropriate command for this:

```bash
yum update
```

### Create repository

You will need to set up a repository for Docker, which is necessary for the installation process. Begin by installing the yum-utils package, as it includes the configuration manager for yum. Once that’s done, you can create the repository using the following commands:

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

### Carry out installation

Now, starting from the new repository, you can begin the actual Docker installation on Red Hat Enterprise Linux 8. To add the current version of the engine, conainerd (a runtime environment) and the orchestration tool Docker Compose, enter this command:

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

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

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

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 repository. This looks something like this:

```bash
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
<...>
```

Select the desired version and replace the placeholder “version\_name” in the following command with the corresponding 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:

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

### Check Docker

To check whether the installation of Docker on Red Hat Enterprise Linux 8 was successful, you should now start the platform. To do this, use this command:

```bash
sudo systemctl start docker
```

Then initiate a “hello-world” [Docker image](https://www.ionos.com/digitalguide/server/know-how/docker-images/) to test the functionality of the platform. The following command can be used for this:

```bash
sudo docker run hello-world
```

## How to manually install Docker on RHEL 8

If you do not have access to a repository, manual installation 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 Enterprise Linux 8, you should delete it first. This is the corresponding code:

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

You will receive a notification if there is no previous version stored.

### Download rpm file

Now go to the [official Docker download page](https://download.docker.com/linux/rhel/ "Index of linux/rhel") and select the appropriate variant for RHEL 8. Then download the corresponding rpm file.

### Start installation

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.

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

### Check installation

To check whether the installation was successful, start Docker again using the following command:

```bash
sudo systemctl start docker
```

Now run the “hello-world” Docker image to check its functionality:

```bash
sudo docker run hello-world
```


This is a markdown version of: [https://www.ionos.com/digitalguide/server/configuration/install-docker-on-rhel-8/](https://www.ionos.com/digitalguide/server/configuration/install-docker-on-rhel-8/) for AI/LLM consumption.