How to install Docker in Fedora?

Docker is a platform that makes it easier to create, deploy, and use an application using containers. A container contains an application with all parts of it needed such as libraries and other dependencies, and ships it as one package.

Instead of using dedicated resources like virtual machines, docker shares kernel, and other resources of the host system. There are two versions of Docker: Docker CE(Community Edition), Docker EE (Enterprise Edition). Docker CE is a community-supported version available for free use. You can use it for small-scale projects or learning.

This article describes how to install and use Docker CE on Fedora Linux.

How to install Docker CE in Fedora

Before the installation of Docker on your system refresh the local package repository and upgrade all pending packages by using the given command –

sudo dnf update && sudo dnf upgrade

Next, you need to set up the repository for installing and updating the Docker in Fedora. Install the dnf-plugins-core package this will provide you commands to manage your DNF repositories –

sudo dnf -y install dnf-plugins-core

Now use the following command to set up the Docker stable repository on your system –

sudo dnf config-manager --add-repo

Update package’s metadata cache by using –

sudo dnf makecache

Finally, install the Docker CE in Fedora by using –

sudo dnf -y install docker-ce

Start and enable Docker services in Fedora

Once the installation is completed, use the following command to start docker services on your system.

sudo systemctl start docker.service

If you want docker to automatically start when the system boots then enable it by using –

sudo systemctl enable docker.service

Check the status of Docker services on your system

You can check the status of docker services on your system by using the given command –

sudo systemctl status docker.service

docker service status

Test the docker with hello-world container

You can test the docker by running the hello-world container on Fedora. Use the following command in your terminal to run it–

sudo docker run hello-world

If the hello-world container is available locally you will see the following output otherwise first it will pull and then display the given output in your terminal.

docker hello world container

If the message appears like given in the image above it means the docker installed in your system is working correctly.

If you want to run the docker command without sudo, you need to add your username to the docker group. You can use the following command to add a user to the docker group –

sudo usermod -aG docker {username}

For example –

sudo usermod -aG docker lalit

Now log out and re-login or use the following command to apply the membership of the user.

su {username}

This will ask the password of the current user, enter it. Now you can run the docker command without sudo.

You can also read how to install Docker in Ubuntu if you want to know how to install and use Docker.


If you want to know more about the options and commands that can be used with the docker then run docker command without any argument. This will display the complete list of options and commands. You can also see its manual page by executing man docker in the terminal.

Leave a Comment