Swap Docker For Podman on Fedora 39-42:
0. Cleanup Podman
- Force remove all containers:
podman rm -a -f
- Force remove all pods:
podman pod rm -a -f
- Force remove all images:
podman rmi -a -f
- Force remove all podman machines and reset:
podman machine reset -f
1. Remove Podman (and its shims)
sudo dnf remove -y podman podman-docker podman-compose
podman
= engine itselfpodman-docker
= the “shim” that makes/usr/bin/docker
call Podmanpodman-compose
= Podman’s alternative Compose tool
This ensures no “fake docker” commands get in your way.
2. Add Docker’s official repo
Fedora doesn’t ship Docker CE anymore, so grab Docker’s maintained repo:
# set up the repo
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
3. Install Docker CE and plugins (includes Compose v2)
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
docker-compose-plugin
gives youdocker compose …
(v2, built into thedocker
CLI).- No need for the old
docker-compose
Python package.
4. Enable & start Docker
sudo systemctl enable --now docker
5. Add your user to the docker
group (optional, avoids sudo
)
sudo usermod -aG docker $USER
newgrp docker # refresh group membership in current shell
6. Test it
docker --version
docker compose version
docker run hello-world
You should see Docker CE’s version info and a successful “Hello from Docker!” run.
At this point:
- Podman is gone.
- You have the real Docker engine + socket at
/var/run/docker.sock
. docker
anddocker compose
commands will behave exactly as WinBoat (or any Docker-dependent app) expects.
---
Undo the above and go back to Fedora’s Podman-first setup.:
1. Stop and remove Docker
sudo systemctl disable --now docker
sudo dnf remove -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
That clears out Docker CE and its supporting runtime bits.
2. Re-install Podman + extras
sudo dnf install -y podman podman-docker podman-compose
podman
→ main enginepodman-docker
→ provides/usr/bin/docker
shim (sodocker run …
maps topodman run …
)podman-compose
→ lets you runpodman-compose up
withdocker-compose.yml
files
3. (Optional) Enable Docker-compat socket for Podman
If you want tools like Compose v2 to talk to Podman as if it were Docker:
systemctl --user enable --now podman.socket
export DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock
(You can drop that export
into ~/.bashrc
or ~/.zshrc
if you want it permanent.)
4. Verify Podman is back
podman --version
docker --version # now points to Podman if podman-docker is installed
podman run hello-world