How to maintain data persistence in n8n Docker deployment

I’ve set up n8n in a Docker container through a cloud provider that runs on Jelastic platform. The application starts and works perfectly, but I’m facing issues with data persistence.

Every time the container restarts, all my automation workflows and stored credentials disappear. I’ve tried setting up a volume in my environment configuration, just like I did on my local development setup where persistence works fine, but it’s not solving the problem in the cloud environment.

As someone with a product management background and limited technical expertise, I’m hitting a wall with this configuration issue. Any guidance on properly configuring persistent storage for n8n in a Jelastic-based Docker setup would be extremely helpful.

I’ve hit the same persistence issues with n8n on managed cloud platforms. It’s usually not your Docker config - it’s how the cloud provider handles volume mounting. With Jelastic, you need to map the volume to /home/node/.n8n inside the container, not some random path. Your cloud platform might be using ephemeral storage that gets wiped when containers restart. Look for persistent block storage options that survive container lifecycles. Also check if n8n is actually writing to your mounted volume by verifying the N8N_USER_FOLDER environment variable. Sometimes the app defaults to a different location than you’d expect, which explains why it works locally but doesn’t keep data in the cloud.

yea, jelastic volumes can be tricky. double-check ur volume path syntax - that trips peeps up a lot. also worth checkin permissions. def hit up support tho, they usually have helpful workarounds.

Had the same exact issue moving from local to cloud. It’s not your volume config - Jelastic handles container persistence way differently than regular Docker setups. Here’s what fixed it for me: set the N8N_USER_FOLDER environment variable to match your mounted volume path, and make sure the database file writes there too. Cloud providers restart containers way more aggressively than you’d expect, so check your container logs during startup to verify the volume’s actually mounting. If n8n can’t write to the right directory, it just silently uses temporary storage instead. Quick test - create a simple file in your mounted directory and see if it survives a restart.