• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

SMASHING LAB

GUIDES | LINUX | GEEKY STUFF

  • Nginx
  • Linux
  • Guide
  • Ubuntu
  • WordPress
  • Drones, My Hobby

Install Docker in CentOS 7

By Imran Yousaf

For those who want to build and run Docker-containers in CentOS-7 – first of all, it is necessary to install the Docker itself.

To install the latest version of Docker and be able to update it in the future without any problems – it is recommended to install Docker from the official repository.

Tip: Install Docker on Ubuntu 16.04 Xenial Xerus Read More →

In this tutorial, I’ll show you how to install a free Docker CE (Community Edition) in CentOS-7 from a stable official repository, how to make sure that it is installed correctly and that you usually need to do after installation.

Requirements: To install the Docker in CentOS 7 – you must have a 64-bit architecture and a Linux kernel version 3.10 or higher. Having executed archand uname -r, it is possible to check up whether the system corresponds to the given requirements.

Installing the Docker in CentOS-7

Configure a stable Docker repository:

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

Install the Docker:

1
$ sudo yum install docker-ce

Run the Docker:

1
$ sudo systemctl start docker

Make sure that the Docker is installed correctly by running the image hello-world:

1
$ sudo docker run hello-world

Tip: Docker has been successfully installed! It’s time to launch the first Docker-container! Read More →

Post-Installation Steps

After installing the Docker, you need to do a few more things.

First of all, you need to configure the automatic launch of the Docker daemon when the system boots.

Run the following command to add the Docker to startup:

1
$ sudo systemctl enable docker

And secondly, so that each time you dockerdo not type a command sudo, add your user to the group docker:

1
$ sudo usermod -aG docker $ USER

Information: To end the user’s binding to the group, log out and log back in.

To make sure that you can run dockerwithout sudo, run:

1
$ docker run hello-world

 

Some more articles you might also be interested in …

  • How to install LAMP on CentOS 8
  • How to install Nextcloud on CentOS 8
  • Deploy Your First Docker Container
  • Installing (upgrading) PHP 7.2 in CentOS 7
  • How to Disable Iptables Firewall in CentOS
  • How to add a Service to Startup in Ubuntu or CentOS
  • How to install Zabbix on openSUSE Leap 15.1
  • How to Install Brackets on Debian / Ubuntu
  • Guide How to Install Apache in Ubuntu 18.04
  • How to Install LAMP on openSUSE Leap 15.1
Tweet
Pin
Share1
1 Shares

Filed Under: CentOS, Docker, Guide

Primary Sidebar

  • Twitter
  • Facebook
  • Google+

Recent Posts

  • How to install Nextcloud on CentOS 8
  • How to install Zabbix on openSUSE Leap 15.1
  • How to Easily Configure Your Domain’s Email Account with Gmail?
  • Tails 4.4 OS Released with Tor Browser 9.0.6
  • How to Convert JPG to PDF in Linux

Subscribe to our Newsletter

Useful articles, tips and videos about creating and promoting websites to your mail



* required field


  • Contact Us
  • Privacy Policy
  • About Us

Copyright © 2021. Smashing Lab