How to install Docker on CentOS 7 machine

Hey, I'm a postgraduate in Cyber Security with practical experience in Software Engineering and DevOps Operations. The top player on TryHackMe platform, multilingual speaker (Kazakh, Russian, English, Spanish, and Turkish), curios person, bookworm, geek, sports lover, and just a good guy to speak with!
Overview:
- CentOS machine based on 7.9.2009(Core) release
- To check the version of the CentOS machine use:
cat /etc/centos-release - Docker community edition is installed
Docker installation and configuration:
- Remove the old version of the Docker from the machine:
sudo yum remove -y docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine - Install prerequisite utility software:
sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 - Install the Docker repository:
sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo - Install the Docker:
sudo yum install -y docker-ce - Start Docker daemon and enable autostartup:
sudo systemctl start docker && sudo systemctl enable docker - Add your current user to the docker group:
sudo usermod -aG docker [username] - For changes to take effect logout from your instance and then log back in
- Check the installed Docker version:
docker version
Reference:
- yum-utils is a collection of tools and programs for managing yum repositories, installing debug packages, source packages, extended information from repositories and administration.
- device-mapper-persistent-data
- LVM2 refers to the userspace toolset that provide logical volume management facilities on linux. It is reasonably backwards-compatible with the original LVM toolset.





