Welcome to our guide on how to install Docker CE on Fedora 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 Linux system.

Step 1: Update your system

Before we install Docker on Fedora 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 Docker CE repository

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

sudo dnf -y install dnf-plugins-core

Fedora 42:

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/42/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
EOF

Fedora 41:

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/41/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
EOF

Fedora 40:

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/40/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
EOF

Fedora 39:

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/39/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
EOF

Step 3: Install Docker on Fedora

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

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

Press the y key when prompted to start the installation.

....
Transaction Summary
======================================================================================================================================================================================================
Install  20 Packages

Total download size: 91 M
Installed size: 355 M
Is this ok [y/N]: y

And accept to import GPG key:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                  57 MB/s |  91 MB     00:01
Docker CE Stable - x86_64                                                                                                                                              19 kB/s | 1.6 kB     00:00
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 using the following command:

 systemctl status docker

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
Docker version 28.1.1, build 4eba377

$ docker compose version
Docker Compose version v2.35.1

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
df9b9388f04a: Pull complete
Digest: sha256:4edbd2beb5f78b1014028f4fbb99f3237d9561100b6881aabbf5acce2c4f9454
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest

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

$ docker run -it --rm alpine /bin/sh
/ # apk update
/ # exit

Below is a bonus table with plenty of Docker and Compose CLI commands:

CommandDescription
Docker Commands
docker versionCheck Docker version and information
docker infoDisplay Docker system-wide information
docker pull <image>Pull an image from a registry
docker run <image>Run a container from an image
docker psList running containers
docker ps -aList all containers (including stopped ones)
docker stop <container>Stop a running container
docker rm <container>Remove a container
docker imagesList local images
docker rmi <image>Remove an image
docker exec -it <container> <command>Execute a command in a running container interactively
docker logs <container>Fetch the logs of a container
Docker Compose Commands
docker-compose upStart services defined in docker-compose.yml
docker-compose downStop and remove containers, networks defined in docker-compose.yml
docker-compose logsView output from containers
docker-compose psList containers
docker-compose exec <service> <command>Execute a command in a running service container
docker-compose buildBuild or rebuild services
docker-compose restart <service>Restart services
docker-compose stop <service>Stop services

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

To setup a Docker registry, check our guide on how to:

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

For easy monitoring, you can use:

For installation of Docker on other systems, use:

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here