storage.conf configures the containers/storage library used by Podman to store image layers, containers, and filesystem data. It controls storage locations and storage-driver behavior, while other Podman defaults belong to separate configuration files. section 5.1 section 5.5
Podman reads one applicable file: a user configuration takes precedence over system configuration, which takes precedence over the distribution default. Rootless users typically use $HOME/.config/containers/storage.conf, while rootful configuration commonly resides at /etc/containers/storage.conf; remote Podman uses the Linux machine’s files. section 5.1
Storage location settings distinguish rootful and rootless operation:
- Rootless Podman defaults to $HOME/.local/share/containers/storage. section 5.1.1
- Rootful Podman defaults to /var/lib/containers/storage; graphroot can relocate it, such as to /var/mystorage. section 5.1.1
- rootless_storage_path changes the rootless location system-wide and supports $HOME and $UID expansion. section 5.1.1
- Relocated directories require appropriate SELinux file-context handling with semanage and restorecon. section 5.1.1
Podman uses overlay by default; in Podman, this name refers to the newer overlay2 implementation. Advanced [storage.options.overlay] settings include mount_program, mountopt, ignore_chown_errors, size, inode, and force_mask. fuse-overlayfs can provide userspace mounting when rootless native overlay is unavailable. section 5.1.2
Relocate rootful storage
Copy the distribution configuration, edit graphroot, and verify the active path: sudo cp /usr/share/containers/storage.conf /etc/containers/storage.conf; set graphroot = "/var/mystorage"; run sudo podman info and inspect graphRoot and volumePath. section 5.1.1
$ podman info --format '{{ .Store.ConfigFile }}'
/home/dwalsh/.config/containers/storage.conf
Use podman info to identify the exact storage.conf file active for the current Podman invocation. section 5.1
