How To Install Docker On Fedora 32 Or 31 (And Alternatives)

Fedora logo

[[Edit]] Docker 20.10 has added support for cgroups v2 and firewalld, so this article is obsolete. For how to install Docker on Fedora, see the official documentation.

Fedora 31 switched to cgroup v2, being the first major Linux distribution to do so. Docker doesn't support cgroup v2 though, so it doesn't work on the latest Fedora release. This article explains your options, and how to install Docker on Fedora 31 if you don't like the alternatives. [[Edit] This was originally for Fedora 31, but everything in this article also applies for Fedora 32; there's no Docker CE repository for Fedora 32, but we'll use the Fedora 31 repository instead.

cgroup (control group) is a Linux kernel feature that organizes processes hierarchically and distributes system resources along the hierarchy in a controlled and configurable manner. cgroup v2 first appeared in Linux kernel 4.5, and unlike v1, it only has a single process hierarchy and discriminates between processes, not threads. I recommend reading this article on Fedora 31 and control group v2.

Since Fedora 31 (and Fedora 32) switched to cgroups v2, Docker no longer works. For example, this error pops up on my Fedora 31 system when trying to run a container using Docker:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"open /sys/fs/cgroup/docker/cpuset.cpus.effective: no such file or directory\"": unknown.

On Fedora 32 I get this error instead:

docker: Error response from daemon: cgroups: cgroup mountpoint does not exist: unknown.

So what can you do now that Fedora 32 and 31 use cgroups v2, and Docker no longer works? You'll find some options below, including a workaround for installing Docker CE. As usual, all instructions were tested before posting them on Linux Uprising.

Option #1: Use Podman instead of Docker on Fedora 32 or 31


Pod Manager tool (podman) is a RedHat-backed cgroup v2-compatible container engine that implements almost all the Docker CLI commands, and doesn't require a daemon to run containers and pods. This is the Fedora recommended option.

Podman is installed by default on Fedora 32 and 31 so there's nothing you need to do to use it. Just run podman instead of docker, e.g.:

podman run --rm hello-world:latest

Option #2: Switch to cgroup v1, install and use Moby Engine or Docker CE on Fedora 32 or 31


Switch to cgroup v1.


Besides using Podman (option #1), you have the option of switching your Fedora 32 or 31 system to cgroup v1, by passing the kernel parameter systemd.unified_cgroup_hierarchy=0.

This can be done (permanently) from the command line as follows:

sudo dnf install grubby

sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"

After this, reboot your system and you'll now have the option of using either moby-engine (includes Docker CLI and the Docker Engine) or Docker CE.

In case you want to undo this change this later, pass the kernel parameter systemd.unified_cgroup_hierarchy without an argument or with true as an argument. This re-enables the usage of unified cgroup hierarchy (cgroup v2), e.g.:

sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy"

Use moby-engine instead of Docker.


Docker has been removed from Fedora 32 and 31, being replaced by moby-engine (both don't yet support cgroups v2 though). In case you're not familiar with Moby and its relationship with Docker, I recommend reading this article.

To install moby-engine (includes Docker CLI and the Docker Engine) on Fedora 32 or 31, enable and start its daemon, use:

sudo dnf install moby-engine

sudo systemctl enable --now docker

You may also want to add your user to the docker group so you don't have to run it with super user privileges:

sudo usermod -aG docker $(whoami)

After this you'll need to reboot your system in order to use moby-engine without super user privileges (e.g. sudo).

You can now use moby-engine like Docker, e.g.:

docker run --rm hello-world:latest

You might also like: LazyDocker: New Docker And Docker Compose Terminal UI

Just show me how to install Docker CE on Fedora 32 or 31.


Like moby-engine, Docker Engine - Community doesn't support cgroup v2, so switch to cgroup v1 as explained above before proceeding.

If you want to install use Docker CE, remove moby-engine in case you installed it previously:

sudo dnf remove moby-engine

Now you can add the Docker CE Fedora repository:

  • For Fedora 31:
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo

  • For Fedora 32 (there's no Docker CE repository for Fedora 32, so we'll use the Fedora 31 repo):
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo

sudo sed -i 's/$releasever/31/g' /etc/yum.repos.d/docker-ce.repo

Now you can install Docker CE on both Fedora 32 and 31 (this will also install docker-ce-cli and containerd.io), enable and start its daemon:

sudo dnf install docker-ce

sudo systemctl enable --now docker

You may also want to add your user to the docker group so you don't have to run Docker with super user privileges:

sudo usermod -aG docker $(whoami)

After this you'll need to reboot your system in order to use Docker without super user privileges (e.g. sudo).

Extra step for Fedora 32: fix network inside Docker containers using (from here - this mentions that on Fedora 32, pinging any destination works from inside a Docker container, however tcp/udp connections don't work, but for me pinging didn't work either before this):

firewall-cmd --permanent --zone=trusted --add-interface=docker0

firewall-cmd --reload

Extra sources (besides the ones already linked in the article):