Skip to content
Daleel Web

AI agents & automation

Common n8n errors on a self-hosted server and how to fix them

Fixes for the n8n problems people hit most on their own servers: out-of-memory crashes, Connection Lost, webhook URLs showing localhost, a full disk and messages that never arrive.

By Daleel Web Editorial TeamPublished 3 min read
Connected workflow nodes illustrating an n8n automation

Running n8n on your own server is reliable once it's set up, but a handful of problems come up again and again. Here's how to recognise and fix each one. The fixes come from n8n's official documentation and assume the Docker Compose setup from our installation guide.

1. "Connection Lost" or the workflow stops mid-way (memory)

What you see: messages such as "Execution stopped at this node (n8n may have run out of memory while executing it)", "Connection Lost" or "503 Service Temporarily Unavailable". In the server logs: "Allocation failed - JavaScript heap out of memory".

Why: a workflow is handling more data than the memory allows. n8n's docs list the usual causes: large JSON or binary data, many nodes, Code nodes, manual executions and several workflows running at once. With Docker, n8n restarts itself, so it can look like a random disconnect.

Fix:

  1. Process data in smaller chunks: use the Loop Over Items node and move heavy parts into a sub-workflow with Execute Workflow.
  2. Avoid the Code node for large datasets where a built-in node can do the job.
  3. Don't test huge datasets with manual runs in the editor.
  4. Give Node.js more memory through an environment variable, then recreate the container:
environment:
  - NODE_OPTIONS=--max-old-space-size=2048

Set the value (in MB) below your server's free RAM, and check usage with docker stats. If memory is simply too small, move to a plan with more RAM.

2. Webhook URLs show localhost:5678

Why: n8n doesn't know its public address.

Fix: set the public URL and recreate the container:

environment:
  - N8N_WEBHOOK_URL=https://n8n.example.com/

On n8n versions before 2.30 the variable is WEBHOOK_URL. Also set N8N_PROXY_HOPS=1 when n8n sits behind one reverse proxy such as Traefik or Nginx.

3. Pages break when n8n runs under a path

What you see: n8n served at example.com/n8n with a reverse proxy, and some screens or folders don't load.

Fix: n8n's docs warn that combining N8N_PATH with a reverse proxy can cause navigation problems. Use a subdomain such as n8n.example.com instead.

4. The disk keeps filling up

Why: execution history is stored in the database.

Fix: n8n prunes old executions by default (EXECUTIONS_DATA_PRUNE=true), keeping data for 336 hours (14 days) and at most 10,000 executions. If your disk is small or your workflows run very often, lower these limits:

environment:
  - EXECUTIONS_DATA_MAX_AGE=168
  - EXECUTIONS_DATA_PRUNE_MAX_COUNT=5000

You can also stop saving successful runs of busy workflows with EXECUTIONS_DATA_SAVE_ON_SUCCESS=none, keeping only errors.

5. Scheduled workflows run at the wrong time

Fix: set your timezone, as in n8n's Docker Compose example:

environment:
  - GENERIC_TIMEZONE=Asia/Riyadh
  - TZ=Asia/Riyadh

6. You can't log in over http://

Why: n8n uses secure cookies, which browsers only send over HTTPS.

Fix: always open n8n through its https:// address. If you haven't set up HTTPS yet, follow the Traefik setup in our installation guide rather than turning the protection off.

7. WhatsApp messages never reach n8n

Why: according to n8n's docs, Meta only sends messages to apps subscribed to your WhatsApp Business Account, and n8n doesn't subscribe it for you. No error appears.

Fix: subscribe the app to the account through Meta's Graph API, as explained in our WhatsApp agent guide.

When to switch to PostgreSQL

Self-hosted n8n uses SQLite by default, which is fine for small setups. If you run many workflows or plan to use queue mode for scaling, move to PostgreSQL (n8n supports versions 16 to 18 as of 2026) using the DB_TYPE=postgresdb settings in n8n's database docs.

Sources & references

  1. n8n docs: Fix memory issues
  2. n8n docs: Executions environment variables
  3. n8n docs: Deployment environment variables
  4. n8n docs: Docker Compose setup