Installing Docker and Docker-Compose

Bradley G Smith, Versi F40,F41,rawhide Last review: 2024-11-13

This page discusses third-party software sources not officially affiliated with or endorsed by the Fedora Project. Use them at your own discretion. Fedora recommends the use of free and open source software and avoidance of software encumbered by patents.

Overview

This guide provides useful information about installing Docker and Docker-Compose using rpms available from Fedora. The role of Podman and related packages is also discussed.

The Docker community also provides rpms for Fedora. For instructions on how to install these rpms please see Install Docker Engine on Fedora.

What is Docker?

Docker accelerates "how you build, share, and run applications" by providing an easy to use and configure mechanism to develop and run containers.

This guide is primarily focused on the Docker rpms available from Fedora and using dnf and the command line to install these rpms on Fedora.

What is Docker-Compose?

Docker-Compose (referred to as Compose below) is software that enables users to easily manage multi-container applications or multiple applications on a single instance of Docker.

Version 1 of Compose was deployed as a stand-alone application called docker-compose. Version 2 (the current version) is available as a plug-in to the docker command and launched as docker compose [options].

Docker on Fedora 41 (and newer)

The Docker related rpms in Fedora 41 and newer are listed in the table below. The corresponding rpm names from the Docker community are also listed for comparison. Mixing rpms from Docker with Fedora provided rpms is not recommended and may be blocked by dnf.

Tabel 1. Docker rpms in Fedora 41 (and newer) compared to rpms from Docker community.
Fedora RPM Name Docker RPM Name Notes

containerd

containerd

Container runtime

docker-buildx

docker-buildx-plugin

Docker buildx plug-in

docker-cli

docker-ce-cli

Docker command line client, i.e. docker

docker-compose

docker-compose-plugin

Compose v2 implemented as a plug-in

docker-compose-switch

n/a - See compose-switch for installation instructions

Provides command line docker-compose that works with Compose v2

moby-engine

docker-ce

Server component for Docker

Installation

In order to get docker on the command line, use the command below. This will also install appropriate dependencies.

sudo dnf install docker-cli containerd

In order to get Compose as a plug-in use the command below. This will also install appropriate dependencies. This provides Compose v2 features and capabilities.

sudo dnf install docker-compose

In order to get docker-compose on the command line, use the command below. This will also install appropriate dependencies. This provides Compose v2 features and capabilities.

sudo dnf install docker-switch

Podman Alternatives

Podman is a powerful and feature complete application that can be used instead of Docker. The instructions below are limited to only those that provide the docker and/or docker-compose commands. Please visit Podman to learn more about Podman capabilities and benefits.

In order to get docker on the command line, use the command below. This will also install appropriate dependencies. This will conflict with docker-cli.

sudo dnf install podman-docker

In order to get Compose as a plug-in use the command below. This will also install appropriate dependencies. This provides Compose v2 features and capabilities.

sudo dnf install podman docker-compose

In order to get docker-compose on the command line, use the command below. This will also install appropriate dependencies. This provides Compose v2 features and capabilities.

sudo dnf install podman docker-switch

Fedora 40

The Docker related rpms in Fedora 40 are listed in the table below. The corresponding rpm names from the Docker community are also listed for comparison. Mixing rpms from Docker with Fedora provided rpms is not recommended and may be blocked by dnf.

Tabel 2. Docker rpms in Fedora 40 compared to rpms from Docker community.
Fedora RPM Name Docker RPM Name Notes

containerd

containerd

Container runtime

n/a

docker-buildx-plugin

Docker buildx plug-in

docker-cli

docker-ce-cli

Docker command line client, i.e. docker

docker-compose

docker-compose

Compose v1

moby-engine

docker-ce

Server component for Docker

Installation

In order to get docker on the command line, use the command below. This will also install appropriate dependencies.

sudo dnf install docker-cli containerd

In order to get docker-compose on the command line, use the command below. This will also install appropriate dependencies. This provides Compose v1 features and capabilities.

sudo dnf install docker-compose

Podman Alternatives

Podman is a powerful and feature complete application that can be used instead of Docker. The instructions below are limited to only those that provide the docker and/or docker-compose commands. Please visit Podman to learn more about Podman capabilities and benefits.

In order to get docker on the command line, use the command below. This will also install appropriate dependencies. This will conflict with docker-cli.

sudo dnf install podman-docker

In order to get docker-compose on the command line, use the command below. This will also install appropriate dependencies. This provides Compose v1 features and capabilities.

sudo dnf install podman docker-compose