How to install docker on Centos, AlmaLinux and Rocky Linux

Docker is a sophisticated platform for developers that allows them to package applications and their dependencies into containers, which are lightweight, portable, and self-contained environments. Developers can use Docker to provide a uniform development and deployment environment across different computers and operating systems, avoiding many of the challenges caused by changes in system setups and dependencies.

Docker offers substantial advantages in terms of scalability, resource utilization, and security, in addition to development benefits. Containers may be readily scaled up or down to meet the demands of the workload, allowing for better resource efficiency and cost savings. Docker also has strong security features, such as container isolation from the host system, making it a popular choice for executing mission-critical applications.

I have written more on docker and containers HERE.

Installing Docker on Linux is a straightforward process that can be done in a few simple steps.

NOTE: These steps were tested on AlmaLinux 9, and by convention they should work in CentOS Stream 9 and Rocky Linux 9. Additionally, it is possible for these steps to be applied to version 8.

    1. First, update your system.
      # dnf update
    2. Install dnf-plugins-core package:
      # dnf install -y dnf-plugins-core
    3. Remove the Podman package.
      # dnf remove -y podman buidah
    4. Activate the Docker Repository:
      # dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
    5. Now install Docker:
      # dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
    6. Next, enable Docker service by running below commands:
      # systemctl start docker
      # systemctl enable docker
    7. That’s it, docker is installed.

    8. Verify the service is running:
      # systemctl status docker

      Verify docker version:

      # docker --version
    9. Add a user to the docker group:
      # usermod -aG docker username
    10. Change username to appropriate user account.

    11. Finally, test your docker installation:
      # docker run hello-world
0 Comments

Leave a reply

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

*

©2024 ZMATECH: Innovative solutions for your IT challenges.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

Log in with your credentials

Forgot your details?