Podman cheatsheet
Images and containers
| Command | Description |
|---|---|
podman pull nginx:alpine | Pull image |
podman images | List images |
podman run -d --name web -p 8080:80 nginx | Run detached, publish port |
podman ps -a | All containers |
podman logs -f web | Follow logs |
podman exec -it web sh | Shell in container |
podman stop web && podman rm web | Stop and remove |
podman build -t myapp:1.0 . | Build from Containerfile/Dockerfile |
Info and inspect
| Command | Description |
|---|---|
podman info | Runtime, storage, rootless mode |
podman version | Client and engine versions |
podman inspect web | jq -r '.[0].State.Status' | Container status |
podman inspect web | jq -r '.[0].State.ExitCode' | Exit code |
podman port web | Published ports |
Volumes and networks
| Command | Description |
|---|---|
podman volume ls | List volumes |
podman run -v ./data:/data:Z myapp | Bind mount (SELinux :Z) |
podman network ls | List networks |
podman network inspect podman | Default network details |
Pods
podman pod create --name mypod -p 8080:80
podman run -d --pod mypod --name c1 nginx
podman pod ps
podman pod stop mypod
podman pod rm mypod
Compose and kube
podman compose up -d
podman compose ps
podman compose down
podman play kube deployment.yaml
podman kube generate mycontainer > pod.yaml
systemd and Quadlet
podman generate systemd --name web --files --new
systemctl --user enable --now container-web.service
# Quadlet: /etc/containers/systemd/myapp.container
# systemctl daemon-reload && systemctl start myapp.service
Rootless and storage
| Command | Description |
|---|---|
podman info | grep -i rootless | Rootless mode? |
cat /etc/subuid /etc/subgid | UID/GID maps for rootless |
podman system df | Disk usage |
podman system prune -a | Remove unused data |
Skopeo (images without running)
| Command | Description |
|---|---|
skopeo inspect docker://nginx:alpine | Remote image metadata |
skopeo copy docker://src dest | Copy between registries/storage |
Docker CLI alias
alias docker=podman # many scripts work unchanged
podman --version
Pro tips
- No daemon —
podman psworks even when no "docker service" is running - Rootless: storage under
~/.local/share/containers/; useloginctl enable-lingerfor user services at boot - On RHEL/Fedora use
:Zon volume mounts when SELinux denies access podman machineruns a Linux VM on macOS/Windows (like Docker Desktop's VM)- Shared container basics: Docker lab
Practice scenarios
Hands-on Podman scenarios on live Linux VMs: podman