Short answer: start with n8n’s built-in security audit, put the instance behind HTTPS, turn on 2FA, disable the public API if you don’t use it, block risky nodes, enable SSRF protection, and authenticate every webhook. Below are 12 settings to check, each with the exact variable or menu from n8n’s security docs.
Why does n8n security matter?
An n8n instance holds the keys to your other systems: API tokens, OAuth connections, database passwords. Anyone who controls a workflow can often reach every app it connects to, and some nodes can run code on the host. One weak setting can expose far more than the automation tool itself.
The 12 settings at a glance
| # | Setting | How |
|---|---|---|
| 1 | Run the security audit | n8n audit |
| 2 | Stay up to date | Audit flags outdated instances |
| 3 | HTTPS via reverse proxy | Traefik, NLB or similar |
| 4 | 2FA for every user | Settings > Personal > Enable 2FA |
| 5 | Disable unused public API | N8N_PUBLIC_API_DISABLED=true |
| 6 | Block risky nodes | NODES_EXCLUDE |
| 7 | SSRF protection | N8N_SSRF_PROTECTION_ENABLED=true |
| 8 | Authenticate webhooks | Basic, Header or JWT auth |
| 9 | Harden task runners | External mode, distroless, non-root |
| 10 | Own and back up the encryption key | N8N_ENCRYPTION_KEY |
| 11 | Save and keep less execution data | EXECUTIONS_DATA_* |
| 12 | Review telemetry | N8N_DIAGNOSTICS_ENABLED |
1. Run the built-in security audit
n8n can audit itself. Run n8n audit on the CLI, call POST /audit on the public API as the instance owner, or add the n8n node with Resource “Audit” and Operation “Generate”. The report covers five areas: credentials, database, file system, nodes and instance.
It flags unused credentials, expressions inside SQL queries (an injection risk), nodes that touch the file system, risky and community nodes, unprotected webhooks, missing security settings and an outdated instance. Run it first, then work through the rest of this list. Source: Run security audits.
2. Keep n8n up to date
Security fixes only reach you if you update. The audit’s instance report tells you when your version is outdated. Before a major upgrade, take a full backup and read the release notes. The next big one is 3.0; see what breaks in n8n 3.0.
3. Serve n8n over HTTPS
n8n recommends a reverse proxy such as Traefik or a network load balancer in front of n8n, which also handles certificate renewal. Alternatively, pass certificates directly with N8N_SSL_CERT and N8N_SSL_KEY, but then you must renew them yourself (Set up SSL). Our Docker Compose guide includes a reverse proxy.
4. Turn on 2FA for every user
n8n supports 2FA with an authenticator app: Settings > Personal > Enable 2FA, scan the QR code, and save the recovery codes (Require two-factor auth). Make sure the owner account uses it. Enforcing 2FA across the whole instance is listed as an Enterprise feature on n8n’s pricing page, so on other editions ask each user to enable it.
5. Disable the public API if you don’t use it
The public REST API can do much of what the editor does. If you don’t use it, n8n recommends turning it off:
N8N_PUBLIC_API_DISABLED=true
N8N_PUBLIC_API_SWAGGERUI_DISABLED=true
The second line disables the API playground (Disable the public API). If you do use the API, give each integration its own key and revoke keys you no longer need.
6. Block risky nodes
Use NODES_EXCLUDE to stop n8n from loading nodes your users shouldn’t use. n8n suggests starting with Execute Command and Read/Write Files from Disk. Execute Command is blocked by default; leave it that way unless you truly need it (Block specific nodes).
NODES_EXCLUDE: "[\"n8n-nodes-base.executeCommand\", \"n8n-nodes-base.readWriteFile\"]"
7. Enable SSRF protection
From n8n 2.12.0, N8N_SSRF_PROTECTION_ENABLED=true makes n8n check outbound requests from nodes like HTTP Request against blocked ranges, including private networks, loopback and link-local addresses, and it checks redirects and DNS resolution too (Enable SSRF protection). n8n is clear that firewalls and security groups remain your primary defense; this is an extra layer. Keep your database and Redis ports off the public internet as well.
8. Authenticate every webhook
A Webhook node with no authentication accepts requests from anyone who finds the URL. Set Basic auth, Header auth or JWT auth on each production webhook (Webhook credentials). The security audit lists unprotected webhooks, so you can catch the ones you missed. To check a single workflow before you import or share it, paste its JSON into our free n8n workflow checker: it flags unprotected webhooks and hardcoded API keys right in your browser.
9. Harden task runners
Task runners execute Code node scripts. For stronger isolation, n8n recommends running them as sidecars in external mode, using the -distroless image variant, running as the unprivileged nobody user (UID/GID 65532), and using a read-only root filesystem (Harden task runners).
10. Own and back up the encryption key
n8n encrypts stored credentials with a key kept in the .n8n config file, or in N8N_ENCRYPTION_KEY if you set one. Without it, a restored database can’t be decrypted (Back up and restore). Set your own key, store it in a password manager or secret store, and back it up separately from the database. In queue mode, every worker needs the same key.
11. Save and keep less execution data
Execution data can contain personal data and tokens. Save only what you need, for example errors only:
EXECUTIONS_DATA_SAVE_ON_ERROR=all
EXECUTIONS_DATA_SAVE_ON_SUCCESS=none
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=false
Pruning is on by default and removes executions older than 336 hours (14 days) or beyond 10,000 executions; lower EXECUTIONS_DATA_MAX_AGE if you can (Manage execution data). On Enterprise, execution data redaction hides payloads while keeping execution status visible.
12. Review telemetry and outbound connections
Self-hosted n8n sends anonymous telemetry by default. To opt out, set N8N_DIAGNOSTICS_ENABLED=false; to stop version checks, set N8N_VERSION_NOTIFICATIONS_ENABLED=false (Control telemetry). Weigh this against item 2: if you turn off version notifications, set a reminder to check for updates yourself.
Where should you start?
If you only have an hour: run the audit, confirm HTTPS, enable 2FA, authenticate webhooks and back up the encryption key. Then work through the rest. If running a hardened server isn’t something you want to own, compare n8n Cloud vs self-hosted, and size a server with our n8n Cost & Hosting Planner.
Frequently asked questions
How do I run a security audit in n8n?
Run n8n audit from the CLI, call POST /audit on the public API as the instance owner, or use the n8n node with Resource set to Audit and Operation set to Generate. The report covers credentials, database, file system, nodes and instance risks.
Which n8n nodes should I block?
n8n suggests starting with Execute Command and Read/Write Files from Disk, because they can run code or touch files on the host. Block them with the NODES_EXCLUDE environment variable. Execute Command is already blocked by default.
Should I disable the n8n public API?
If you don’t use it, yes. n8n recommends disabling the public REST API to improve security. Set N8N_PUBLIC_API_DISABLED=true, and N8N_PUBLIC_API_SWAGGERUI_DISABLED=true to turn off the API playground.
How do I protect n8n webhooks?
Set authentication on each Webhook node. n8n’s Webhook credentials support Basic auth, Header auth and JWT auth. The security audit’s instance report lists unprotected webhooks so you can find the ones you missed.
What happens if I lose the n8n encryption key?
You lose access to stored credentials. n8n encrypts credentials in the database, and without the key from the .n8n config file or your custom N8N_ENCRYPTION_KEY, a restored database can’t be decrypted. Back the key up separately.
Sources
n8n Docs: Security overview, Security audit, SSL, 2FA, Public API, Block nodes, SSRF protection, Webhook credentials, Task runners, Backup, Execution data, Telemetry; n8n pricing. Read 26 October 2026. This checklist is based on official documentation, not a penetration test.
