Always refer to the official Docker documentation for the most up-to-date installation instructions.
Prerequisites
| Requirement | Details |
|---|---|
| Operating System | CentOS 7 (x86_64) |
| User Account | A non-root user with sudo privileges |
| Enabled Repository | CentOS Extras |
| Server Access | SSH access to your instance or VM |
1. Remove Older Docker Versions
Before installing Docker CE, remove any legacy packages to prevent conflicts:base, extras, and updates in the list.
Removing old Docker packages will not delete your images or containers stored under
/var/lib/docker, but it’s a good idea to back up any critical data before proceeding.2. Install Dependencies & Configure the Docker Repository
-
Install
yum-utils, which provides theyum-config-managerutility: -
Add the official Docker CE repository:
-
Confirm the new repo is enabled:
docker-ce-stable/x86_64.
3. Install Docker Engine (Docker CE)
Install Docker Engine and its core components:docker-cedocker-ce-clicontainerd.io
4. Start and Enable the Docker Service
-
Check the Docker service status:
-
If it’s not running, start and enable it to launch on boot:
-
Re-check to ensure Docker is active:
5. Verify Your Docker Installation
-
Check Docker version:
Sample output:
-
View detailed client/server info:
-
Display full system information: