Cloud Native 2 min read

How to Install Docker on CentOS 7

This guide provides step‑by‑step instructions for installing Docker Engine on a CentOS 7 system, including removal of any existing Docker packages, adding the Alibaba Cloud yum repository, installing required utilities, starting and enabling the Docker service, and verifying the installation.

Full-Stack Internet Architecture
Full-Stack Internet Architecture
Full-Stack Internet Architecture
How to Install Docker on CentOS 7

Docker is essential, and this article explains how to install it on a CentOS 7 environment.

1. Uninstall any existing Docker packages:

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

2. Install yum-utils to manage repositories:

sudo yum install -y yum-utils

3. Add the Docker yum repository (recommended Alibaba Cloud mirror for faster download):

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

4. Install Docker Engine, CLI, and containerd:

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

5. Start Docker service and enable it to start on boot:

sudo systemctl start docker
sudo systemctl enable docker

6. Verify the installation by checking the Docker version and detailed information:

docker -v
docker info

Additional note: The article also includes a daily motivational quote and a recommendation link, but the core content focuses on the Docker installation steps.

DockerLinuxContainerInstallationCentOS
Full-Stack Internet Architecture
Written by

Full-Stack Internet Architecture

Introducing full-stack Internet architecture technologies centered on Java

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.