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.
- 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- Stop all
podmanprocesses and remove existing images and volumes:
podman stop -a
podman rm -a
rm -rf ~/.local/share/containers/storage
rm -rf ~/.config/containersWarning
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- Create a new
.confconfig forpodman:
mkdir -p ~/.config/containers
nano ~/.config/containers/storage.confCopy-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"Run the following command:
podman info | grep -i graphRoot:Observe that the output should reflect INSERT_FILE_PATH_CUSTOM_FOLDER_HERE.