Inspecting Podman Containers
Four questions and the command for each: what has it said, what is it running, what is it costing, and what has it changed. `podman diff` is the one people never reach for and should.
Containers and Images Guide 8 of 47 Beginner
- OSUbuntu 26.04 LTS (resolute)
- Podman5.7.0
- Runtimecrun 1.21
- Networknetavark 1.16.1
- TimeAbout 13 min
- Reviewed22 August 2026
Written against the versions above. Podman follows the distribution here rather than a vendor repository, so the version you get is the one Ubuntu shipped. The commands are stable across 5.x.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| PODMAN01 | 192.168.0.21 | Ubuntu 26.04 LTS | Primary Container Host | 2 Core | 4 GB | 50 GB |
Before you start
- guide 10 - the
sitecontainer from that guide.
-
What has it said, and what is it running
podman logsis whatever the container wrote to stdout and stderr. Not a file inside the container - the streams its PID 1 produced, which Podman captured.--tail 4bounds it;-ffollows;--since 5mis usually what you actually want.podman topis the process list as the container sees it. nginx is PID 1 with its workers as children, and the workers run as thenginxuser while the master runs as root - inside the namespace. Compare withpson the host, where all of them belong to your account (guide 3).The two answer different questions and people reach for logs when they wanted top. If the container is up but doing nothing, its logs may be silent while
topshows you immediately whether the process is even there.bash Example session podman logs --tail 4 site2026/08/22 11:35:41 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:5242882026/08/22 11:35:41 [notice] 1#1: start worker processes2026/08/22 11:35:41 [notice] 1#1: start worker process 172026/08/22 11:35:41 [notice] 1#1: start worker process 18podman top site pid user commPID USER COMMAND1 root nginx17 nginx nginx18 nginx nginxExpected resultFour nginx startup notices, then a process list with nginx as PID 1.
Success conditionYou can see both what the container printed and what it is running.
-
What is it costing
podman stats --no-streamgives one sample and exits, which is what you want in a script or a note. Without the flag it takes over the terminal with a live display.The memory column reads
3.281MB / 3.564GB, and the limit is the interesting half: 3.564GB is the whole machine. No limit was set, so the container may use everything, and "the container is using 0.1% of memory" means 0.1% of the host.That is the honest reading of an unlimited container: it is not constrained, it just has not asked for much yet. Setting
--memorychanges the denominator to the limit, which is what makes the percentage mean anything.bash Example session podman stats --no-stream --format 'table {{.Name}} {{.CPUPerc}} {{.MemUsage}}'NAME CPU % MEM USAGE / LIMITsite 0.60% 3.174MB / 3.564GBExpected resultOne row, with a memory limit equal to the host's total RAM.
Success conditionYou can state what the percentage in a stats output is a percentage of.
-
What has it changed
podman diffcompares the container's writable layer against the image it came from. It is the least-used command here and often the most useful.C /etc/nginx/conf.d/default.conf A /run/nginx.pid A /var/cache/nginx/client_tempAadded,Cchanged,Ddeleted. Everything nginx has written since it started, and nothing else.Two things it is good for. Finding state you did not mean to keep: any file here is in the container's writable layer, which means it dies with
podman rmand belongs in a volume if it matters. And answering "what did this thing do to itself" on a container that is misbehaving after a while - a diff listing a hundred files in/tmptells you something is accumulating.It is also the honest check on whether a container is actually stateless, which is asserted far more often than it is verified.
bash Example session podman diff siteC /etcC /etc/nginx/conf.dC /etc/nginx/conf.d/default.confA /run/nginx.pidC /var/cache/nginxC /varC /var/cacheA /var/cache/nginx/client_tempA /var/cache/nginx/fastcgi_tempA /var/cache/nginx/proxy_tempA /var/cache/nginx/scgi_tempA /var/cache/nginx/uwsgi_tempExpected resultA dozen paths, each prefixed
AorC.Success conditionYou have a list of every file the container has written since it started.
Troubleshooting
podman logsis empty on a container that is clearly working.Why: The application writes to a file inside the container rather than to stdout.
Fix:
podman exec site tail -f /path/to/log, or configure the app to log to stdout, which is what container logging expects.podman statsshows no memory limit and you set one.Why: Rootless cgroup delegation may not be available, so limits are silently not applied.
Fix:
podman info --format '{{.Host.CgroupsVersion}}'should say v2, andcat /sys/fs/cgroup/user.slice/user-1000.slice/memory.maxshows what your user is allowed to limit.podman difflists far more than you expected.Why: Many images write caches, pid files and temp directories on startup. Some of that is normal.
Fix:Diff a freshly started container to get the baseline, then compare against the long-running one to see what accumulated.