how to install Docker on CentOS 8

In this article, we will see how to install Docker on CentOS 8. Docker is available in two versions,

Docker CE (Community Edition)
Enterprise Edition (EE)
In this guide we will learn how to install Docker CE (Community Edition) on CentOS 8 or RHEL 8 Server.

System Requirements for Docker CE:

To install Docker Engine, you need a maintained version of CentOS 7. Archived versions aren’t supported or tested.

Updated Minimal CentOS 8 / RHEL 8
Sudo or root privileges
Internet Connection

SET UP THE REPOSITORY:

Lets verify CentOS verions:

more /etc/os-release

how to install Docker on CentOS 8

1. Install the yum-utils package

sudo yum install -y yum-utils

2. Set up the stable repository.

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

Install Docker Engine

1. Install the latest version of Docker Engine and containerd.

sudo yum install docker-ce docker-ce-cli containerd.io

Type to continue to download.

2. Accept the GPG key, verify that the fingerprint matches

3. Installation successfull.

Docker Post installation steps on CentOS 8:

1. Verify the installed docker version on CentSO 8.

docker -v docker --version

2. Enable the docker to start automatically when CentOS restarts.

3. Check the status of docker.

4. It is not started, then start by running below command.

sudo yum systemctl start docker sudo dnf systemctl start docker

5. After docker started verify docker status on CentOS.

6. Verify docker installed correctly or not on CentOS 8 by running hello-world image.

sudo docker run hello-world

sello from Docker! This message shows that your installation appears to be working correctly.

Leave a Reply

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