Skip to content

Instantly share code, notes, and snippets.

@cardboardcode
Last active July 4, 2026 15:13
Show Gist options
  • Select an option

  • Save cardboardcode/07483670d475e059db09eba5af053eef to your computer and use it in GitHub Desktop.

Select an option

Save cardboardcode/07483670d475e059db09eba5af053eef to your computer and use it in GitHub Desktop.
For People In A Hurry: Setting Podman Storage to Custom Directory
image

Note

This is a quick copy-paste-observe guide for people in a hurry to quickly set up podman such that it stores hefty images and volumes in a custom directory that may offer better memory management.

Instructions 📘

  1. Create the new storage directory:
mkdir -p <INSERT_FILE_PATH_CUSTOM_FOLDER_HERE>
sudo chown -R $USER:$USER <INSERT_FILE_PATH_CUSTOM_FOLDER_HERE>

Eg.

mkdir -p /mnt/Mount/podman
sudo chown -R $USER:$USER /mnt/Mount/podman
  1. Stop all podman processes and remove existing images and volumes:
podman stop -a
podman rm -a
rm -rf ~/.local/share/containers/storage
rm -rf ~/.config/containers

Warning

If you wish to migrate existing images and volumes, use the command below instead:

podman stop -a
podman rm -a
mkdir <INSERT_FILE_PATH_CUSTOM_FOLDER_HERE>
rsync -a ~/.local/share/containers/storage <INSERT_FILE_PATH_CUSTOM_FOLDER_HERE>
rm -rf ~/.config/containers
  1. Create a new .conf config for podman:
mkdir -p ~/.config/containers
nano ~/.config/containers/storage.conf

Copy-paste the following content in storage.conf:

[storage]
driver="overlay"
graphroot="<INSERT_FILE_PATH_CUSTOM_FOLDER_HERE>"

Eg.

[storage]
driver="overlay"
graphroot="/mnt/Mount/podman"

Verify ✔️

Run the following command:

podman info | grep -i graphRoot:

Observe that the output should reflect INSERT_FILE_PATH_CUSTOM_FOLDER_HERE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment