Secure a self-hosted n8n server in this order. Update it promptly. Keep the editor and its webhooks behind HTTPS and a login. Protect the encryption key that guards your saved credentials.
Updates come first because n8n fixes security flaws often. Its GitHub page lists 211 security advisories from 2026 up to 27 October, 19 of them rated critical.
We also read what four hosts' own pages say their ready-made n8n servers set up. Two say the editor comes with HTTPS, and none of the four mentions a firewall, so check the open ports yourself. Every step below links to n8n's own documentation, read on 27 October 2026.

Who this is for
- you run n8n yourself, or are about to, on a VPS or in Docker
- you connect it to e-mail, payment or company accounts and want those credentials safe
- you are deciding whether a managed plan is worth it for security alone
Not for you if you use n8n Cloud: n8n runs the server for you, and only the workflow-level advice applies.
Key numbers
- 211 advisories security advisories on n8n's GitHub page from 2026, up to 27 October Official page,
- 19 critical of those rated critical, most of them able to run code on the server Official page,
- 2.45.4 version the stable n8n version named in n8n's documentation on 27 October 2026; 3.0 was in pre-release Official page,
- 2.12.0 version the first n8n release with SSRF protection, which you switch on yourself Official page,
What can go wrong, in plain words
n8n holds the keys to everything it connects: e-mail accounts, payment services, databases and AI providers. Someone who reaches the editor, or a flaw that lets them run code on the server, reaches those keys too.
- an old version: most critical advisories this year let an attacker run code on the server. Each was fixed in a release, so a server that is not updated keeps the hole open
- an editor open to the internet over plain HTTP, or on its own port 5678, past the firewall
- a webhook with no authentication that starts a workflow anyone can trigger
- the encryption key lost or leaked: without it, a backup of your credentials cannot be read; with it, anyone can read them
- nodes that run commands or touch files, used by people who should not have that power
Step 1: update promptly, with a backup you have restored
n8n publishes fixes for the current release line and, for now, the 1.x line too. Pick one line and update within days of a security release. The dated list below shows why. Before each update, take a backup that includes the encryption key, as our guide to installing n8n with Docker explains. Restore it once somewhere else, so you know it works.
Examples of n8n security advisories rated critical, from its GitHub page (read 27 Oct 2026)
- Remote code execution through expression injection (fixed from 1.122.0).
- Files readable without a login through improper webhook request handling, rated 10 out of 10 (fixed in 1.121.0).
- Five critical fixes on one day, among them sandbox escapes in the Code node and the task runner (2.10.1, 2.9.3 and 1.123.22).
- Remote code execution through the XML parser of incoming webhooks (fixed in 2.18.1, 2.17.4 and 1.123.32).
- Three more, including the HTTP Request node's pagination (fixed in 2.22.1, 2.20.7 and 1.123.43).
- 10 advisories on one day, three rated high, including stored cross-site scripting through webhook responses.
Step 2: HTTPS and a login in front of the editor
n8n listens on port 5678. Its documentation recommends a reverse proxy, such as Traefik or Caddy, that serves HTTPS and renews the certificate; n8n itself then stays on the server. Two checks matter:
- from outside, only ports 22, 80 and 443 should answer: port 5678 must not
- if n8n runs in Docker, publish its port on 127.0.0.1 only (
127.0.0.1:5678:5678), because Docker opens a published port on every address, past a ufw firewall
Then turn on two-factor authentication for every user, and as owner enforce it in the security policies. Create the owner account straight after the install. Hostinger's n8n template, for example, asks for it on the first visit to the address, so the first person to open it sets it up.
bash
# from another computer: only 22, 80 and 443 should be open
nmap -Pn -p 22,80,443,5678 n8n.example.com
# in docker-compose.yml: keep n8n on the server itself
# ports:
# - "127.0.0.1:5678:5678"Step 3: decide which webhooks the internet may reach
A webhook is an address that starts a workflow when something calls it, so it must be public to work. Give each one authentication: the Webhook node offers basic auth, header auth, JWT auth and n8n user auth, or None. Use None only when the caller cannot send a secret, and then check the incoming data inside the workflow.
Behind a proxy, set the public address with N8N_WEBHOOK_URL, which replaced WEBHOOK_URL in n8n 2.35.0. Otherwise the webhook addresses n8n shows point at the wrong place.
Step 4: protect the encryption key and your credentials
n8n encrypts saved credentials with a key. On a server you control, set it yourself with N8N_ENCRYPTION_KEY. Keep a copy outside the server and put it in every backup: a backup restored with a different key leaves every credential unreadable. From n8n 3.0 the owner can rotate the data key under Settings, Data Encryption Keys; on 2.x this needs N8N_ENV_FEAT_ENCRYPTION_KEY_ROTATION=true first.
- give each workflow its own credentials, with the narrowest rights the provider allows
- remove credentials no workflow uses: the security audit lists them
- keep the server's own login for admins only, with SSH keys instead of passwords
Step 5: switch off what you do not use
- the public API:
N8N_PUBLIC_API_DISABLED=true, and its playground withN8N_PUBLIC_API_SWAGGERUI_DISABLED=true. n8n recommends this when you do not use the API - nodes that run commands or touch files:
NODES_EXCLUDEblocks them. Execute Command is already blocked by default - requests to your private network from workflows:
N8N_SSRF_PROTECTION_ENABLED=true(from n8n 2.12.0) blocks private, loopback and link-local addresses unless you allow them - Code node isolation: run task runners in external mode, in their own container, as n8n's hardening page describes
bash
N8N_PUBLIC_API_DISABLED=true
N8N_PUBLIC_API_SWAGGERUI_DISABLED=true
NODES_EXCLUDE='["n8n-nodes-base.executeCommand","n8n-nodes-base.readWriteFile"]'
N8N_SSRF_PROTECTION_ENABLED=trueAI steps can also run up a bill. Set a spending limit at the model provider, as our guide to AI spending limits shows.
Check it: n8n's own security audit
n8n can audit itself. Run n8n audit on the server, or use the n8n node with Resource Audit. It reports unused credentials, risky SQL expressions, nodes that touch the file system or run code, unprotected webhooks, missing security settings and an outdated version. Run it after each change and after each update.
bash
n8n audit
# in Docker:
docker exec -it n8n n8n auditWhat the hosts' ready-made n8n servers set up, by their own pages
Four of the hosts we cover install n8n for you. The table shows what each host's own pages say, read on 27 October 2026. Where a page says nothing, check it on your server.
Only Contabo's pages describe HTTPS and a reverse proxy in full; none mentions a firewall, so check the open ports after the install.
| Host | How n8n runs | HTTPS | Owner account | Updates | Firewall |
|---|---|---|---|---|---|
| Hostinger | in Docker; settings in /docker/n8n/docker-compose.yml | an https address; the page does not say how it is set up | created on the first visit | you run docker compose pull, down and up | not mentioned |
| Contabo | Docker Compose in /opt/n8n, with Caddy as the reverse proxy | yes, a Let's Encrypt certificate | one password, set at the order, for the server and the app | your job, its help page says | not mentioned |
| DigitalOcean | a 1-Click app on Ubuntu 24.04 from an outside vendor, Automaze | not stated on the listing | not stated | not stated | not mentioned |
| Kamatera | a marketplace image | not stated on the pages we found | not stated | not stated | not mentioned |
| Plan | Price | New-customer offer | Link |
|---|---|---|---|
| Hostinger KVM 1 1 vCPU, 4 GB | $6.49/month 24-month term, paid up front; Black Friday first-term price, then $11.99 checked 25 Oct 2026 | Black Friday prices on VPS plans and AI automation apps, for the first subscription term only checked 30 Oct 2026 | Visit |
| Hostinger KVM 2 2 vCPU, 8 GB | $8.79/month 24-month term, paid up front; Black Friday first-term price, then $14.99 checked 25 Oct 2026 | Black Friday prices on VPS plans and AI automation apps, for the first subscription term only checked 30 Oct 2026 | Visit |
| DigitalOcean Basic Droplet, 2 vCPUs, 4 GiB 2 vCPU, 4 GB | $24/month billed per second (60-second minimum), capped at this monthly price · VAT not stated checked 25 Oct 2026 | New accounts get a $5 credit that lasts 90 days and covers every product except SaaS add-ons checked 29 Oct 2026 | Visit |
| Kamatera Cloud server Type B (General Purpose), 2 cores, 4 GB 2 vCPU, 4 GB | $39/month monthly, no long-term contract · VAT not stated checked 25 Oct 2026 | A 30-day trial of one cloud server in a configuration worth up to $100 checked 29 Oct 2026 | Visit |
| Contabo Cloud VPS 4 4 vCPU, 8 GB | €4.40/month 24-month term, paid up front; the price applies to the first 24 months and to the EU region in Germany; other regions cost more each month checked 25 Oct 2026 | No offer | Visit |
Some of the lowest prices need a long term paid in advance; the term and any renewal price are under each price.
What managed n8n and n8n Cloud take off your hands
On n8n Cloud, n8n runs, updates and secures the server; you still choose who gets access and how each webhook is protected. A managed plan from a hosting company sits in between. ScalaHosting's managed n8n, by its own page, runs PostgreSQL with a Redis queue, takes daily off-site backups and can install n8n updates for you.
| Plan | Price | New-customer offer | Link |
|---|---|---|---|
| n8n Cloud Starter | €20/month yearly plan, paid up front for 12 months and not refundable; works out at this price per month checked 25 Oct 2026 | Free trial of n8n Cloud with Pro-level features and no card needed checked 29 Oct 2026 | Visit |
| n8n Cloud Pro | €50/month yearly plan, paid up front for 12 months and not refundable; works out at this price per month (the 10,000-executions-a-month option) checked 26 Oct 2026 | Free trial of n8n Cloud with Pro-level features and no card needed checked 29 Oct 2026 | Visit |
Prices exclude taxes. A free trial without a card is capped at 1,000 executions.
The checklist on one page
- Update within days of a security release, after a backup that includes the encryption key.
- Serve the editor over HTTPS through a reverse proxy; keep port 5678 closed to the internet.
- Turn on two-factor authentication for every user and create the owner account at once.
- Give every webhook authentication, or check its input inside the workflow.
- Set your own encryption key, keep a copy off the server, and rotate it on n8n 3.0 or later.
- Turn off the public API, block command and file nodes, and turn on SSRF protection.
- Run
n8n auditafter each change and after each update.
Mistakes to avoid
Leaving updates for later
Instead: Most critical flaws this year were fixed within a release: update within days.
Backing up without the encryption key
Instead: Credentials restored with another key cannot be read.
Publishing port 5678 in Docker
Instead: Use 127.0.0.1:5678:5678 behind a reverse proxy.
Webhooks with no authentication
Instead: Use header or JWT auth, or check the input inside the workflow.
How we checked
We read n8n's security documentation and the hosts' pages on 27 October 2026. On the same day we counted n8n's security advisories through GitHub's own interface. Our own measurements will be added here, with their dates, when our test bench runs them.
Other questions
Is self-hosted n8n secure?
It can be, if you update promptly and keep the editor behind HTTPS and a login. The biggest risk is an old version, because security fixes arrive often.
Where does n8n keep the key that encrypts credentials?
Set it yourself with N8N_ENCRYPTION_KEY and keep a copy off the server. Without the same key, a restored backup cannot read its credentials.
Should the n8n editor be reachable from the internet?
Only through HTTPS and a login, with two-factor authentication. Port 5678 itself should stay closed.
Sources and test notes
- n8n: security settings, read
- n8n: run security audits, read
- n8n: disable the public API, read
- n8n: SSRF protection, read
- n8n: block specific nodes, read
- n8n: rotate encryption keys, read
- n8n: set up SSL, read
- n8n: harden task runners, read
- n8n: Webhook node, read
- n8n security advisories on GitHub, read
- n8n releases on GitHub, read
- Docker: port publishing, read
- Hostinger: how to use the n8n VPS template, read
- Contabo: what is n8n and how do I use it on Contabo, read
- Contabo: how to update your self-hosted n8n instance, read
- DigitalOcean Marketplace: n8n, read
- Kamatera: what can I do with n8n on Kamatera, read
- ScalaHosting: managed n8n, read
Every page read on 27 October 2026.