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: code, runtime, system tools, system 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: 24.0.7
API version: 1.43
Go version: go1.20.10
Git commit: afdd53b
Built: Thu Oct 26 09:07:41 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.7
API version: 1.43 (minimum version 1.12)
Go version: go1.20.10
Git commit: 311b9ff
Built: Thu Oct 26 09:07:41 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.24
GitCommit: 61f9fd88f79f081d64d6fa3bb1a0dc71ec870523
runc:
Version: 1.1.9
GitCommit: v1.1.9-0-gccaecfc
docker-init:
Version: 0.19.0
GitCommit: de40ad0
To get more details about docker, run:
docker info
Check Docker Compose version using the commands:
$