Docker is an essential tool for modern development and deployment workflows. If you’re running Fedora and want to get Docker up and running, this guide will show you the recommended way to install it using the official Docker repository.
System Requirements
Before we begin, make sure you have:
- Fedora Version: A maintained version of Fedora 41 or Fedora 42
- Sudo privileges: Administrative access to your system
- Internet connection: To download packages and repositories
Step 1: Remove Old Docker Versions
First, let’s clean up any existing Docker installations that might cause conflicts:
sudo dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
Don’t worry if dnf
reports that some of these packages aren’t installed – that’s perfectly normal.
Step 2: Install DNF Plugins
Install the dnf-plugins-core
package, which provides tools to manage DNF repositories:
sudo dnf -y install dnf-plugins-core
Step 3: Add Docker’s Official Repository
Add Docker’s official repository to your system:
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
Step 4: Install Docker Engine
Now install Docker and all its components:
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Important: When prompted to accept the GPG key, verify that the fingerprint matches:
060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
If it matches, accept the key to continue with the installation.
Step 5: Start and Enable Docker
Start Docker and configure it to start automatically at boot:
sudo systemctl enable --now docker
This command does two things:
- Starts Docker immediately
- Enables Docker to start automatically when your system boots
If you prefer to start Docker manually each time, use this instead:
sudo systemctl start docker
Step 6: Verify Installation
Test that Docker is working correctly:
sudo docker run hello-world
If successful, you’ll see a welcome message from Docker confirming everything is working properly!
What Gets Installed
Your Docker installation includes:
- docker-ce: Docker Community Edition engine
- docker-ce-cli: Command line interface
- containerd.io: Container runtime
- docker-buildx-plugin: Advanced build capabilities
- docker-compose-plugin: Multi-container application management
Important Notes
Docker Group: The installation creates a docker
group but doesn’t add any users to it by default. That’s why you need to use sudo
with Docker commands initially.
Data Persistence: When you uninstall Docker, your images, containers, volumes, and networks stored in /var/lib/docker/
are preserved and not automatically removed.
Running Without Sudo: To run Docker commands without sudo, you can add your user to the docker group (we’ll cover this in a future post).
Alternative Installation Methods
While this guide covers the recommended repository method, Docker can also be installed by:
- Downloading RPM packages manually (useful for air-gapped systems)
- Using convenience scripts (only recommended for testing/development)
Next Steps
Now that Docker is installed on your Fedora system, you can:
- Start experimenting with containers
- Build custom Docker images
- Set up development environments
- Explore Docker Compose for multi-container applications
Troubleshooting
If you encounter issues:
- Verify you’re using Fedora 41 or 42
- Check that you have sudo privileges
- Ensure your internet connection is stable
- Make sure the GPG key fingerprint matches exactly
- Try restarting the Docker service:
sudo systemctl restart docker
Docker is now ready to use on your Fedora system! Keep an eye out for more Docker tutorials and advanced tips.
Having trouble with your Docker installation on Fedora? Leave a comment and we’ll help you troubleshoot!