Quick install of Docker on CentOS 7  Print this Article

OS requirements

This article assumes you have a clean server.
To install Docker CE, you need a maintained version of CentOS 7.
Archived versions aren’t supported or tested.
The centos-extras repository is required.
The overlay2 storage driver is recommended.

Setup the repository

Before you install Docker CE for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository. Install 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 -y yum-utils device-mapper-persistent-data lvm2
$ sudo yum-config-manager --add-repo


$ sudo yum install docker-ce docker-ce-cli

Start Docker.

$ sudo systemctl start docker

Verify that Docker CE is installed correctly by running the hello-world image.

$ sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits. Docker CE is installed and running.

Was this answer helpful?

Related Articles

Install PHP 7, NGINX & MySQL 5.6 on CentOS/RHEL 7.1 & 6.7
CentOS / RHEL 7 # yum install epel-release # rpm -Uvh...
Install Fail2Ban on CentOS 7
To install Fail2Ban on CentOS 7, we will have to install EPEL (Extra Packages for Enterprise...
Optimize Apache on CentOS 7
Introduction Apache is a powerful and capable open-source web server, designed to provide a...
Setup WordPress on CentOS 7/Fedora 2x with MySQL 5.6 and PHP5.6
In this article we will setup WordPress from scratch in just a few easy steps. I will use a...
Getting started with Ansible on CentOS 6
What is Ansible? Long story short, Ansible is a tool which helps server administrators...