Installing Podman and Understanding Containers
Podman runs OCI containers without requiring a daemon. Rootless containers are the normal choice for development and reduce the impact of a compromised process.
Install
On Debian or Ubuntu:
sudo apt update
sudo apt install podman
podman --version
podman info
Package names and supported versions vary by distribution. Use the distribution’s supported package or the current Podman documentation instead of mixing repositories.
Images and containers
An image is an immutable template. A container is a runnable instance with its own writable layer. Pull an image and run a short-lived command:
podman pull docker.io/library/alpine:3.20
podman run --rm docker.io/library/alpine:3.20 cat /etc/alpine-release
Interactive containers need a process that remains attached:
podman run --name shell-demo --interactive --tty alpine:3.20 sh
podman ps -a
podman start --attach shell-demo
Use an explicit version tag for repeatable tutorials. Avoid latest when documenting a result that should remain stable.
Inspect and clean up
podman inspect shell-demo
podman logs shell-demo
podman rm shell-demo
podman image prune
Do not use broad prune commands on a host containing work you still need. Podman commands in the remaining articles assume this foundation.