Data Persistence Concern
n8n in a Docker container on a cloud service loses workflows and credentials after restart, even with mounted storage. How can data persist?
n8n in a Docker container on a cloud service loses workflows and credentials after restart, even with mounted storage. How can data persist?
hey, try checking your docker vol mapping - maybe your config folder isn’t correctly linked so the data gets wiped on restart. also, read up on n8n persistance options in their docs, cause sometimes you need specific env var settings.
In my experience, data persistence issues in n8n setups usually boil down to how the volume mappings and file permissions are configured. I encountered a similar problem when my container lost state after a restart. I resolved it by carefully mapping the directories where workflow and credential data is stored to host directories with appropriate permissions. Additionally, I set environment variables to specify the data directory. In some cases, offloading data to an external database like PostgreSQL further stabilized the arrangement. Ensuring the host folder is correctly referenced in the Docker configuration helped ensure your data remains persistent.
Based on my experience, getting persistent storage on n8n in Docker really comes down to ensuring that the volume mounts are correctly configured. I went through a period where workflows were constantly disappearing until I fixed my host directory bindings and ensured that the expected data paths were correctly mapped. A critical step was verifying that the environment variables matched those in the documentation. Additionally, sometimes using an external database for storing credentials, rather than relying solely on file system storage, proved to be a more robust solution.
hey, i had a similar issue. fixed it by re-checking the volume mounts and permissions, making sure the correct folders are passed to your docker container. minor misconfigurations can wipe your data unexpectedly, so double-check those paths!