Linux

How To Install Docker On Linux Operating System

How To Install Docker On Linux Operating System

Insight: How To Install Docker On Linux Operating System

What Is Docker?

Docker is a popular tool to develop, deploy and execute an applications with the help of containers. It is like a virtual machine but not fully a VM.

 

Today, We are going to show you the steps to install docker on Linux based operating systems.

How To Install Docker On Linux Operating System

Install Docker on Ubuntu

Run this command if you have older version of Docker installed in Ubuntu:

sudo apt --purge autoremove docker docker-engine docker.io containerd runc

Run the following command to install prerequisites.

sudo apt update && sudo apt install software-properties-common gnupg2 curl ca-certificates apt-transport-https

Import Docker’s official GPG key with the following command:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add

Now, add the Docker repo in Ubuntu:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Now, Install Docker on Ubuntu:

sudo apt-get update
sudo apt-get install docker-ce

How to Install Docker on Arch Linux

Good news is that Docker is already available in the community repos of Arch Linux. Run the following command to install Docker on Arch:

sudo pacman -S docker

To enable Docker to automatically start at boot time.

sudo systemctl enable docker

To start the Docker service.

sudo systemctl start docker

How to Install Docker on Fedora

At first, Install prerequisites.

sudo dnf install dnf-plugins-core

Run the following command to add Docker software repository.

sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo

Install Docker on Fedora:

To start Docker.

sudo systemctl start docker.service

How to Install Docker on Debian

Run the following  command to install prerequisites:

sudo apt update && sudo apt install software-properties-common apt-transport-https ca-certificates curl gnupg2

Add GPG key:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

Add Docker into the repository:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"

Install Docker on Debian:

sudo apt update && sudo apt install docker-ce

How to Install Docker on CentOS

Run the following command to install the required packages:

$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2

Add the Docker stable repository to your system:

$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Now, Install Docker on Centos:
$ sudo yum install docker-ce

Start the Docker daemon and make it start automatically  at boot time:

sudo systemctl start dockersudo systemctl enable docker

Verify that the Docker service is running: