Logo
BearHost Logo

n8n Backup and Restore Guide

By Elliot, BearHost·

Your BearHost n8n hosting plan includes automated daily backups. This guide explains how backups work and how to restore your data if needed.

Automated Daily Backups

Your n8n instance is backed up automatically every day at 3:00 AM UTC. Each backup includes:

  • PostgreSQL database — All your workflows, credentials, execution history, and settings
  • n8n configuration — Environment variables and Docker Compose config

Backups are stored locally on your server at /opt/n8n/backups/ and retained for 7 days.

Manual Backup

To create an immediate backup, SSH into your server and run:

ssh root@your-server-ip
cd /opt/n8n
docker exec n8n-postgres pg_dump -U n8n n8n > backups/manual-backup-$(date +%Y%m%d-%H%M%S).sql

Checking Backup Status

List your available backups:

ls -la /opt/n8n/backups/

You should see files like:

n8n-backup-2026-03-22.sql
n8n-backup-2026-03-21.sql
n8n-backup-2026-03-20.sql

Restoring from Backup

Important: Restoring a backup will replace all current data. Make sure you have a current backup before proceeding.

  1. Stop n8n:
cd /opt/n8n && docker compose stop n8n
  1. Restore the database:
docker exec -i n8n-postgres psql -U n8n -d n8n < backups/n8n-backup-2026-03-22.sql
  1. Restart n8n:
docker compose start n8n
  1. Verify by logging into your n8n editor and checking your workflows.

What About the Encryption Key?

Your n8n instance uses an encryption key (N8N_ENCRYPTION_KEY) to encrypt stored credentials (API keys, passwords, etc.). This key is stored in /opt/n8n/.env and in /root/.n8n-credentials.

Never delete or change this key. If the encryption key is lost, all stored credentials become unrecoverable and you'll need to re-enter them in every workflow.

Off-Server Backups

For additional safety, you can copy backups to another location:

scp root@your-server-ip:/opt/n8n/backups/n8n-backup-2026-03-22.sql /local/path/

Need Help?

Contact support at support@bearhost.com if you need assistance with backup or restore operations.

Tags:#n8n#backup#restore#database#postgresql#disaster-recovery