How To Install Docker on Fedora 43

Containerization has revolutionized software development and deployment workflows. Docker stands as the leading platform for building, shipping, and running applications inside isolated containers. For Fedora 43 users looking to leverage containerization technology, installing Docker Engine provides access to a robust ecosystem of tools and capabilities. This comprehensive guide walks through every step of installing Docker on Fedora 43, from system preparation to post-installation configuration, ensuring a smooth setup process for both beginners and experienced Linux administrators.
Understanding Docker and Containerization
Docker is an open-source containerization platform that packages applications and their dependencies into lightweight, portable containers. These containers run consistently across different computing environments, eliminating the classic “it works on my machine” problem that developers frequently encounter.
Containers differ fundamentally from virtual machines. While virtual machines emulate entire operating systems with separate kernels, containers share the host system’s kernel while maintaining process isolation. This architecture makes containers significantly more resource-efficient, with faster startup times and reduced overhead.
The Docker ecosystem includes several components working together. Docker Engine serves as the core runtime that builds and runs containers. The Docker CLI provides command-line tools for managing containers and images. Meanwhile, containerd handles the container lifecycle, and Docker Compose orchestrates multi-container applications.
Developers use Docker for microservices architectures, continuous integration pipelines, and local development environments. System administrators deploy Docker for application isolation, simplified dependency management, and scalable infrastructure solutions. The platform’s versatility makes it indispensable for modern DevOps workflows.
System Prerequisites and Requirements
Before installing Docker on Fedora 43, verify that your system meets all necessary requirements. Docker officially supports Fedora 43 as a maintained release, ensuring compatibility and stability.
Your system must run a 64-bit version of Fedora 43 with an x86_64/amd64 architecture. Check your Fedora version using the command cat /etc/fedora-release to confirm you’re running the correct release. Verify your system architecture with uname -m, which should return x86_64.
Docker requires root or sudo privileges for installation and initial configuration. Allocate at least 2GB of RAM and 20GB of free disk space for optimal performance, though specific requirements depend on your intended workload. An active internet connection is essential for downloading Docker packages and container images.
Fedora 43 ships with SELinux enabled by default, providing mandatory access control security. Docker integrates seamlessly with SELinux, adding an additional security layer to containerized applications. This integration requires no special configuration during installation.
Preparing Your Fedora 43 System
System preparation ensures a clean installation environment. Start by updating all existing packages to their latest versions. Run sudo dnf update -y to refresh your package database and upgrade installed software.
The update process may take several minutes depending on the number of packages requiring updates. If the kernel receives an update during this process, reboot your system to load the new kernel version. Use sudo reboot to restart safely.
After rebooting, verify your system is current by running sudo dnf check-update. This command displays any remaining available updates. A system with no pending updates provides the most stable foundation for Docker installation.
Removing Conflicting Docker Packages
Fedora’s default repositories may include older Docker versions or alternative container runtimes that conflict with Docker CE (Community Edition). Remove these packages before proceeding with the installation.
Execute the following command to remove potentially conflicting packages:
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
The package manager might report that none of these packages are installed. This response is normal for fresh Fedora installations. The command ensures a clean slate by removing any unofficial Docker packages that could interfere with the official Docker CE installation.
Note that removing these packages does not delete existing Docker data. Images, containers, volumes, and networks stored in /var/lib/docker/ remain intact. This preservation protects your data during package transitions.
Installing Essential Repository Management Tools
Docker installation requires the dnf-plugins-core package, which provides advanced repository management capabilities. This package includes the dnf config-manager tool needed to add Docker’s official repository.
Install dnf-plugins-core with the following command:
sudo dnf -y install dnf-plugins-core
The -y flag automatically confirms the installation, streamlining the process. This package is lightweight and installs quickly. Once installed, you gain access to repository management commands essential for adding third-party software sources.
Adding the Official Docker Repository
Fedora’s default repositories may not include the latest Docker releases. Adding Docker’s official repository ensures access to current versions with the newest features and security patches.
Add the Docker CE repository using this command:
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
This command downloads the repository configuration file and saves it to /etc/yum.repos.d/docker-ce.repo. The file contains repository metadata, including package locations and GPG key information for package verification.
Verify the repository addition by running dnf repolist. The output should include docker-ce-stable among the listed repositories. This repository provides stable Docker releases suitable for production environments.
Docker maintains three repository channels: stable, test, and nightly. The stable channel receives production-ready releases, test includes beta versions, and nightly contains development builds. The default configuration uses the stable channel, recommended for most users.
Installing Docker Engine and Components
Docker CE consists of multiple packages working together to provide complete containerization functionality. Install all required components in a single command to ensure version compatibility.
Execute the following installation command:
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
During installation, dnf prompts you to verify the Docker GPG key. The key fingerprint should match 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35. This verification step confirms package authenticity and protects against tampered packages. Type y to accept the key and continue.
Each installed component serves a specific purpose. The docker-ce package contains Docker Engine itself, the core runtime for building and running containers. Docker-ce-cli provides the command-line interface for managing Docker. Containerd.io handles low-level container runtime operations.
The docker-buildx-plugin extends Docker’s build capabilities with advanced features like multi-platform image builds. Docker-compose-plugin enables orchestration of multi-container applications through declarative YAML configuration files.
Installation typically completes within a few minutes, depending on your internet connection speed. Docker installs to system directories, but the service does not start automatically. The installation process also creates a docker group for managing user permissions.
To install a specific Docker version instead of the latest release, first list available versions:
dnf list docker-ce --showduplicates | sort -r
This command displays all available Docker versions with their version strings. Install a specific version by appending the version string to the package name, such as docker-ce-3:28.5.2-1.fc43.
Starting and Enabling Docker Service
Docker uses systemd for service management, Fedora’s standard init system. Start the Docker daemon and configure it to launch automatically at system boot.
Start Docker immediately and enable boot-time startup with a single command:
sudo systemctl enable --now docker
This command combines two operations: enable configures the service for automatic startup, while --now starts the service immediately. Alternatively, use separate commands for more control. Start Docker with sudo systemctl start docker and enable automatic startup with sudo systemctl enable docker.
Verify that Docker is running correctly by checking the service status:
sudo systemctl status docker
The output should display “active (running)” in green text, indicating the Docker daemon is operational. The status information includes the service’s process ID, memory usage, and recent log entries.
If the service fails to start, the status command displays error messages pointing to the problem. Common issues include port conflicts or missing kernel modules.
Verifying Docker Installation
Testing your Docker installation confirms all components function correctly. Docker provides a simple test container specifically designed for verification purposes.
Check the installed Docker version:
docker --version
This command returns the Docker version number, such as “Docker version 28.5.2, build xyz123”. The version information confirms successful Docker CLI installation.
Run the hello-world test container:
sudo docker run hello-world
This command triggers several operations behind the scenes. Docker first searches for the hello-world image locally. When not found, Docker automatically downloads the image from Docker Hub, the official container registry. Docker then creates a container from the image and executes it.
The hello-world container outputs a success message explaining what happened during execution. This message confirms that Docker can pull images from registries, create containers, and execute containerized processes. The container exits automatically after displaying its message.
View detailed Docker system information:
sudo docker info
This command displays comprehensive configuration details, including the number of containers and images, storage driver information, Docker root directory, and active plugins. The output helps troubleshoot issues and understand your Docker environment configuration.
Configuring Docker for Non-Root Users
By default, Docker commands require root privileges or sudo. Adding your user account to the docker group enables running Docker commands without sudo, streamlining workflow for daily operations.
Add your user to the docker group:
sudo usermod -aG docker $USER
The -aG flags append your user to the group without removing existing group memberships. The $USER environment variable automatically references your current username.
Group membership changes do not take effect until you start a new session. Log out completely and log back in, or use newgrp docker to activate the new group in your current terminal session without logging out.
Test non-root Docker access:
docker run hello-world
Running this command without sudo confirms proper group configuration. If the command executes successfully, Docker is configured for non-privileged user access.
Understanding the security implications of docker group membership is crucial. Users in the docker group can execute commands with root-equivalent privileges through Docker containers. Mount volumes and execute privileged operations within containers as needed. Only add trusted users to the docker group.
Verifying Docker Compose Installation
Docker Compose V2 installs as a Docker CLI plugin, replacing the standalone docker-compose binary. This integration provides seamless multi-container orchestration.
Check the Docker Compose version:
docker compose version
The output displays the Compose version number, confirming successful installation. Note the space between “docker” and “compose” – this syntax differs from Docker Compose V1, which used a hyphen (docker-compose).
Docker Compose manages multi-container applications defined in YAML files. This tool is essential for complex applications requiring multiple interconnected services, such as web applications with separate database and cache containers.
Essential Docker Commands for Getting Started
Familiarize yourself with basic Docker commands to manage containers and images effectively.
List all images stored locally:
docker images
This command displays downloaded images with details including repository names, tags, image IDs, creation dates, and sizes.
List all containers:
docker ps -a
The ps command shows running containers, while the -a flag includes stopped containers. Container information includes IDs, images used, commands executed, creation times, status, ports, and names.
Remove a stopped container:
docker rm CONTAINER_ID
Replace CONTAINER_ID with the actual container identifier from the docker ps output. Use the first few characters of the ID for convenience.
Remove an image:
docker rmi IMAGE_ID
This command deletes images from local storage. Remove all containers using an image before deleting the image itself.
View container logs:
docker logs CONTAINER_ID
Logs display standard output and error streams from container processes, essential for debugging and monitoring.
Execute commands in running containers:
docker exec -it CONTAINER_ID bash
This command opens an interactive bash shell inside the container. The -i flag maintains an open connection, while -t allocates a pseudo-TTY for interactive sessions.
Testing Docker with a Real Container
Beyond hello-world, test Docker with a practical example using Nginx, a popular web server.
Run Nginx in detached mode with port mapping:
docker run -d -p 8080:80 --name my-nginx nginx
The -d flag runs the container in detached mode, returning control to your terminal while the container runs in the background. The -p 8080:80 parameter maps port 8080 on your host to port 80 in the container, making Nginx accessible via your host machine. The --name flag assigns a memorable name instead of a random identifier.
Open a web browser and navigate to http://localhost:8080. The default Nginx welcome page confirms successful container deployment and network configuration.
Stop the running container:
docker stop my-nginx
Remove the stopped container:
docker rm my-nginx
This exercise demonstrates real-world Docker functionality, including image pulling, container creation, port mapping, and container lifecycle management.
Troubleshooting Common Installation Issues
Several issues may arise during Docker installation or initial use. Understanding common problems and their solutions saves troubleshooting time.
Cannot connect to Docker daemon: This error indicates the Docker service is not running. Start the service with sudo systemctl start docker and check its status with sudo systemctl status docker. Enable automatic startup to prevent this issue after reboots.
Permission denied while trying to connect: This error occurs when your user lacks docker group membership. Add your user to the group using sudo usermod -aG docker $USER, then log out and back in. Verify group membership with the groups command.
GPG key verification failure: Network issues or repository problems can cause key verification failures. Manually import the GPG key using curl -fsSL https://download.docker.com/linux/fedora/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg. Then retry the installation.
Conflicting packages error: Old Docker installations interfere with new installations. Remove all conflicting packages using the command in the “Removing Conflicting Docker Packages” section. Verify complete removal with rpm -qa | grep docker.
Network connectivity issues in containers: Firewall rules or SELinux policies might block container networking. Check firewall status with sudo firewall-cmd --state and review Docker-related rules. Docker automatically configures most firewall rules, but custom configurations may require adjustment.
Docker daemon fails on Fedora 43: Some kernel versions may have compatibility issues with Docker’s iptables requirements. Verify your kernel version with uname -r and check Docker documentation for known compatibility issues.
Docker Security Best Practices
Securing your Docker environment protects both containers and the host system. Implement these practices to maintain a secure containerization platform.
Keep Docker updated regularly. Security patches and bug fixes appear frequently. Update Docker using sudo dnf update docker-ce docker-ce-cli containerd.io to receive the latest improvements.
Use official images from Docker Hub whenever possible. Official images receive regular security updates and follow best practices. Verify image sources and check for vulnerability reports before deploying.
Scan images for vulnerabilities using Docker Scout or third-party tools. Many vulnerabilities exist in container images due to outdated dependencies. Regular scanning identifies security risks before deployment.
Limit container resources to prevent resource exhaustion attacks. Use Docker’s built-in flags like --memory and --cpus to cap resource consumption. This prevents single containers from monopolizing system resources.
Run containers with minimal privileges when possible. Avoid running processes as root inside containers. Create specific users within containers and use the --user flag when starting containers.
Enable Docker Content Trust for image verification. Set the environment variable export DOCKER_CONTENT_TRUST=1 to require image signatures. This feature ensures image integrity and authenticity.
Leverage Fedora’s SELinux integration for additional security. SELinux provides mandatory access control, restricting container capabilities beyond standard Linux permissions. Docker works seamlessly with SELinux on Fedora, adding defense-in-depth.
Configure Docker daemon security options in /etc/docker/daemon.json. This file controls daemon behavior, including logging, storage drivers, and security settings. Restart Docker after configuration changes using sudo systemctl restart docker.
Restrict Docker daemon socket access carefully. The Docker socket provides root-equivalent access to the system. Never expose it over networks without proper TLS authentication.
Updating Docker on Fedora 43
Docker releases updates regularly with new features, performance improvements, and security patches. Keep your installation current to benefit from these enhancements.
Check for available Docker updates:
sudo dnf check-update docker-ce docker-ce-cli containerd.io
This command queries the repository for newer package versions without installing them.
Update Docker and related components:
sudo dnf update docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
The update process downloads and installs newer package versions. Restart the Docker service after updates to load new code:
sudo systemctl restart docker
Verify the updated version:
docker --version
Check that running containers still function correctly after updates. Most updates maintain backward compatibility, but testing ensures smooth transitions.
Uninstalling Docker
Circumstances may require Docker removal, such as switching to alternative container runtimes or troubleshooting persistent issues.
Remove all Docker packages:
sudo dnf remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
This command uninstalls Docker software but preserves data directories.
Delete Docker data directories to remove all images, containers, volumes, and custom configurations:
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
Warning: These commands permanently delete all Docker data. Back up important containers and volumes before proceeding.
Remove the docker group if no longer needed:
sudo groupdel docker
Delete custom configuration files manually, as they are not removed automatically. Check /etc/docker/ for daemon configuration files.
Congratulations! You have successfully installed Docker. Thanks for using this tutorial for installing the Docker containers on your Fedora 43 Linux system. For additional or useful information, we recommend you check the official Docker website.