This guide provides steps to install Docker on a RHEL (Red Hat Enterprise Linux) system.
Ensure that you have sudo privileges on the RHEL system.
-
Install
yum-utilsyum-utilsis a collection of utilities and plugins that extend and enhance the functionalities ofyum.sudo yum install -y yum-utils
-yflag: Automatically answers "yes" to all prompts during the installation, allowingyumto proceed without user interaction.
-
Add Docker's Official Repository
Use the
yum-config-managerutility to add Docker's official repository to your system.sudo yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
-
Install Docker and its Components
Install Docker Community Edition along with essential tools. This includes Docker Compose, which is required for defining and running multi-container Docker applications. The
--allowerasingflag allows yum to resolve any package conflicts by removing incompatible packages if necessary.sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin --allowerasing
-
Enable Docker to Start on Boot
Ensure that Docker starts automatically whenever the system boots up.
sudo systemctl enable docker -
Reboot the System
Reboot your system to apply all changes and start Docker.
sudo reboot
After the system reboots, Docker will start automatically. You can verify that Docker is running by checking its status:
sudo systemctl status dockeror
sudo docker psGet started with Docker by running the hello-world container to verify the installation:
sudo docker run hello-worldIf you encounter any issues, you can check Docker's logs using:
sudo journalctl -u docker