Skip to main content
๐ŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy โ€” plus the companion book on Leanpub & Amazon. Start Learning
Podman Cheat Sheet 2026: Rootless Container Commands
DevOps

Podman Cheat Sheet 2026: Rootless Container Commands

Podman cheat sheet for rootless container management in 2026. Pod creation, systemd integration, Docker CLI compatibility, and Kubernetes YAML generation.

LB
Luca Berton
ยท 1 min read

A quick reference for Podman โ€” the daemonless container engine. Bookmark this page.

Container Lifecycle

# Run a container
podman run -d --name web -p 8080:80 nginx:alpine
podman run -it --rm fedora:39 bash     # Interactive, auto-remove
podman run -d -v ./data:/data:Z nginx  # Volume with SELinux label

# List containers
podman ps                    # Running
podman ps -a                 # All (including stopped)
podman ps --format "{{.Names}} {{.Status}}"

# Stop/start/restart
podman stop web
podman start web
podman restart web

# Remove
podman rm web
podman rm -f web             # Force remove running container
podman rm -a                 # Remove all stopped containers

Images

# Pull/push
podman pull docker.io/library/nginx:alpine
podman push localhost/myapp:v1 docker.io/myuser/myapp:v1

# Build
podman build -t myapp:v1 .
podman build -t myapp:v1 -f Containerfile .
podman build --no-cache -t myapp:v1 .

# List and manage
podman images
podman image prune           # Remove dangling images
podman image prune -a        # Remove all unused images
podman rmi nginx:alpine

Pods (Podman-specific)

# Create a pod (shared network namespace)
podman pod create --name my-pod -p 8080:80 -p 5432:5432

# Run containers in a pod
podman run -d --pod my-pod --name web nginx:alpine
podman run -d --pod my-pod --name db postgres:16

# List pods
podman pod list
podman pod inspect my-pod

# Manage pods
podman pod stop my-pod
podman pod start my-pod
podman pod rm -f my-pod

Inspect and Debug

# Logs
podman logs web
podman logs -f web           # Follow
podman logs --tail 50 web    # Last 50 lines

# Execute command in container
podman exec -it web bash
podman exec web cat /etc/nginx/nginx.conf

# Inspect
podman inspect web
podman inspect web --format '{{.NetworkSettings.IPAddress}}'

# Resource usage
podman stats
podman top web               # Processes in container

Rootless Containers

# Run as non-root user (default in Podman)
podman run -d --name web -p 8080:80 nginx:alpine

# Check user namespace mapping
podman unshare cat /proc/self/uid_map

# Set subuid/subgid ranges
sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USER

Podman Compose

# Install
pip install podman-compose

# Use (same as docker-compose)
podman-compose up -d
podman-compose down
podman-compose logs -f
podman-compose ps

Generate Kubernetes YAML

# Generate K8s YAML from running container
podman generate kube web > web-pod.yaml

# Generate from pod
podman generate kube my-pod > my-pod.yaml

# Play Kubernetes YAML with Podman
podman play kube web-pod.yaml
podman play kube --down web-pod.yaml  # Tear down

Tips and Tricks

  • Podman is a drop-in Docker replacement: alias docker=podman
  • Use podman system prune -a to reclaim disk space
  • Use podman auto-update with io.containers.autoupdate=registry label
  • Rootless containers are more secure โ€” use them by default
  • Use podman machine on macOS/Windows for a Linux VM

Free 30-min AI & Cloud consultation

Book Now