We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – How To Install Docker CE on Linux Systems

Learn how to – How To Install Docker CE on Linux Systems.

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.

1) 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 lsb-release gnupg 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 gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg

Add stable repository:

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

Install docker ce:

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin

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
newgrp docker

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

$ docker version
Client: Docker Engine - Community
 Version:           23.0.6
 API version:       1.42
 Go version:        go1.19.9
 Git commit:        ef23cbc
 Built:             Fri May  5 21:18:13 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          23.0.6
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.19.9
  Git commit:       9dbdbd4
  Built:            Fri May  5 21:18:13 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

To get more details about docker, run:

docker info

Check Docker Compose version using the commands:

$ docker compose version
Docker Compose version v2.17.3

2) Install Docker CE on Debian Linux system

Update the apt package index:

sudo apt update

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

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

Add Docker’s official GPG key:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/debian.gpg

Set up the stable repository:

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

Install Docker Engine and its dependencies:

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Add your user account to the docker group:

sudo usermod -aG docker $USER
newgrp docker

3) 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 docker-compose-plugin

Start and enable docker service:

sudo systemctl start docker && sudo systemctl enable docker

Add your user account to the docker group:

sudo usermod -aG docker $USER
newgrp docker

4) Install Docker CE on CentOS / Rocky Linux / AlmaLinux

Uninstall old versions:

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

Install required dependencies:

sudo yum -y install 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 docker-compose-plugin

Start and enable docker service:

sudo systemctl start docker && sudo systemctl enable docker

Add your user account to the docker group:

sudo usermod -aG docker $USER
newgrp docker

Check service status:

systemctl status docker

5) Install Docker CE on SLES / OpenSUSE

The OpenSUSE SELinux repository must be enabled.

sles_version="$(. /etc/os-release && echo "${VERSION_ID##*.}")"
opensuse_repo="https://download.opensuse.org/repositories/security:SELinux/SLE_15_SP$sles_version/security:SELinux.repo"
sudo zypper addrepo $opensuse_repo 

Set up the Docker repository

sudo zypper addrepo https://download.docker.com/linux/sles/docker-ce.repo
 sudo zypper install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Start and enable Docker service

sudo systemctl start docker
sudo systemctl enable docker

Add your user account to the docker group:

sudo usermod -aG docker $USER
newgrp docker

6) Install Docker CE on RHEL Server

Add Docker repository

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo

Install Docker CE on RHEL system:

sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Start and enable docker service

sudo systemctl start docker
sudo systemctl enable docker

Add your user account to the docker group:

sudo usermod -aG docker $USER
newgrp docker

7) Install Docker CE on Arch | Manjaro

Install yay:

Install Docker CE using yay:

$ yay -S --noconfirm --needed docker

Add your user account to the docker group:

sudo usermod -aG docker $USER
newgrp docker

After installing Docker, you may be interested in:

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

Cart

Your Cart is Empty

Back To Shop