// guides · n8n error index

n8n won’t start or you can’t log in? 11 self-hosting errors, tested

The exact messages self-hosted n8n prints when it won’t start, plus the quiet traps: port already in use, wrong Node.js version, permission denied on .n8n, Postgres refused, the secure cookie login error and webhook URLs pointing at localhost or the wrong port. From 11 real runs on n8n 2.43.7.

Updated 2026-10-19 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. Read the first error line, not the last

    Most self-hosting problems stop n8n within seconds, and the useful line is the first one after Initializing n8n process. With Docker, run docker logs <container> (or docker compose logs n8n). The table below lists the exact lines we got, so you can match yours.

  2. Fix “port 5678 is already in use”

    Starting a second n8n on a port that's taken stopped at once with n8n's port 5791 is already in use. Do you have another instance of n8n running already? Stop the other n8n (an old container, a forgotten npx n8n in another terminal) or set another port with N8N_PORT. Careful: when we set N8N_PORT=abc by mistake, n8n gave no error and quietly started on 5678 instead. If n8n isn't on the port you expect, check that the value is a plain number.

  3. Fix Node.js, folder and database errors

    Installed with npm on Node.js 20, n8n 2.43.7 refused to start: Your Node.js version 20.19.2 is currently not supported by n8n. Please use a Node.js version that satisfies the following version range: >=24.0.0. Install Node.js 24 or use the Docker image (n8n now also warns that running outside a container is deprecated). A user folder n8n can't write to gave Error: EACCES: permission denied, mkdir '…/.n8n'; in Docker that usually means the mounted folder belongs to root, and the image runs as the node user (id 1000), so give that user the folder, for example sudo chown -R 1000:1000 ./n8n_data. With Postgres down, n8n retried 5 times (Initial database connection attempt 1 failed: connect ECONNREFUSED 127.0.0.1:5999. Retrying in 1000ms, then 2, 4, 8 and 16 seconds) and then exited with connect ECONNREFUSED, about 30 seconds in. Start the database first and check DB_POSTGRESDB_HOST: inside Docker Compose it's the service name, such as postgres, not localhost.

  4. Fix the “secure cookie” login error

    By default n8n's login cookie is marked Secure: our login response carried Set-Cookie: n8n-auth=…; HttpOnly; Secure; SameSite=Lax. Browsers only keep such a cookie over HTTPS or on localhost, so opening n8n as http://192.168.1.20:5678 or http://your-server:5678 shows Your n8n server is configured to use a secure cookie, however you are either visiting this via an insecure URL, or using Safari. The proper fix is HTTPS (a reverse proxy such as Caddy or Nginx with a certificate). For a home lab you can set N8N_SECURE_COOKIE=false; with it, the same login came back without Secure. Don't do that on a server reachable from the internet.

  5. Make n8n show the right public URL

    n8n builds the links it shows you, including webhook URLs, from N8N_PROTOCOL, N8N_HOST and N8N_PORT. Left alone, it printed Editor is now accessible via: http://localhost:5791, which is why webhook URLs say localhost. With only N8N_HOST=n8n.example.com and N8N_PROTOCOL=https it printed https://n8n.example.com:5793, still with the internal port, which is wrong behind a reverse proxy. With WEBHOOK_URL=https://n8n.example.com/ it printed https://n8n.example.com. Behind a proxy, set WEBHOOK_URL to your public address and copy webhook URLs again after restarting.

What we tested, and what happened

On 19 October 2026 we started self-hosted n8n 2.43.7 11 times with n8n start, each in its own user folder with SQLite unless noted, on Node.js 24.22.0, and changed one thing at a time.

SetupWhat happened
Normal first startReady in about 4 seconds. It printed No encryption key found - Auto-generating and saving to: …/.n8n/config, ran its database migrations, then Editor is now accessible via: http://localhost:5791. The config file was created readable by its owner only (-rw-------).
Node.js 20.19.2 (npm install)Refused to start: Your Node.js version 20.19.2 is currently not supported by n8n. It needs 24 or newer.
Second n8n on the same portn8n's port 5791 is already in use. Do you have another instance of n8n running already?, exit code 1.
N8N_PORT=abcNo error. Started on 5678.
User folder not writableError: Failed to load command "start" then Error: EACCES: permission denied, mkdir '…/.n8n'.
Postgres not running5 retries, 1 to 16 seconds apart, then connect ECONNREFUSED 127.0.0.1:5999 and exit code 1.
Default login cookieHttpOnly; Secure; SameSite=Lax: dropped by browsers on plain http unless it's localhost.
N8N_SECURE_COOKIE=falseSame cookie without Secure.
Nothing setURL shown: http://localhost:5791.
N8N_HOST + N8N_PROTOCOL=https onlyURL shown: https://n8n.example.com:5793 (internal port added).
WEBHOOK_URL=https://n8n.example.com/URL shown: https://n8n.example.com.

Health checks for Docker and uptime monitors

/healthz answered {"status":"ok"} as soon as the web server was up. Right then, /healthz/readiness still answered {"status":"error"}, and it switched to ok a few seconds later. Point a Docker healthcheck or a load balancer at /healthz/readiness if it should wait until n8n can really serve requests. To get an alert when a workflow stops running, see alert when a cron job or n8n workflow stops.

Quick checklist

Good to know

What we didn't test

FAQ

Why does n8n say the port is already in use?

Another program, usually a second n8n or an old container, already listens on that port. n8n 2.43.7 stops with "n8n's port 5678 is already in use. Do you have another instance of n8n running already?" Stop the other one or set N8N_PORT to a free port.

How do I fix the n8n secure cookie error?

The login cookie is marked Secure, so browsers only keep it over HTTPS or on localhost. Put n8n behind HTTPS, or on a private network set N8N_SECURE_COOKIE=false and restart n8n.

Why do my n8n webhook URLs show localhost?

n8n builds them from N8N_PROTOCOL, N8N_HOST and N8N_PORT, which default to http, localhost and 5678. Set WEBHOOK_URL to your public address, for example https://n8n.example.com/, restart, and copy the webhook URLs again.

How do I fix EACCES permission denied in n8n Docker?

The folder mounted at /home/node/.n8n isn't writable by the node user (id 1000) the image runs as. Change its owner, for example sudo chown -R 1000:1000 ./n8n_data, then start the container again.

Which Node.js version does n8n need?

n8n 2.43.7 refused to start on Node.js 20.19.2 and asked for 24.0.0 or newer. It ran fine on Node.js 24.22.0.

Related guides

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.