Hello readers, in this guide we will explain how to install Docker on RHEL 9 step by step. Docker comes in two editions, community and enterprise, in this post we will install community edition.Docker is an open-source container platform which uses OS level virtualization to create and mange containers. Docker allows developers and coders to build and package their application inside the container.System Requirements for DockerMinimal Installed RHEL 9Minimum 2CPUs or vCPUsMinimum 2 GB RAM or moreSudo user with admin privilegesInternet ConnectivityWithout any further delay, lets jump into the docker installation steps.1) Remove Podman & BuildahThis step is optional in case you have not installed podman on your system. If it is installed, then remove it using following dnf command.$ sudo dnf remove -y podman buidah2) Add Docker Repository on RHEL 9Docker package is not available in the default repositories of RHEL 9, so for its installation add  its repository using beneath dnf command.$ sudo dnf config-manager –add-repo https://download.docker.com/linux/rhel/docker-ce.repoNext, verify docker repository, run$ sudo dnf repolistOutput above confirms that docker repository has been added successfully.3) Install Docker on RHEL 9After adding docker repository, we are good to proceed with docker installation. Run following dnf command.$ sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -yAbove command will install latest version of Docker community edition. If you are looking for specific docker version, then run below command to list the versions.$ sudo dnf list docker-ce –showduplicates | sort -rIn above output, second column is version-string. So, choose the version that you want to install and run below command.$ sudo dnf install docker-ce-<version-string> docker-ce-cli-<version-string> containerd.io docker-buildx-plugin docker-compose-plugin -y4) Start and Enable Docker ServiceOnce docker and its dependencies are installed then start and enable its service using systemctl commands as shown below:$ sudo systemctl start docker
$ sudo systemctl enable dockerTo verify the docker service status, run$ sudo systemctl status dockerNext, add your local user to the docker group so that your user can run docker commands without sudo.$ sudo usermod -aG docker $USER
$ newgrp docker
$ idNow, try to run docker version command without sudo.$ docker version5) Test Docker InstallationTo test whether docker installation is successful or not, run a container with hello-world image.$ docker run hello-worldGreat, output confirms that our docker installation is successful as we can see the informational message.That’s all from this post, we hope you have found it useful and informative. Feel free to post your queries and feedback in below comments section.Also Read: 20 Useful Docker Command Examples in Linux
- A word from our sposor -