Open In App

How to Install Docker on CentOS?

Last Updated : 16 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Quick Preview to Install Docker on CentOS:

  • Installation of Docker on CentOS:
  1. Open CentOS Terminal.
  2. Execute the command yum update in the Root Menu.
  3. Run the command yum install -y yum-utils device-mapper-persistent-data lvm2.
  4. Execute the command yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo
  5. Run the command yum install docker.
  • Starting the Docker Service on CentOS:
  1. Open CentOS Terminal.
  2. Execute the command systemctl start docker
  3. Run the command systemctl status docker to check the status.

While working on any large project application, no doubt many applications need to be executed with different kinds of dependencies & other packages. For a large project, there are many stages present by which a complete executable software goes through to mark its completion. The Installed Docker on CentOS helps to do the same.

Know more about Debian Linux here

If you are using open-source, Linux distributions CentOS, then the Installation of Docker is not that much of a complicated task. As CentOS is used for the Server, the Docker on CentOS can be a deadly combination. You have to just provide a series of commands to Install Docker on CentOS. The CentOS Terminal is itself sufficient enough to get your job done.

This article will focus on the Installation Steps of Docker on CentOS without having any kind of issues. So, let us start our discussion.

Know more about CentOS here, and how to install CentOS

How to Install Docker on CentOS?

To Get Docker on CentOS 7, the installation steps are divided into some sections. Let us first check the Downloading & Installation of Docker on CentOS 7, 8.

Section 1: Installation of Docker on CentOS

Step 1: Update the current packages with the help of the following command on CentOS Terminal.

yum update

1--Update

Step 2: Make ready the dependencies with the help of the following command. It will be used to download the Docker on the terminal.

yum install -y yum-utils device-mapper-persistent-data lvm2

2--Dependiencies-Ready

Step 3: The repository will be used to Download Docker on CentOS. For that purpose, the below-mentioned command should be used.

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

3--Repository-Ready

Step 4: At last, the following command will lead to the installation of Docker on CentOS.

yum install docker

4--Install

Section 2: Configuring Docker Service on CentOS

Step 1: Execute the following command to run the service. The Docker is installed but the service is not started yet. The below command will do it.

systemctl start docker

5--Start-Service

Step 2: Now, the command will be used to check the status. If the installation & all command execution is successful, the Active Message will arrive.

systemctl status docker

6--Status

These above-mentioned steps are enough to Get Docker on CentOS. Execute the commands one by one there to Download & Install Docker CentOS. However, after successful installation, don’t forget to Start Docker on CentOS. Without starting, the CentOS Docker Service will not be executed.

Also Read

Frequently Asked Questions to Install Docker on CentOS

How to install Docker on CentOS?

To install Docker on CentOS, the following commands should be used properly.

  1. Execute the command yum update in the Root Menu.
  2. Run the command yum install -y yum-utils device-mapper-persistent-data lvm2 for dependencies.
  3. Execute the command yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo
  4. Run the command yum install docker.

How to start the Docker Service on CentOS 7?

To start the Docker Service on CentOS 7, the following steps should be executed.

  1. Open CentOS Terminal.
  2. Execute the command systemctl start docker
  3. Check the Active status by the command systemctl status docker

How do I know if Docker is installed on CentOS 8?

To know the Docker is already installed on the CentOS 8, the command docker -v can be used. If the Docker is present, then the version of the docker will be available. Otherwise, there will be an error message executed on the Terminal.



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads