comparison

n8n SQLite vs Postgres: When to Switch for Production and Queue Mode

SQLite is the default for self-hosted n8n, while Postgres is the better fit for queue mode, scaling, and production deployments with heavier execution load.

Use when
self-hosted, database selection
First check
Separate whether n8n itself cannot start or only a workflow Postgres node cannot connect.
Time to check
5-10 minutes
Next step
Match the symptom, then run the verification checks.

Independent third-party notes. n8n is a trademark of its owner and is referenced only for compatibility and troubleshooting context.

Quick Answer

SQLite is the default for self-hosted n8n, while Postgres is the better fit for queue mode, scaling, and production deployments with heavier execution load.

Does this match your symptom?

Postgres connection or query path is failing

n8n cannot reach Postgres, a Postgres node fails in production, or self-hosted database settings are mixed up with workflow credentials.

First check: Separate whether n8n itself cannot start or only a workflow Postgres node cannot connect.

Problem Pattern

The user is trying to decide whether the default SQLite database is still enough or whether Postgres is needed before scaling.

Key Facts

SQLite
Default database for self-hosted n8n when no database is configured.
SQLite file
The default SQLite database file is stored under ~/.n8n/database.sqlite.
Postgres
Configured with DB_TYPE=postgresdb and related environment variables.
Queue mode
n8n does not recommend SQLite for queue mode.
  1. Use SQLite for small tests, prototypes, and simple single-instance setups.
  2. Use Postgres when the instance is production-critical, high-volume, or queue-mode based.
  3. Plan migration and backups before moving an existing SQLite instance.
  4. Document which database holds the source of truth for workflows, credentials, and executions.

Verification

  • The selected database matches the deployment scale.
  • Backups include the active database, not only the n8n container volume.

Warnings

  • Do not treat the SQLite file as disposable; it stores important n8n data.
  • Avoid queue mode on SQLite.

Sources