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

Welcome to our guide on how to install Docker CE on Fedora 32/31/30 Linux distribution. The release of Docker we’ll install is Docker Community Edition (CE). Docker is a leading container runtime engine that allows you to package your applications with all of its dependencies into a standardized unit for software development.

Follow the steps below to install Docker CE on Fedora 32/31/30 Linux system.

Step 1: Update your system

Before we install Docker on Fedora 32/31/30 Linux machine, we’ll start our installations by updating and upgrading OS packages. On Fedora, this can be easily done by running the command:

sudo dnf -y update

It is recommended to reboot your system after an upgrade

sudo reboot

Step 2: Add the Docker CE repository to Fedora 32/31/30

After upgrading system packages and rebooting the server, proceed to add Fedora repository to your system:

sudo dnf -y install dnf-plugins-core

Fedora 32:

sudo tee /etc/yum.repos.d/docker-ce.repo<<EOF
[docker-ce-stable]
name=Docker CE Stable - \$basearch
baseurl=https://download.docker.com/linux/fedora/31/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
EOF

Fedora 31/30/29:

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

Step 3: Install Docker CE on Fedora 32/31/30

Now that you have your repository ready, install the latest stable release of Docker CE on your machine by running:

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

Press the y key when prompted to start the installation.

Docker CE Stable - x86_64                                                                                                                6.2 kB/s | 8.9 kB     00:01    
Dependencies resolved.
=========================================================================================================================================================================
 Package                                 Architecture                     Version                                       Repository                                  Size
=========================================================================================================================================================================
Installing:
 containerd.io                           x86_64                           1.2.13-3.1.fc31                               docker-ce-stable                            23 M
     replacing  runc.x86_64 2:1.0.0-102.dev.gitdc9208a.fc31
 docker-ce                               x86_64                           3:19.03.8-3.fc31                              docker-ce-stable                            23 M
 docker-ce-cli                           x86_64                           1:19.03.8-3.fc31                              docker-ce-stable                            39 M
Installing dependencies:
 libcgroup                               x86_64                           0.41-22.fc31                                  fedora                                      65 k

Transaction Summary
=========================================================================================================================================================================
Install  4 Packages

Total download size: 85 M
Is this ok [y/N]: y

And accept to import GPG key:

Total                                                                                                                                    1.7 MB/s |  85 MB     00:50     
warning: /var/cache/dnf/docker-ce-stable-abb13ee9a85fa8f6/packages/containerd.io-1.2.13-3.1.fc31.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Docker CE Stable - x86_64                                                                                                                1.4 kB/s | 1.6 kB     00:01    
Importing GPG key 0x621E9F35:
 Userid     : "Docker Release (CE rpm) <[email protected]>"
 Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
 From       : https://download.docker.com/linux/fedora/gpg
Is this ok [y/N]: y

Docker will be installed but not started. To start the docker service, run:

sudo systemctl enable --now docker

You can check status with:

$ systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2020-04-11 07:40:43 EAT; 18s ago
Docs: https://docs.docker.com
Main PID: 110574 (dockerd)
Tasks: 16
Memory: 94.4M
CPU: 414ms
CGroup: /system.slice/docker.service
└─110574 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Apr 11 07:40:42 myfed.localhost dockerd[110574]: time="2020-04-11T07:40:42.495248159+03:00" level=warning msg="Your kernel does not support cgroup rt period"
Apr 11 07:40:42 myfed.localhost dockerd[110574]: time="2020-04-11T07:40:42.495258892+03:00" level=warning msg="Your kernel does not support cgroup rt runtime"
Apr 11 07:40:42 myfed.localhost dockerd[110574]: time="2020-04-11T07:40:42.495303222+03:00" level=warning msg="Unable to find blkio cgroup in mounts"
Apr 11 07:40:42 myfed.localhost dockerd[110574]: time="2020-04-11T07:40:42.496229752+03:00" level=info msg="Loading containers: start."
Apr 11 07:40:43 myfed.localhost dockerd[110574]: time="2020-04-11T07:40:43.186309804+03:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.>
Apr 11 07:40:43 myfed.localhost dockerd[110574]: time="2020-04-11T07:40:43.442573424+03:00" level=info msg="Loading containers: done."
Apr 11 07:40:43 myfed.localhost dockerd[110574]: time="2020-04-11T07:40:43.508370327+03:00" level=info msg="Docker daemon" commit=afacb8b7f0 graphdriver(s)=overlay2 ver>
Apr 11 07:40:43 myfed.localhost dockerd[110574]: time="2020-04-11T07:40:43.508940967+03:00" level=info msg="Daemon has completed initialization"
Apr 11 07:40:43 myfed.localhost dockerd[110574]: time="2020-04-11T07:40:43.547750478+03:00" level=info msg="API listen on /run/docker.sock"
Apr 11 07:40:43 myfed.localhost systemd[1]: Started Docker Application Container Engine.

The docker group is created, but no users are added to the group. Add your user to this group to run docker commands without sudo.

sudo usermod -aG docker $(whoami)
newgrp docker

Logout and Login again to use Docker without sudo. The version of Docker installed can be checked with:

$ docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b7f0
 Built:             Wed Mar 11 01:27:05 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b7f0
  Built:            Wed Mar 11 01:25:01 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

This shows both Client and Engine versions.

Step 4: Pull Test docker image

The last step is to test your installation by downloading a test docker container.

$ docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
8e402f1a9c57: Pull complete 
Digest: sha256:644fcb1a676b5165371437feaa922943aaf7afcfa8bfee4472f6860aad1ef2a0
Status: Downloaded newer image for alpine:latest

Verify that Docker CE is installed correctly by running the alpine image.

$ docker run -it --rm alpine /bin/sh
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
v3.9.2-1-g592d872fb8 [http://dl-cdn.alpinelinux.org/alpine/v3.9/main]
v3.9.2-2-ge7dc3349a9 [http://dl-cdn.alpinelinux.org/alpine/v3.9/community]
OK: 9754 distinct packages available
/ # exit

That’s all. You now have Docker running on your Fedora system. The next reading is:

Install and Use Docker Compose on Fedora

To setup a Docker registry, check our guide on how to Install and Use Docker Registry on Fedora.

Please check our guide on managing Docker containers through a web interface:

Install Docker UI manager – Portainer

For easy monitoring, you can use Ctop – Top command for container metrics

For installation of Docker on other systems, use:

How to install Docker CE on Ubuntu / Debian / Fedora / Arch / CentOS

Don’t forget to check other Fedora articles available on our website.

How to Install Apache Tomcat 9 on CentOS 7 / Fedora

How to Install Django on Fedora

How to install LAMP Stack on Fedora

Install and Configure phpMyAdmin on Fedora

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