Steps
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, rundocker logs <container>(ordocker compose logs n8n). The table below lists the exact lines we got, so you can match yours.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 forgottennpx n8nin another terminal) or set another port withN8N_PORT. Careful: when we setN8N_PORT=abcby 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.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 gaveError: EACCES: permission denied, mkdir '…/.n8n'; in Docker that usually means the mounted folder belongs to root, and the image runs as thenodeuser (id 1000), so give that user the folder, for examplesudo 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 withconnect ECONNREFUSED, about 30 seconds in. Start the database first and checkDB_POSTGRESDB_HOST: inside Docker Compose it's the service name, such aspostgres, notlocalhost.Fix the “secure cookie” login error
By default n8n's login cookie is marked
Secure: our login response carriedSet-Cookie: n8n-auth=…; HttpOnly; Secure; SameSite=Lax. Browsers only keep such a cookie over HTTPS or on localhost, so opening n8n ashttp://192.168.1.20:5678orhttp://your-server:5678showsYour 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 setN8N_SECURE_COOKIE=false; with it, the same login came back withoutSecure. Don't do that on a server reachable from the internet.Make n8n show the right public URL
n8n builds the links it shows you, including webhook URLs, from
N8N_PROTOCOL,N8N_HOSTandN8N_PORT. Left alone, it printedEditor is now accessible via: http://localhost:5791, which is why webhook URLs say localhost. With onlyN8N_HOST=n8n.example.comandN8N_PROTOCOL=httpsit printedhttps://n8n.example.com:5793, still with the internal port, which is wrong behind a reverse proxy. WithWEBHOOK_URL=https://n8n.example.com/it printedhttps://n8n.example.com. Behind a proxy, setWEBHOOK_URLto 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.
| Setup | What happened |
|---|---|
| Normal first start | Ready 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 port | n8n's port 5791 is already in use. Do you have another instance of n8n running already?, exit code 1. |
N8N_PORT=abc | No error. Started on 5678. |
| User folder not writable | Error: Failed to load command "start" then Error: EACCES: permission denied, mkdir '…/.n8n'. |
| Postgres not running | 5 retries, 1 to 16 seconds apart, then connect ECONNREFUSED 127.0.0.1:5999 and exit code 1. |
| Default login cookie | HttpOnly; Secure; SameSite=Lax: dropped by browsers on plain http unless it's localhost. |
N8N_SECURE_COOKIE=false | Same cookie without Secure. |
| Nothing set | URL shown: http://localhost:5791. |
N8N_HOST + N8N_PROTOCOL=https only | URL 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
- “port … is already in use”? Another n8n or container is running; stop it or change
N8N_PORT(a number). - “Node.js version … is currently not supported”? Use Node.js 24 or the Docker image.
- “EACCES: permission denied”? Give the folder to user 1000 (Docker) or to the user running n8n.
- “Initial database connection attempt … failed”? Start Postgres first and check the host name.
- “configured to use a secure cookie”? Use HTTPS, or
N8N_SECURE_COOKIE=falseon a private network only. - Webhook URLs say localhost or show a port? Set
WEBHOOK_URLto your public address.
Good to know
- n8n starts but you cannot log in? n8n forgot password or locked out.
- Community node missing or
Unrecognized node type? n8n community nodes: install errors and missing packages. - n8n died with
JavaScript heap out of memory? Which setting to raise is in n8n out of memory errors. - Lost your credentials after recreating a container? That's the encryption key: see n8n “Credentials could not be decrypted”.
- Webhook answers 404? See n8n webhook not working. Schedules that don't fire after a move: Schedule Trigger not working.
What we didn't test
- Docker itself (we reproduced its folder permission case with a folder n8n couldn't write to), a real reverse proxy and its WebSocket “Connection lost” issues, wrong Postgres passwords, queue mode with Redis, and n8n Cloud.
Start from a working agent
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
- n8n MySQL node errors: Access denied, SSL and SQL fixes, 41 runs
- n8n Postgres node errors: connection, SQL and insert fixes, 33 runs
- n8n community nodes: Unrecognized node type and install errors, tested
- n8n OAuth2 redirect_uri_mismatch and callback errors: 18 tests, fixed
- n8n “Connection lost” behind a reverse proxy? 15 Nginx setups tested
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes