Hostwinds Tutorials

Search results for:

Table of Contents

How to Install and Run Docker

How to install Docker on CentOS 7

Tags: CentOS Web Panel 

How to Install and Run Docker

Docker is a popular open-source container management system for any cloud computing needs. Docker containers are similar to the virtual machines we offer, but there are few 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 and any dependencies needed to run in its own self-contained runtime.

Docker is a great container management system. 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 can 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

Note: 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 1: Install the required packages for Docker to run. Run the following command.

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

Step 2: Add the stable repository.

sudo yum-config-manager --add-repo

Step 3: Install the latest version of Docker.

sudo yum install docker-ce docker-ce-cli

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

Step 4: 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.

Written by Sean Gaddis  /  February 20, 2020