Search The Hostwinds Guides Knowledge Base

How to install Docker (CentOS 7)

Share This Article [TheChamp-Sharing]

Docker is a popular open-source container management system for cloud computing needs. Containers are similar to the virtual machines we offer, but there are key differences. Unlike a virtual machine, a container is not installed with a guest operating system, such as Linux or Windows Server. Instead, it is packaged with the application or component of the application along with any dependencies needed for it to run in its own self-contained runtime.

Docker is a great container management system, as it allows you to run different components of an application in separate containers, such as your web server, database server, and file storage system. You are able to run multiple containers on one VPS or dedicated server. Containers are also highly portable, making it easy to move them between servers or deploy them to our cloud hosting environment as needed with little delay.

In this guide, we will walk you through how to install Docker on CentOS 7.

How to Install and Run Docker

Before beginning the steps below, log into your Hostwinds CentOS 7 server using SSH, and make sure your operating system is up-to-date.

Step One –  Install the required packages for Docker to run. Run the following command.

sudo yum install -y yum-utils device-mapper-persistent-data lvm2


Step Two – Add the stable repository

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo


Step Three – Install the latest version of Docker.

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

Note: If the OS prompts for a GPG key, check Docker’s documentation for the fingerprint.


Step Four – Start Docker

sudo systemctl start docker

You can also check that Docker is running with the command

sudo systemctl status docker

The output should show active (running).

You are now ready to start running containers. You can go to Docker Hub to create, manage, and download containers for various applications.

Related Articles: