How ToLinux

How to Install Docker on Linux – A Complete Guide

Find out how to install Docker on Linux to create, deploy and run apps using containers.

Docker is the go-to-tool with which you can securely build, debug and share the apps. It specifically manages the application processes in the containers. Since Docker uses OS level virtualization, it will deliver the software in packages called containers. In other words, Docker is an app that lets the tools and dependencies to be packaged into discrete run time environment. It is easy to configure while the complex apps will be containerized. Using Docker, you can build, share and run apps across any combination of OS, languages, clouds and framework. The article will help you with the procedure to install Docker on Linux PC (Linux Mint, Red Hat Linux, etc) in a step-by-step procedure.

Install Docker on Linux

Techowns Tip: How to Rename a File in Linux [4 Easy Methods]

Steps to Install Docker on Linux

With Linux on your PC, Docker can be installed directly. Before proceeding with the steps, you should log in as a user with Sudo privilege.

(1). Open the terminal on your Linux PC.

(2). To check if you have command line utility support CURL, enter the command line as

$ which curl
  • Note: If CURL isn’t installed, you should update the package manager using the command line
$ sudo apt-get update 
$ sudo apt-get install curl

(3). To get the latest Docker package on Linux PC, use the command line

 $ curl -fsSL | sh

(4). Next, Linux users should add the account to the docker group. It can be done using the command line

$ sudo usermod -aG docker 

(5). You should now log out and then log in back to for the changes to take place.

(6). To verify whether the Docker is installed on Linux, you should run the hello world. Use the command line

$ docker run hello-world
  • Docker is working if you get “This message shows that your installation appears to be working correctly.”

Note: If you get “Cannot connect to the Docker daemon”, you may need to restart the Docker service, then you should restart the docker using the command line

 $ sudo service docker restart

To Install Docker on Ubuntu

If you have Linux PC with Ubuntu Wily, Trusty, or Xenial, you should use the following the section.

(1). The following command line will install kernel package.

$ sudo apt-get update -y && sudo apt-get install -y linux-image-extra-$(uname -r)

(2). To install docker

$ sudo apt-get install docker-engine -y

(3). Start docker using the command

$ sudo service docker start

(4). Check if Docker is installed using

$ sudo docker run hello-world

To Install Docker using Yum

(1). You should log into your system as the user using Sudo privileges.

(2). Update your system, use the command

$ sudo yum update -y

(3). To add yum repo,

$ sudo tee /etc/yum.repos.d/docker.repo 

(4). To install docker,

$ sudo yum install docker-engine -y

(5). Use the command line below to start docker

$ sudo service docker start

(6). To verify the installation of docker,

$ sudo docker run hello-world

Here comes the end of the docker tutorial. Installing docker on Linux PC is that simple and easy.

Share us if you have successfully installed docker on your Linux device in the comments. Visit us on Twitter and Facebook page for updates.

Was this article helpful?

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button