Cao Yi

How to install Docker on CentOS8


Step 1, Prepare

Update OS

# yum update -y

Install download tool wget

# yum install wget -y

Step 2, Install

To install docker in CentOS 8 is different from other CentOS versions, if you do not install this package manually, the docker service will not work.

Access page and copy the latest version’s link, run the following commands in the new CentOS8:

# wget
# dnf install

The latest version of is till 2020-05-25 Ref:

Step 3, Install docker-ce by yum

# yum install -y yum-utils
# yum-config-manager --add-repo
# yum install docker-ce docker-ce-cli


Step 4, Add user to docker group

The user to user docker needs to add in the docker group.

# gpasswd -a root docker
# newgrp docker

The above example is for root, you can replace it by any other user for docker. If you do not apply this step, you have to use sudo to run docker commands, with non-root user.

Step 5, Enable & Start

# systemctl enable docker
# systemctl start docker

Step 6, Run Hello-World

# docker run hello-world

OK, it’s done.

This artical was originally published to OSC, but I don’t know why it was in censorship.

history on OSC