How to install Docker on CentOS 7.x

How to install Docker on CentOS 7.x

Docker is free and open-source software. Docker is a platform for developers and sysadmins to develop, deploy, and run applications with containers. The use of Linux containers to deploy applications is called containerization. Containers are not new, but their use for easily deploying applications is.

Containerization is increasingly popular because containers are:

  • Flexible: Even the most complex applications can be containerized.
  • Lightweight: Containers leverage and share the host kernel.
  • Interchangeable: You can deploy updates and upgrades on-the-fly.
  • Portable: You can build locally, deploy to the cloud, and run anywhere.
  • Scalable: You can increase and automatically distribute container replicas.
  • Stackable: You can stack services vertically and on-the-fly.

Docker is container-based application framework, which wrap of a specific application with all its dependencies in a container. Docker containers can easily to ship to a remote location on start there without making entire application setup. This post will help you to How to install Docker on CentOS 7.x.

Prerequisites

64-bit CentOS 7
Non-root user with sudo privileges.

Note: Docker requires a 64-bit version of CentOS 7 as well as a kernel version equal to or greater than 3.10. The default 64-bit CentOS 7 Droplet meets these requirements.

All the commands in this tutorial should be run as a non-root user. If root access is required for the command, it will be preceded by sudo.

To install Docker on your CentOS 7 server follow the steps below:

  • Start by updating your system packages and install the required dependencies:
~]$ sudo yum update
~]$ sudo yum install yum-utils device-mapper-persistent-data lvm2
yum-update
yum-update
  • Next, run the following command which will add the Docker stable repository to your system:
~]$ sudo yum-config-manager --add-repo
https://download.docker.com/linux/centos/docker-ce.repo
  • Now that the Docker repository is enabled, install the latest version of Docker CE (Community Edition) using yum by typing:
~]$ sudo yum install docker-ce
  • Once the Docker package is installed, start the Docker daemon and enable it to automatically start at boot time:
~]$ sudo systemctl start docker
~]$ systemctl enable docker
  • To verify that the Docker service is running type:
~]$ sudo systemctl status docker
  • At the time of writing, the current stable version of Docker is, 18.06.1, to print the Docker version type:
~]$ docker -v

Hopefully “How to install docker on CentOS 7.x”, this will helps your understanding. More post related to Docker

Tagged , , , . Bookmark the permalink.

Comments are closed.