Installing Docker on CentOS 7

Govind Bhardwaj
2 min readJul 24, 2019

Linux containers, in short, contain applications in a way that keep them isolated from the host system that they run on. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. And Docker Inc. is the most popular containerizer today. In this post, we’re going to install Docker CLI on a CentOS 7 system.

Uninstall old versions (if any)

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

Installing Docker-CE

SETTING UP THE REPOSITORY:

Install the required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver.

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

Use the following command to set up the stable repository.

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

Installing Docker Engine

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

Start Docker Service

sudo service docker start

Setting up Docker Service on Startup

sudo systemctl enable docker

You can test if docker is installed by using the following command

sudo docker version

If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:

sudo usermod -aG docker $USER

For further references follow the User Guide.

Please show your love by clapping if you found this useful. Follow me on twitter @kumargovind88

That’s all folks! Happy coding…

Follow us on Twitter 🐦 and Facebook 👥 and join our Facebook Group 💬.

To join our community Slack 🗣️ and read our weekly Faun topics 🗞️, click here⬇

If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇

--

--

Govind Bhardwaj

DevOps and Full-Stack Web and Mobile developer, Open-Source enthusiast and part-time guitarist and magician!(sort of) https://govindbhardwaj.github.io