self hosting
N8N Backup and Restore Guide
Back up the active database, n8n user data, encryption key, and any external binary storage before upgrades or infrastructure changes.
Independent third-party notes. n8n is a trademark of its owner and is referenced only for compatibility and troubleshooting context.
Quick Answer
Back up the active database, n8n user data, encryption key, and any external binary storage before upgrades or infrastructure changes.
Key Facts
- Database data
- Workflows, credentials metadata, executions, and settings depend on the active database.
- SQLite path
- The default SQLite file is under ~/.n8n/database.sqlite.
- User data
- The n8n user data directory also matters for Docker persistence and community nodes.
- Encryption key
- The encryption key must be preserved to keep encrypted credentials usable.
Recommended Steps
- Identify whether the instance uses SQLite or Postgres.
- Back up the active database.
- Back up the n8n user data directory and community node directory.
- Store the encryption key securely with the deployment secrets.
- Test restore in a separate environment before relying on the backup.
Verification
- A restored test instance can start.
- Workflows are visible after restore.
- Credentials can be used after restore.
- Community nodes load if workflows depend on them.
Warnings
- A database backup without the encryption key may not be enough to recover credentials.
- A Docker volume snapshot is not a substitute for a tested restore.
Best For
- Self-hosted n8n instances with real workflows or credentials.
- Teams preparing for upgrades, migrations, or server moves.
- Deployments using Docker volumes, SQLite, Postgres, or community nodes.
Not For
- Disposable demo instances with no important data.
- Users who cannot securely store encryption keys and database dumps.
- Managed environments where backups are handled and verified by the provider.
Common Mistakes
- Backing up only the Docker Compose file and not the database or volume data.
- Losing the encryption key needed for credential recovery.
- Never testing restore until a real outage.
- Forgetting community node packages that workflows depend on.
Examples
Active database: SQLite or Postgres
n8n user data directory: backed up
Encryption key: stored securely
Community nodes: documented and restorable
External binary storage: included if used
Restore test date: recorded 1. Start a clean test instance.
2. Restore database and user data.
3. Provide the same encryption key.
4. Start n8n.
5. Open workflows and test one credential-backed execution.
6. Document what failed. FAQ
What is the most commonly missed backup item?
The encryption key and the actual active database are easy to miss. Without them, workflows or credentials may not recover correctly.
Do I need backups before every upgrade?
Yes for any important self-hosted instance. Upgrades are one of the moments when a recent restore-tested backup matters most.
Is exporting workflows enough?
No. Workflow export can help, but it is not a full backup of credentials, execution data, settings, user data, and installed community packages.