You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

How to Install Docker CE on Ubuntu / Debian / Fedora / Arch Linux and CentOS Linux systems ?. As of this article writing there are two main editions of Docker – Docker CE ( Community Edition) and Docker EE ( Enterprise edition). This article will be focused in the installation of Docker CE on various distributions of Linux operating system.

Docker is a container runtime engine which allows you to package an application with all of its dependencies into a standardized unit for software development.

Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: coderuntimesystem toolssystem libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.

Here we’ll cover installation of Docker CE on Ubuntu, Debian, Fedora, and CentOS and Arch Linux distributions.

Install Docker CE on Ubuntu Linux

Uninstall Old version of Docker. Old versions of docker had the name docker or docker-engine. If you have it installed, first uninstall it.

sudo apt update
sudo apt remove docker docker-engine docker.io 2>/dev/null

The Docker CE package is now called docker-ce. Update the apt package index:

sudo apt update

Install packages to allow apt to use a repository over HTTPS:

sudo apt -y install apt-transport-https ca-certificates curl software-properties-common

Add Docker’s official GPG key:

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

Add stable repository:

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

Install docker ce:

sudo apt update
sudo apt -y install docker-ce docker-ce-cli containerd.io

If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:

sudo usermod -aG docker $USER

Run the command below to see a version of docker installed.

$ Client: Docker Engine - Community
 Version:           20.10.2
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        2291f61
 Built:             Mon Dec 28 16:17:43 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.2
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8891c58
  Built:            Mon Dec 28 16:15:19 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

To get more details about docker, run:

$ docker info

Install Docker CE on Debian Linux system

Update the apt package index:

sudo apt-get update

Install packages to allow apt to use a repository over HTTPS:

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

Add Docker’s official GPG key:

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

Set up the stable repository:

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

Install Docker:

sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io

Install Docker CE on Fedora Linux

Uninstall Older versions of Docker:

sudo dnf remove docker docker-common docker-selinux docker-engine-selinux docker-engine 2>/dev/null

Configure Docker repository:

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

Install Docker CE:

sudo dnf install docker-ce docker-ce-cli containerd.io

Start and enable docker service:

sudo systemctl start docker && sudo systemctl enable docker

Install Docker CE on CentOS Linux

Uninstall old versions:

sudo yum remove docker docker-common docker-selinux docker-engine

Install Prereqs:

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

Setup stable repo:

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

Install Docker CE:

sudo yum -y install docker-ce docker-ce-cli containerd.io

If you get dependency errors, the run:

sudo yum install -y --setopt=obsoletes=0 docker-ce docker-ce-selinux

Start and enable docker service:

sudo systemctl start docker && sudo systemctl enable docker

Install Docker CE on Arch | Manjaro

Install yay:

yay – Best AUR Helper for Arch Linux / Manjaro

Install Docker CE using pacaur:

$ yay -S --noconfirm --needed docker

After installing Docker, you may be interested in:

Install Docker UI manager – Portainer

Ctop – Top command for container metrics

Install and Configure Docker Registry on CentOS 7

Install Docker and Docker Compose on RHEL 8 / CentOS 8

Tags

  • How To Install Docker CE on Ubuntu
  • How To Install Docker CE on Debian
  • Install Docker CE on Arch Linux
  • Install Docker CE on Fedora Linux
  • Install Docker CE on CentOS Linux

As an appreciation for the content we put out,
we would be thrilled if you support us!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

LEAVE A REPLY

Please enter your comment!
Please enter your name here