Skip to content
Search Fedora

    Browse this documentation

    Podman on Fedora: install, daily commands, registry mirrors and Quadlet autostart

    Fedora ships Podman as its container engine; Docker is not needed. Measured on a Cloud image:

    Terminal window
    podman --version
    podman info --format '{{.Host.Security.Rootless}}'
    podman version 6.1.0
    true

    true means rootless containers work — ordinary users can run containers without sudo.

    Rootless layout: user calls podman, conmon supervises, Quadlet generates units

    Terminal window
    sudo dnf install podman

    For scripts that hardcode docker:

    Terminal window
    sudo dnf install podman-docker

    After that docker is a shim over podman and docker ps works.

    Run a container:

    Terminal window
    podman run --rm docker.io/library/alpine echo "hello from podman"
    hello from podman

    --rm removes it on exit.

    Inspect:

    Terminal window
    podman images --format "{{.Repository}}:{{.Tag}} {{.Size}}"
    podman ps -a
    docker.io/library/alpine:latest 8.72 MB
    Taskdockerpodman
    rundocker runpodman run
    running listdocker pspodman ps
    all listdocker ps -apodman ps -a
    execdocker exec -itpodman exec -it
    logsdocker logspodman logs
    builddocker buildpodman build (or buildah)
    composedocker composepodman compose / Quadlet
    daemondockerdnone

    That last row matters: Podman calls runc/crun directly and runs no daemon, so there is no systemctl status docker.

    Docker Hub pulls frequently time out here. Add a registry rewrite:

    Terminal window
    sudo tee /etc/containers/registries.conf.d/99-cn.conf >/dev/null <<'EOF'
    unqualified-search-registries = ["docker.io"]
    [[registry]]
    prefix = "docker.io"
    location = "docker.m.daocloud.io"
    EOF

    Then podman pull nginx goes through the mirror. Measured:

    Terminal window
    time podman pull -q docker.io/library/alpine
    real 0m9.692s
    Terminal window
    podman run -d --name web \
    -p 8080:80 \
    -v /srv/html:/usr/share/nginx/html:Z \
    docker.io/library/nginx

    The trailing :Z is the SELinux label and is mandatory on Fedora — without it the container cannot read the host directory and reports Permission denied (see SELinux).

    Verify:

    Terminal window
    curl -s http://127.0.0.1:8080/ | head -3
    podman logs web --tail 3
    podman exec -it web sh

    This is the most useful part. The old podman generate systemd is gone in 6.x — Quadlet replaces it: write a declarative file and systemd generates the unit.

    Check the directory and generator:

    Terminal window
    ls -d /etc/containers/systemd
    ls /usr/lib/systemd/system-generators/ | grep podman
    /etc/containers/systemd
    podman-system-generator

    Write a container:

    Terminal window
    sudo tee /etc/containers/systemd/web.container >/dev/null <<'EOF'
    [Unit]
    Description=Demo web container
    [Container]
    Image=docker.io/library/alpine:latest
    Exec=sleep infinity
    [Install]
    WantedBy=default.target
    EOF

    Reload and look at the generated unit:

    Terminal window
    sudo systemctl daemon-reload
    systemctl status web.service --no-pager | head -5
    ○ web.service - Demo web container
    Loaded: loaded (/etc/containers/systemd/web.container; generated)
    Active: inactive (dead)

    Note generated: this .service is produced from the .container file. Do not edit it by hand.

    Start it:

    Terminal window
    sudo systemctl start web.service
    systemctl is-active web.service
    podman ps --format "{{.Names}} {{.Status}}"
    active
    systemd-web Up 2 seconds

    The container is named systemd-web (with the systemd- prefix).

    Section titled “User-level Quadlet (rootless, recommended)”
    Terminal window
    mkdir -p ~/.config/containers/systemd
    cp /etc/containers/systemd/web.container ~/.config/containers/systemd/
    systemctl --user daemon-reload
    systemctl --user start web.service

    For user services that must run without an active login:

    Terminal window
    sudo loginctl enable-linger $USER
    Docker habitOn Podman
    docker compose updnf install podman-compose, then podman-compose up, or convert to Quadlet
    systemctl restart dockerno daemon; restart the container or its unit
    /var/run/docker.sockpodman-docker provides a compatible socket; some tools still need config changes
    docker buildpodman build — same Dockerfile syntax
    Terminal window
    sudo systemctl restart docker # Unit docker.service not found

    That error is expected — there is no daemon to restart.

    SymptomCause
    podman pull times outno registry mirror configured, or the mirror lacks the image
    mounted directory Permission deniedmissing :Z; SELinux blocked it
    container has no outbound networkrootless needs --network=host or a working pasta/slirp4netns
    Quadlet change has no effectforgot systemctl daemon-reload after editing the .container
    user service stops on logoutmissing loginctl enable-linger
    systemctl restart docker failsPodman has no daemon — expected