Skip to content
Podman 1 min read

Change the Storage Path in Podman (storage.conf)

Change the Storage Path in Podman (storage.conf)

If you use Podman to manage containers, at some point, you may need to change the directory where data is stored—whether due to disk space issues or simply to better organize your infrastructure. The good news? It's super easy to do! Let's go! 🚀

📌 Step 1: Editing the Configuration

The first step is to edit the Podman/Docker configuration file. Open the terminal and run:

vim /etc/containers/storage.conf

Now, look for the [storage] section and edit the graphroot parameter, changing it to the new path where you want to store the data.

Imagem de Exemplo XD
Imagem de Exemplo XD

⛔ Step 2: Stopping Containers and Clearing Old Data

Before applying the change, we need to pause the containers and clear the old data to avoid conflicts. Run the following commands:

podman ps -a -q | xargs podman stop 
podman system reset
docker ps -a -q | xargs docker stop 
docker system reset

This ensures that everything will be initialized correctly with the new path.

🔄 Step 3: Restarting Podman/Docker

Now it's time to restart Podman/Docker so that it starts using the new directory. Run:

systemctl restart podman
systemctl restart docker

🔍 Step 4: Verifying the Change

After everything is set up, it’s always good to verify if the change was successfully applied. Run this command:

podman info --format '{{ .Store.GraphRoot }}'

If the displayed path matches the one you configured in storage.conf, you're done! 🎉


💡 Who am I?

I'm Gabriel Carmo, passionate about technology (especially Open Source). I have experience in Cloud, Kubernetes, OpenShift, Zabbix, Dynatrace, and much more! Always exploring new technologies and sharing knowledge. 🚀

📬 Let’s connect?

🔗 LinkedIn
🐙 GitHub
🦊 GitLab
🏅 Credly
📧 Contact:
contato@gabrielandre.com.br