whyfull

Podman using too much disk space

In a hurry? whyfull checks for this and every other common cause in one command.

Podman keeps images, containers and volumes in two different places, depending on who runs it:

That second one is easy to miss. On a shared machine or a CI runner, every user who has run Podman has their own copy of the images they pulled, and running sudo podman doesn't show any of it.

As with Docker, don't delete files under the storage directory by hand. Use Podman's own commands, which keep the image and container records consistent.

See what's using the space

For rootful storage:

sudo podman system df

For your own rootless storage, run it without sudo:

podman system df

The RECLAIMABLE column shows what the cleanup commands below can free. Add -v to see each image, container and volume.

To find other users' rootless storage, measure it from the outside:

sudo du -sh /home/*/.local/share/containers/storage 2>/dev/null | sort -h

Each user has to clean their own rootless storage, logged in as themselves, because their files belong to their own user namespace.

Clean up

Remove stopped containers:

podman container prune

Remove images that no container uses (without -a, only untagged "dangling" images are removed):

podman image prune -a

Or do both, plus unused pods and networks, in one go:

podman system prune -a

Add sudo to each command for rootful storage.

Volumes hold data. podman volume prune and podman system prune --volumes delete every volume no container is using, including ones a stopped service will need again. List them first with podman volume ls and remove only the ones you know are unwanted, with podman volume rm NAME.

The last resort

podman system reset deletes all images, containers, volumes and configuration in that storage, as if Podman had just been installed. It's useful when the storage itself is broken. It is not a cleanup command: everything is gone afterwards.

Keep it from growing back

More guides