n8n self-host: SQLite or Postgres for a five-person team, and when does queue mode become necessary?Solved

QuestionsRachel Jin3 repliesThis topic is about n8n-io/n8n

3

Jump to the accepted answer

Rachel JinMember#1

Reviewing the n8n page, the self-hosting section raises two questions the README does not settle for a small team.

Database. The default is SQLite. The docs say Postgres is recommended for production. For five people running maybe a few hundred executions a day, does SQLite actually fail, or is "recommended" about scale we will not reach? Switching later means a migration, so I would rather choose once.

Queue mode. n8n can run as a main process plus workers with Redis in between (EXECUTIONS_MODE=queue). Everything about it sounds like a thing for busy installations. Is there a signal that tells you it is time, or a rule of thumb for when a single process stops being enough?

Also curious whether there is anything else in the environment variables that a small deployment tends to regret not setting on day one.

3 replies

HermanMember#2

Accepted answer

Postgres from day one, even for five people. Not because SQLite breaks at your volume (it would not) but because of three smaller things: execution data grows fast and SQLite gets slow to vacuum; backups of a running SQLite file are fiddly, while pg_dump is boring; and every n8n upgrade note assumes Postgres. The switch later is a documented export/import, but you will do it on a day you did not plan to. DB_TYPE=postgresdb plus the DB_POSTGRESDB_* variables is all it takes.

Queue mode is for when executions wait on each other. The signal is simple: workflows that used to finish in seconds start to finish in minutes while CPU on the box is not the problem. That is the single process serialising. Five people with a few hundred executions a day will not see it. When you do, EXECUTIONS_MODE=queue, a Redis, and one or more n8n worker processes, and the main process stops executing and only schedules.

Day-one variables people regret: EXECUTIONS_DATA_PRUNE=true with EXECUTIONS_DATA_MAX_AGE so the executions table does not grow forever; N8N_ENCRYPTION_KEY set explicitly and backed up, because credentials are encrypted with it and losing it means re-entering every credential; and WEBHOOK_URL set to the public address if you sit behind a proxy, or webhook nodes will show the wrong URL.

NicholasMember#3

One non-technical point for the record, since you are choosing for a team: n8n's licence is the Sustainable Use License, not an OSI licence. Internal use at a company is fine; offering it to your customers as a hosted service is not without their terms. If that is ever the plan, /compare/activepieces-vs-n8n is worth a read because Activepieces is MIT for the core, and /compare/dify-vs-n8n covers the other common alternative.

Rachel JinAuthorMember#4

In reply to Herman (#2)

Postgres, prune, encryption key backed up, webhook URL set. That is the checklist I wanted. Accepting this. The licence note is going on the page too.