How to install Docker CE on CentOS 8

Step 1 : The centos-extra repository must be enabled. This is usually enabled by default, but if you disabled it, please enable it again.

Step 2 : Previously, the Docker package had a different name: It was called docker or docker-engine; it is now called docker-ce. We will need to remove any previous Docker versions in order to prevent any conflicts.

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

It is OK if yum reports that none of these packages are installed.

Step 3 : Install the required packages.

sudo yum install -y yum-utils \
          device-mapper-persistent-data \

Step 4 : Set up the Docker yum repository using the stable channel

sudo yum-config-manager \
          --add-repo \

Step 5 : Optional: Enable the test channel for access to the nightly builds.

sudo yum-config-manager --enable docker-ce-test

Step 6 : Install the latest version of docker-ce.

sudo yum install --nobest docker-ce

Step 7 : To continue, type Y, and press Enter

Step 8 : Start the Docker daemon

sudo systemctl start docker

Step 9 : Verify that the installation worked.

docker container run hello-world

Add Comment