How to install docker on CentOS/Rocky/AlmaLinux

To install docker on Linux, you can follow the following simple steps. These steps have been tested on CentOS 7, Centos Stream 8 & 9, AlmaLinux 8 & 9, Rocky Linux 8 & 9.

  1. Update you system: make sure the system is up to date by running the following command:
    # yum -y update 
  2. Install the required dependencies: Docker requires a few dependencies. Install them by running the following command:
    # yum install -y yum-utils device-mapper-persistent-data lvm2 
  3. Setup Docker Repository: You can setup the official docker repository by running the following command:
    # yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 
  4. Install Docker: Once you have set up the official repository, you can now install docker. But first remove conflicting packages by running the following command:
    # yum -y remove podman pdman-docker runc 

    Now install docker by running the following command:

    # yum -y install docker-ce 
  5. Start and Enable the docker service: Once you have set up the official repository, you can now install docker by running the following command:
    # systemctl start docker
    # systemctl enable docker
  6. Verify the installation: To verify that Docker is installed and running correctly, you can run the following command: This command will download and run the hello-world Docker image, which will display a message to confirm that Docker is working properly.
    # docker run hello-world 
0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*

©2025 ZMATECH: Innovative solutions for your IT challenges.

Log in with your credentials

Forgot your details?