Skip to content

n8n Production Deployment: A Checklist and Queue Mode Guide

A production n8n setup needs a real database, a saved encryption key, correct webhook URLs, backups and, when load requires it, queue mode with workers.

A production n8n deployment needs five things beyond the quick-start install: PostgreSQL instead of the default SQLite, a stored encryption key, HTTPS with correct webhook URLs, backups you have tested, and monitoring. Queue mode with Redis and workers is a sixth step you add when one instance cannot keep up. This guide walks through each, using n8n's official documentation for names and commands.

Environment variable names and defaults change between versions. Treat the values below as a starting point and confirm them against the n8n queue mode documentation for the version you run.

Production readiness checklist

  1. PostgreSQL configured
  2. Encryption key set and backed up
  3. HTTPS and the public URL configured
  4. Execution data pruning configured
  5. Backups and a tested restore
  6. Update procedure and a rollback plan
  7. Monitoring and alerts
  8. Queue mode, only if load requires it

1. Use PostgreSQL

n8n documents SQLite as the default database and PostgreSQL as the other supported option. For production, use PostgreSQL by setting DB_TYPE=postgresdb and the connection settings from the database configuration docs. For queue mode n8n says to use PostgreSQL and states that a distributed setup over SQLite is not supported. The docs also say MySQL and MariaDB are not supported, and the supported database page lists the PostgreSQL versions n8n currently supports.

2. Set and protect the encryption key

n8n encrypts stored credentials with a key. If you do not set N8N_ENCRYPTION_KEY, n8n generates a random key on first launch and keeps it in its data folder (~/.n8n). In production, set it yourself, store it in a secrets manager or equivalent, and keep a copy outside the server. The key is what encrypts your stored credentials, so without it you cannot read them after a rebuild. In queue mode, every worker and webhook processor must use the same key as the main instance.

3. Configure HTTPS and webhook URLs

Run n8n behind a reverse proxy that terminates HTTPS. n8n documents these settings among its deployment variables:

  • N8N_HOST: the host name n8n runs on
  • N8N_PROTOCOL: http or https
  • N8N_PROXY_HOPS: the number of reverse proxies in front of n8n

Webhook URLs are what external services call, so they must be the public address. Behind a reverse proxy n8n cannot work this out from the host, protocol and port settings alone, so you set the webhook URL variable explicitly. The variable name depends on your version: n8n's docs list N8N_WEBHOOK_URL for newer releases and WEBHOOK_URL for earlier ones, so check the page for your version. After changing it, test with a real call from outside your network, because a wrong URL looks fine in the editor and fails in production.

4. Prune execution data

n8n stores execution history, and it grows. These settings are documented:

  • EXECUTIONS_DATA_PRUNE: deletes old execution data on a rolling basis
  • EXECUTIONS_DATA_MAX_AGE: age in hours at which data is deleted
  • EXECUTIONS_DATA_PRUNE_MAX_COUNT: caps how many executions are kept
  • EXECUTIONS_DATA_SAVE_ON_SUCCESS and EXECUTIONS_DATA_SAVE_ON_ERROR: all or none

Decide how much history you need for debugging and compliance with your own policies, then set values to match. Keeping everything forever raises storage and backup size.

5. Back up and test restores

Back up the PostgreSQL database on a schedule and store copies away from the server. Keep the encryption key separately. A backup is only real after you have restored it onto a clean instance and opened a workflow. Put the restore steps in a short runbook.

6. Plan updates and rollback

Pin the n8n image or version instead of following a floating tag, so an update is a decision. Update a copy first, run your critical workflows, then update production. Keep the previous version and a fresh database backup until you are sure.

7. Monitor and alert

At minimum, watch:

  • Whether the service responds
  • Disk and database size
  • Failed executions, using an error workflow that notifies you
  • Certificate expiry

n8n documents the /healthz endpoint (the instance is reachable) and /healthz/readiness (the database is connected and migrated). On workers in queue mode the health endpoint is off by default, and you enable it with QUEUE_HEALTH_CHECK_ACTIVE=true.

8. Queue mode: when and how

By default n8n runs executions in the main process. Queue mode separates concerns. According to the n8n documentation:

  • The main instance receives triggers and webhook calls and queues executions. It also serves the UI and API.
  • Workers pick up queued jobs and run them, and they need access to both Redis and the database.
  • Webhook processors are optional and handle incoming webhook requests behind a load balancer.
  • Redis is the message broker, and main, workers and webhook processors must all be able to reach it.

Core settings

Set the executions mode on the main instance and all workers:

export EXECUTIONS_MODE=queue

Give workers the same encryption key as the main instance:

export N8N_ENCRYPTION_KEY=<main_instance_encryption_key>

Point n8n at Redis with the documented variables, QUEUE_BULL_REDIS_HOST, QUEUE_BULL_REDIS_PORT, QUEUE_BULL_REDIS_USERNAME, QUEUE_BULL_REDIS_PASSWORD and QUEUE_BULL_REDIS_DB. The docs show Redis defaulting to localhost:6379 with no password. Workers need access to the same database and Redis. Check the docs for exactly which settings each process type needs.

Starting workers

The documentation shows the worker command and a concurrency flag:

n8n worker
n8n worker --concurrency=5

The docs state each worker runs 10 jobs in parallel by default and recommend a value of 5 or higher, because very low values across many workers can exhaust the database connection pool. In Docker the same command is passed to the image, for example docker run --name n8n-queue n8nio/n8n worker.

Webhook processors

If webhooks need their own capacity, start processors with n8n webhook and put them behind a load balancer. The docs describe N8N_DISABLE_PRODUCTION_MAIN_PROCESS=true to stop the main instance from handling production webhooks, and advise against putting the main instance in the load balancer pool.

Example: from one instance to queue mode

  1. Start with one instance, PostgreSQL, a saved key, HTTPS, pruning and backups.
  2. Measure: note execution durations, memory use and whether webhook calls are slow during busy periods.
  3. If a single process is the bottleneck, add Redis and one worker, and switch both to EXECUTIONS_MODE=queue.
  4. Run a test workflow, then your critical ones, and confirm the worker picks up jobs.
  5. Add more workers only when measurements show waiting jobs.
  6. Add webhook processors only when incoming webhook volume needs them.

Common mistakes

Running production on SQLite. It is the default and fine for trying n8n out, and a weak base for anything business critical.

Different encryption keys on workers. Workers then fail to decrypt credentials.

Never testing a restore.

Exposing the editor without protection. Restrict access to the UI and keep secrets out of workflows and logs.

Adding workers before fixing a slow workflow. More workers do not fix a bad design.

For wider deployment thinking, Deploy a Claude Code App covers a related path for application code.

How we work with this at LaunchSprintAI

We treat automation as software: version it, review it, monitor it. AI tools help engineers draft configuration and runbooks, and engineers verify every setting against the official docs. If you prefer not to operate the server yourself, see Managed n8n hosting. This guidance stays product-neutral. To plan an automation project, see AI development, how it works or start a project brief.

Frequently asked questions

Do I need queue mode? Not at first. Add it when measurements show one process cannot keep up.

Can I run queue mode on SQLite? The n8n documentation says a distributed setup over SQLite is not supported. Use PostgreSQL.

What is the most important thing to back up? The database and the encryption key, together.

Related reading

Related services

Also on LaunchSprintAI

Our hosting

Built your app with AI? Get it online.

MoodLensAI runs apps made with Claude Code, Codex or Cursor, plus n8n, WordPress and Laravel, on a managed server with HTTPS, backups and monitoring. Fixed monthly plans, no server administration.