How To Install Docker on RHEL 7 / CentOS 7

Posted on 157 views

How to Install Docker on RHEL 7?. Docker CE installation on RHEL 7?. Containers have revolutionized Applications deployment and massive scalability of microservices. Docker was a game-changer, simplifying the process of running and managing applications in containers. This article will guide you through the installation of Docker on RHEL 7.

For CentOS 7, check Docker Installation on CentOS 7

Step 1: Register your RHEL 7 server

Start by registering your RHEL 7 server with Red Hat Subscription Management or Satellite server.

sudo subscription-manager register --auto-attach

Input your username and password when prompted.

Step 2: Enable required repositories

After registering the system, enable RHEL 7 repositories which have Docker packages and dependencies.

sudo subscription-manager repos --enable=rhel-7-server-rpms \
  --enable=rhel-7-server-extras-rpms \

Step 3: Install Docker on RHEL 7 Server / Desktop

We can now Install Docker on RHEL 7 by running the commands below.

sudo yum install -y docker device-mapper-libs device-mapper-event-libs
sudo systemctl enable --now docker.service

Confirm service status.

$ systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2019-07-14 17:10:51 EDT; 22h ago
  Process: 10603 ExecReload=/bin/kill -s HUP $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 11056 (dockerd-current)
    Tasks: 46
   Memory: 156.8M
   CGroup: /system.slice/docker.service

Step 4: Set insecure registries / Block registries

If you have local Docker registries without SSL encryption for access, you may need to whitelist them.

$ sudo vi /etc/containers/registries.conf
registries = ["",""]

To block access to a registry, add the registry URL under registries.block section.

registries = ['']

Restart docker service if you make a change to the configuration file.

sudo systemctl restart docker

Test Docker installation.

# docker pull hello-world
Using default tag: latest
Trying to pull repository ... 
Pulling repository
Trying to pull repository ... 
latest: Pulling from
1b930d010525: Pull complete 
Digest: sha256:6540fc08ee6e6b7b63468dc3317e3303aae178cb8a45ed3123180328bcc1d20f
Status: Downloaded newer image for

# docker run --rm hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:

For more examples and ideas, visit:

You now have Docker installed on RHEL 7 system. Happy containerization.


Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.