Install and Setup Docker Engine on CentOS9

Shounak KhulapeShounak Khulape
2 min read
💡
NOTE: We will only look out for docker installation particularly and not for CentOS9 Installation.

OS requirements

To Install docker engine, we will be following CentOS 9 versions.

  • CentOS 9 (stream)

Uninstall old versions

Uninstall any old version to install new version of docker.

sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

Installation Method.

There are 3 methods to install docker engine.

  • setup Docker's repository

  • Install it manually

  • convenience script

Install using rpm repository.

We will be following using setup repository

Install the yum-utils package (which provides the yum-config-manager utility) and set up the repository.

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
  1. Install Docker Engine

We will install Latest version of docker

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

It will ask two times to verify [y/N] Click on y and then Enter

This command installs Docker, but it doesn't start Docker.

  1. Start Docker.

     sudo systemctl start docker
    
  2. Verify that the Docker Engine installation is successful by running thehello-worldimage.

     sudo docker run hello-world
    

    It will unable to find the image and will pull the latest library from hub.docker

  3. Congratulation! You have now successfully installed and started Docker Engine

If you liked what you read, do follow and Any feedback for further improvement will be highly appreciated!

Thank you and Happy Learning!👏

0
Subscribe to my newsletter

Read articles from Shounak Khulape directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shounak Khulape
Shounak Khulape

🖐Hi There! ⫸ Currently working as a System Administrator | WebLogic Admin. ⫸ Aspiring to be DevOps | SRE | Build & Release Engineer ⫸Enthusiast about Technical Writing