Learn how to back up n8n workflows safely with simple steps and best practices to protect your automations and keep your data secure.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
The safest and most reliable way to back up n8n workflows is to back up the entire n8n data directory (often called .n8n) or, if you're using a database, back up the database itself. These locations contain every workflow, every credential, every execution, and all n8n settings. You can also export workflows manually from the UI, but that should be treated as a secondary/one‑off method, not a real backup strategy.
You really have only two proper sources of truth for backups:
Everything else (like manually exporting JSON from the UI) is fine for quick copies but not reliable for restoring a full n8n installation.
In this mode n8n stores everything inside a folder called .n8n. If you're running via Docker, that folder is usually mounted as a volume. This folder contains:
You simply copy this folder somewhere safe. That’s your backup.
A simple shell example:
// Backup the whole .n8n directory to a dated folder
cp -r /path/to/.n8n /backups/n8n-$(date +%F)/
To restore, you put the folder back in place and restart n8n. That’s it.
Important production note:
Make this copy while n8n is not actively writing (or stop the container briefly). SQLite is a single-file DB, and copying it during writes can corrupt backups.
In a more mature setup, the n8n application container is stateless and all workflow/credential/execution data lives entirely in the database. So the backup is simply your DB backup.
// Dump the entire n8n database
pg_dump -U n8n_user -h localhost n8n_db > n8n_backup.sql
// Dump MySQL/MariaDB n8n database
mysqldump -u n8n_user -p n8n_db > n8n_backup.sql
To restore, load that dump into a clean database and point your n8n instance to it.
If you have binaryData set to filesystem mode (not DB mode), also back up the folder you mapped for it.
This is okay for a one‑off copy or sharing a workflow with someone, but it is not a real backup strategy. It exports only the workflow JSON — not credentials, not tags, not execution data, not settings.
Use this only as a convenience, not for disaster recovery.
If you follow these steps, your n8n installation becomes fully recoverable: workflows, credentials, executions, settings, everything. That's the same approach teams use in real production deployments.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.