CleanMate

All guides · Ubuntu · Updated

Podman using too much disk space on Ubuntu: images, build cache and volumes

Where Podman keeps its images, containers, build cache and volumes on Ubuntu, rootless and root, how to see what takes the space, and which prune commands are safe to run.

Install on Ubuntu — free and open source

CleanMate Space Lens on Ubuntu showing the Podman container storage folder in the home folder

Podman stores images, containers and volumes like Docker does, but by default without a daemon and without root. That means the space is in your home folder, not in /var/lib/docker, and many disk tools that look for Docker miss it. After a few months of builds, ~/.local/share/containers can hold 20 to 50 GB of old image layers and build cache.

This guide shows where Podman keeps its data, how to see what takes the space, and which commands free it safely.

Where Podman keeps its data

Each store is separate. An image you pulled with sudo podman is not visible to rootless podman, so you may have the same image twice.

To see how big each store is:

du -sh ~/.local/share/containers/storage
sudo du -sh /var/lib/containers/storage

See what takes the space

podman system df shows images, containers and volumes with their size and how much is reclaimable. Add -v to list each item.

podman system df
podman images --filter dangling=true
podman volume ls --filter dangling=true

Dangling images (<none>) are old layers that a newer build replaced. Dangling volumes are volumes no container uses any more.

Free the space

From the safest to the most thorough:

  1. podman image prune removes dangling images. Nothing you use is touched.
  2. podman image prune -a removes every image no container uses. You download or build them again when needed.
  3. podman container prune removes stopped containers. Their changes are lost; their volumes stay.
  4. podman volume prune removes volumes no container uses. This is data: a database you ran in a container lives in a volume. Check with podman volume ls and podman volume inspect first.
  5. podman system prune -a does 1 to 3 at once; add --volumes to include volumes.

podman system reset deletes the whole store, every image, container and volume. Use it only to start over.

Run each command again with sudo for the root store if you use it.

How CleanMate does it

CleanMate 2.7.0 on Ubuntu (all Ubuntu features) lists Podman in Smart Scan › Developer Junk:

Space Lens shows ~/.local/share/containers with its size next to your other folders, so you can see whether Podman is the big one. If you use Docker too, see Docker using too much disk space, and if Docker says permission denied on Ubuntu, the Docker permission guide. For the rest of a developer machine, see Free up disk space on Ubuntu as a developer and Virtual machines and dev infrastructure tools.

FAQ

Is podman system prune safe? Without --volumes, yes: it removes stopped containers, unused networks, dangling images and build cache. Your running containers and volumes stay.

Why does df not change after I prune? Check that you pruned the right store: rootless and root (sudo podman) are separate.

Can I move Podman’s storage to another disk? Yes. Set graphroot in ~/.config/containers/storage.conf, then run podman system reset and pull your images again.

Does Podman Desktop keep its own copy? On Linux, Podman Desktop uses the same rootless store, so the same commands apply.

Skip the commands

Open source — star it on GitHub: CleanMate for Ubuntu

How CleanMate decides what is safe to remove →