Most n8n errors on a Hostinger VPS fall into a handful of known categories: 502 Bad Gateway from the reverse proxy, “connection lost” in the editor, webhook URLs that are unreachable from outside, and the container stopping after a server restart. All of them have documented fixes, and none of them usually require rebuilding your server from scratch.
This guide covers the errors n8n users hit most often when self-hosting on a Hostinger KVM VPS, with the fix for each framed exactly the way n8n’s own documentation and the community document it. If you have not installed n8n yet, the managed route skips all of this: runs n8n as a one-click managed app with no server to maintain.
AI Automation Plan
24 mo
Renews at $11.99/mo
- Extra 20% off via our link
Error 1: 502 Bad Gateway when opening n8n
A 502 in the browser almost always means the reverse proxy (Nginx or Traefik, depending on your setup) cannot reach the n8n container. The most common causes, in order: the n8n container is not running, it is listening on a different port than the proxy expects, or the server just restarted and the container has not come back up.
Fix it step by step:
- SSH into the VPS and run
docker ps. If the n8n container is missing, it has stopped — see Error 4. - Check the container logs with
docker logs n8n(replacen8nwith your container name) and look for crash messages or port conflicts. - Verify the port mapping. n8n listens on port 5678 inside the container; the proxy must forward to that port. If you changed
N8N_PORT, the proxy config must match. - If you use a domain, confirm the DNS A record still points at the VPS IP address. A changed IP after a server rebuild is a classic silent cause of 502s.
Error 2: “Connection lost” in the n8n editor
The n8n editor keeps a WebSocket connection open to the backend for live execution updates. When that socket drops, the editor shows “connection lost” even though the page itself loads fine. This is almost always a proxy or protocol problem, not an n8n bug.
The documented fixes:
- HTTPS is required. Browsers block insecure WebSocket (
ws://) connections from anhttps://page. If your n8n is served over plain HTTP, set up HTTPS (Hostinger’s VPS templates and the managed app both support it) and the editor reconnects. - Proxy must forward WebSockets. In Nginx this means the
UpgradeandConnectionheaders are passed through to n8n. The one-click Docker template ships with this configured; if you wrote your own Nginx config, compare it against n8n’s documented server-setup example. - Set WEBHOOK_URL correctly. n8n needs to know its own public URL. Set the
WEBHOOK_URLenvironment variable (andN8N_HOST) to your full public domain, e.g.https://n8n.yourdomain.com. A mismatch here breaks both the editor socket and webhooks. - Cloudflare proxying. If your domain runs through Cloudflare’s orange-cloud proxy, WebSocket connections usually still work, but Rocket Loader and aggressive caching rules can interfere. n8n’s docs recommend excluding the n8n subdomain from such optimizations.
Error 3: Webhooks not reachable from outside
You click “Listen for test event” or call the production webhook URL and nothing arrives. Walk through this checklist:
- Test vs production URLs differ. In test mode n8n listens on a temporary URL; the permanent production URL only works after you activate the workflow (toggle it on in the top right). This catches almost everyone once.
- WEBHOOK_URL must be the public URL. If n8n thinks its URL is
localhost:5678, the URLs it generates will not work from outside. SetWEBHOOK_URLto the public domain as described above, then restart the container. - Firewall. Hostinger’s VPS firewall (hPanel > VPS > Firewall) must allow inbound traffic on ports 80 and 443. If you locked the firewall down to SSH only, webhooks from external services cannot reach n8n.
- DNS. The subdomain in the webhook URL must resolve to the VPS. Check with any DNS lookup tool; allow for propagation time after changes (usually minutes, occasionally hours).
- HTTPS redirect loops. If the proxy forces HTTPS but n8n is configured for HTTP, external services may follow the redirect and fail. Keep the protocol consistent end to end.
Error 4: Container stops or will not survive a restart
If n8n runs fine until the VPS reboots and then never comes back, the container is missing a restart policy. The documented fix is to add --restart unless-stopped to the docker run command, or restart: unless-stopped in the docker-compose service definition, then recreate the container.
If the container stops on its own while running, the usual suspect is memory. n8n with a few active workflows comfortably fits in 4 GB RAM, but large binary files (spreadsheets, images, PDFs) processed in memory can push a small VPS over the edge. Check with docker stats during a heavy run. If memory pressure is the cause, the honest fix is a bigger plan —
VPS KVM 2
24-month plan, paid upfront
Renews at $14.99/mo
- 2 vCPU + 8 GB RAM
- 100 GB NVMe storage
- 8 TB bandwidth
- Full root access
- n8n one-click template available
Error 5: SQLite database locked or corrupt
The default Docker setup stores n8n’s data in SQLite. Under heavy concurrent load you can hit “database is locked” errors. n8n’s documentation treats this as expected behavior for SQLite at scale, and the documented fix is migrating to Postgres. For most personal and small-team setups SQLite is fine; if you see locking regularly, that is the signal your usage has outgrown it.
One related gotcha: make sure the data volume is actually mounted persistently (-v n8n_data:/home/node/.n8n or the compose equivalent). If workflows and credentials vanish after a container recreate, the volume was not mounted and n8n was storing everything inside the disposable container layer.
Error 6: “Problem loading workflow” or nodes failing after an update
After updating the n8n image, an old workflow can fail if a node version changed behavior. n8n’s docs recommend: pin the image tag instead of using latest in production, test updates on a copy first, and keep a backup of the data volume before pulling a new image. If an update breaks something, rolling back to the previous pinned tag restores service in minutes.
When the managed app is the better fix
Every error above assumes you are comfortable with SSH, Docker, and a reverse proxy. If that sentence made you sigh, the managed n8n app exists precisely for you: Hostinger runs the container, the proxy, the updates, and the backups, and you get the same n8n editor. One subscription covers n8n plus OpenClaw, Hermes Agent, and Paperclip, and you can switch between them in hPanel.
FAQ
Why does n8n show 502 Bad Gateway on my Hostinger VPS?
Almost always because the reverse proxy cannot reach the n8n container: the container is stopped, the port mapping is wrong, or DNS no longer points at the VPS. Check docker ps and the container logs first.
How do I fix “connection lost” in the n8n editor?
Serve n8n over HTTPS, make sure the proxy forwards WebSocket upgrade headers, and set the WEBHOOK_URL environment variable to your full public domain. These three cover nearly every case.
Why is my n8n webhook URL not working?
Common causes: using the test URL instead of the production URL (activate the workflow first), WEBHOOK_URL set to localhost, the VPS firewall blocking ports 80/443, or DNS not resolving. Work through them in that order.
How much RAM does n8n need on a VPS?
n8n runs on 1 vCPU / 4 GB RAM for typical personal and small-team workflows. Heavy binary processing or dozens of concurrent executions can exhaust 4 GB; 8 GB (KVM 2) is the comfortable step up, documented by n8n’s own sizing guidance.
Should I use SQLite or Postgres for self-hosted n8n?
SQLite is fine for personal and light team use and is the Docker default. If you see “database is locked” errors under load, n8n’s documentation recommends migrating to Postgres.
Do I even need a VPS for n8n, or is the managed app enough?
The managed app is enough for most users: same editor, no server maintenance, and the plan also includes OpenClaw, Hermes Agent, and Paperclip. Choose the VPS route only if you need root access, custom binaries, or full control over the environment.
