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

Docker Compose is a tool used to define and run multi-container Docker applications. The application services are configured using a Compose file. Unlike running docker commands, a single command is all that’s required to create and start all the services from your configuration.

Docker Compose is a great tool for development, testing, and staging environments,
as well as CI workflows. Install it on your Fedora using the steps provided below.

Step 1: Install Docker Engine

Docker Compose requires Docker Engine to be installed on the host system before it can be used. Install Docker on Fedora system using our guide below.

How to install Docker on Fedora

Step 2: Install Docker Compose on Fedora 33/32/31/30

After the Docker Engine has been installed, the next step is the installation of Docker Compose on Fedora 30/29/28. There are two ways you can install Docker Compose on Fedora.

  • Install Docker Compose on Fedora from RPM repository
  • Install from Source binary file

Install Docker Compose on Fedora 33/32/31/30 from the repo

If you would like to install the version of Docker Compose available on Fedora upstream repository, just run the command:

sudo dnf -y install docker-compose

This may not install the most current version of Docker Compose. You can check what is installed using the rpm command.

$ rpm -qi docker-compose
Name        : docker-compose
Version     : 1.22.0
Release     : 2.fc29
Architecture: noarch
Install Date: Tue 04 Dec 2018 08:46:26 PM UTC
Group       : Unspecified
Size        : 977838
License     : ASL 2.0
Signature   : RSA/SHA256, Mon 08 Oct 2018 04:21:11 PM UTC, Key ID a20aa56b429476b4
Source RPM  : docker-compose-1.22.0-2.fc29.src.rpm
Build Date  : Mon 08 Oct 2018 04:18:48 PM UTC
Build Host  : buildvm-13.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : https://github.com/docker/compose
Bug URL     : https://bugz.fedoraproject.org/docker-compose
Summary     : Multi-container orchestration for Docker
Description :
Compose is a tool for defining and running multi-container Docker
applications. With Compose, you use a Compose file to configure your
application's services. Then, using a single command, you create and
start all the services from your configuration.

Install Docker Compose on Fedora from a binary file.

Please check the latest release of Docker Compose on the Official Compose releases page before downloading.

Install wget:

sudo dnf -y install wget

Download latest compose

curl -s https://api.github.com/repos/docker/compose/releases/latest \
  | grep browser_download_url \
  | grep docker-compose-Linux-x86_64 \
  | cut -d '"' -f 4 \
  | wget -qi -

Make the binary file executable.

chmod +x docker-compose-Linux-x86_64

Move the file to your PATH.

sudo mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose

The command above will save the file to /usr/local/bin/docker-compose. Apply executable permissions to the binary:

sudo chmod +x /usr/local/bin/docker-compose

Validate version:

$ docker-compose --version
docker-compose version 1.28.6, build 5db8d86f

Step 3: Configure Compose Command-line completion

Compose comes with command completion for the bash and zsh shell.

For Bash users

Place the completion script in /etc/bash_completion.d/.

sudo curl -L https://raw.githubusercontent.com/docker/compose/master/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose

For Zsh users

Download the completion script in your ~/.zsh/completion/

mkdir -p ~/.zsh/completion
curl -L https://raw.githubusercontent.com/docker/compose/${VER}/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose

Include the directory in your $fpath by adding in ~/.zshrc:

fpath=(~/.zsh/completion $fpath)

Make sure compinit is loaded or do it by adding in ~/.zshrc:

autoload -Uz compinit && compinit -i

Then reload your shell:

exec $SHELL -l

You have learned how to Install Docker Compose on Fedora 33/32/31/30. Visit Compose getting started page for how to use Compose.

Also check:

Ctop – Top command for container metrics

Install and Configure phpMyAdmin on Fedora

How to Install FFmpeg on Fedora

How to Install TeamViewer on Fedora

As an appreciation for the content we put out,
we would be thrilled if you support us!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

2 COMMENTS

  1. Hi! But Docker-compose has a problem with firewalld on Fedora 33 (and maybe earlier versions). Can you mention this issue and how to solve this problem please?

LEAVE A REPLY

Please enter your comment!
Please enter your name here