Self hosting n8n for business: free to start, real work to run
Self hosting n8n for business gives you something hosted tools cannot: every workflow, credential and execution log sits in infrastructure you control, and you are not metered per run. It also hands you a small production system to look after. A database, a reverse proxy, backups, a secret that must never be lost, and a monthly update habit all become yours. n8n says as much in its own Docker guide: it recommends self-hosting for expert users, because mistakes can lead to data loss, security issues and downtime.
If you have already leaned toward n8n and want to know what the work actually is, the parts come in the order they bite: the licence, where to host, the database, scaling, the encryption key, backups, updates, security, monitoring, data law, running cost, who should run it, and a go-live checklist. Still choosing between platforms? Start with Zapier, Make or n8n: which one fits the job, then come back. Claims about n8n come from its official documentation, linked where they appear.
Does the licence cover what you plan to do?
Settle this before anything else, because it decides how the whole engagement is structured. n8n is not open source in the OSI sense. Its licence page says it uses the Sustainable Use License, a fair-code licence, and that the licence allows you the free right to use, modify, create derivative works and redistribute, with three limitations. In n8n's words:
- "You may use or modify the software only for your own internal business purposes or for non-commercial or personal use."
- "You may distribute the software or provide it to others only if you do so free of charge for non-commercial purposes."
- "You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software."
The licence FAQ turns that into practical cases. The sentence that matters most for a business: if workflows are only created or modified by you or people in your organisation, you can use n8n under the Community licence for free. The FAQ also says the Community licence applies to the self-hosted version only; n8n Cloud is a paid subscription with its own terms.
| What you want to do | What the FAQ says |
|---|---|
| Run your own company's automations on your server | Allowed, as use to help run your business |
| Build automations for clients on your instance | Allowed, as long as clients cannot create or edit them |
| Charge clients for building, setting up, maintaining, training or consulting | Allowed |
| Install and manage n8n on a client's own server | Allowed, provided you are not also hosting it for them |
| Use n8n behind your own product, with only your backend talking to it | Allowed, with end users never configuring workflows |
| Host n8n so clients can log in and build their own workflows | Not allowed |
| Let external end users configure workflows through your product, by custom UI, API, MCP or an AI agent | Not allowed |
| White-label n8n or fork it to launch your own automation product | Not allowed |
| Use features that ask for a licence key without an Enterprise licence | Not allowed |
Two practical consequences. First, for agencies and in-house teams alike, the deciding factor in n8n's FAQ is who controls the workflow logic, not how many clients or how much revenue. A single instance can serve many clients if they only receive outputs. Second, if a client wants to open the editor and change flows themselves, the clean route is an instance or Cloud subscription in the client's own name, or a commercial agreement with n8n. The licence FAQ lists license@n8n.io for licensing questions and sales@n8n.io for commercial licences. Whenever your case is not clearly in the table, write to them before you build.
Paid features are separate. The editions page lists what the free Community edition leaves out: custom variables, environments, external secrets, external storage for binary data, log streaming, multi-main mode, projects, SSO, workflow and credential sharing, and Git version control. Those unlock with a Business or Enterprise licence key. A key-based edition needs to reach n8n's licence server, which the licence activation page says is hosted on Cloudflare, so you allowlist Cloudflare's address ranges. For air-gapped environments n8n can issue a licence certificate instead of a key.
Which hosting option fits?
n8n recommends Docker for most self-hosting needs, and its install options cover a one-line setup, Docker, Docker Compose, npm and cloud providers. Its cloud provider guides include Docker Compose on a plain virtual server, Google Cloud Run, and Kubernetes starting points for AWS, Azure and Google Kubernetes Engine, plus an AWS Terraform module for a highly available setup.
| Option | Who it suits | What you carry |
|---|---|---|
| One virtual server, Docker Compose, PostgreSQL | One business, a handful of production workflows | Server patching, proxy, backups, updates |
| Same stack plus Redis and workers (queue mode) | Webhook bursts, many parallel or long executions | Everything above plus Redis and worker health |
| Kubernetes or Terraform template on a major cloud | Teams that already run containers and want high availability | A platform team's worth of operations |
| n8n Cloud (managed by n8n) | Teams that do not want to run servers | n8n's terms and its hosting location |
Pick the cloud region deliberately. Where the server runs decides where workflow payloads and execution logs are stored, which matters for the data section below. n8n's pricing page says its own hosted plans store data in the EU, in Frankfurt, while self-hosted data stays wherever you host it. A cloud provider region in India is a straightforward choice for an Indian business.
Keep the n8n tunnel out of production. The Docker guide describes a cloudflared tunnel for local development and says it is not safe to use in production. Production gets a real domain, TLS and a reverse proxy.
Move off SQLite before you depend on it
By default n8n uses SQLite, stored in a file in its user folder. n8n also supports PostgreSQL, and its database guide sets the support policy: the latest two actively maintained PostgreSQL major versions plus one more for compatibility, with the advice to run the latest minor release of your major. Aurora PostgreSQL is marked experimental, and PostgreSQL-compatible derivatives such as AlloyDB, CockroachDB and YugabyteDB are not supported. The page also lists TLS options for the database connection, including validating the server certificate, so use them when the database is on a separate host.
For a business instance, start on PostgreSQL. Three reasons come straight from the docs. Queue mode with SQLite is not recommended. Backups are cleaner when the database is a separate service. And the execution history that fills the database needs managing either way.
Execution data is the part people forget. The execution data guide warns that, depending on settings and volume, the database can grow until it runs out of storage. n8n recommends not saving unnecessary data and enabling pruning. You can save only failed executions, skip successful ones, and configure this per workflow in workflow settings. Pruning is on by default and removes finished executions once an age or count limit is crossed, and annotated executions, such as those with tags or ratings, are never pruned. Check the defaults against your retention needs and tune them early. It controls both disk growth and how long personal data sits in your logs.
Queue mode and scaling
In regular mode one n8n process receives triggers and runs executions. The concurrency guide notes that in regular mode n8n does not limit how many production executions run at once, which can degrade the event loop and make the instance unresponsive. You can set a production concurrency limit; executions over the limit wait in a first-in, first-out queue. That is the cheap first step.
The next step is queue mode. The main instance handles timers and webhook calls and creates an execution, but does not run it. It passes the execution ID to Redis, a worker picks it up, reads the workflow from the database, runs it, writes the result back and tells Redis it is finished. You scale by adding or removing workers. Four details from that page decide whether it works:
- Every worker, and any webhook processor, must share the main instance's encryption key, otherwise workers cannot read credentials from the database.
- Workers need access to both Redis and the database.
- Queue mode does not support binary data stored on the filesystem. For workflows that persist files, the documented route is S3 external storage, and the editions page lists external binary storage among the paid features.
- Workers expose optional health endpoints, which you turn on with a variable.
The editions page also notes that queue mode itself is included in the Community edition, while multi-main mode, which runs more than one main instance, is a paid feature. Most small and mid-size businesses never need multi-main. They need Postgres, a sensible concurrency limit and, if webhook traffic is bursty, queue mode with two workers.
Move when you see these symptoms: slow editor response while executions run, webhook calls timing out because the process is busy, or one long workflow starving the rest. Each one means execution should move off the process that receives webhooks.
Credentials and the encryption key
n8n stores the credentials your workflows use, such as WhatsApp tokens, Google logins, payment keys and database passwords, and encrypts them before saving. The encryption key guide says n8n creates a random key on first launch and keeps it in the user folder, and that you can supply your own through the N8N_ENCRYPTION_KEY variable. Do that from day one, and in queue mode every worker needs the same value.
The consequence is blunt, and the backup guide states it: without the encryption key, a restored database or encrypted credential export cannot be decrypted. A database backup alone does not save you. Treat the key like a root password. Store it in the company password manager or a secrets service, separate from the server and from the backups it unlocks, with a named owner.
n8n also supports key rotation on self-hosted editions: the instance key stays fixed and protects a separate data encryption key that you rotate. The page carries a firm warning. Once n8n writes data in the new format, older versions cannot read it, so you do not downgrade n8n afterwards, you take a full database backup first, and you try the change on staging. The page says rotation becomes the default from n8n 3.0. That makes pre-upgrade backups mandatory.
Backups that actually restore
A complete backup of a self-hosted instance has two parts, per the backup guide. The first is the user folder, which holds the config file with the encryption key and, with SQLite, the database file itself. The second is your external database if you use PostgreSQL, backed up with the database's own tools. Add external storage for binary or execution data if you configured it, and any custom node directories.
Details that catch people:
- With SQLite, stop n8n before copying the folder, or use a tool that takes a consistent snapshot of the file.
- In Docker, the user folder lives in a volume. A backup directory inside the container is not persisted, so bind-mount a host directory.
- The CLI export commands save workflows and credentials only. They exclude users and roles, execution history, variables and instance settings including the encryption key. They are good for moving workflows, and not enough on their own to recover an instance.
- Imported workflows are deactivated by default, and a restored credential needs the original key or a plain-text export. A plain-text export contains every secret, so delete it after the restore.
A backup you have not restored is a hope. Once a quarter, restore into a scratch server from the last backup, confirm credentials decrypt and an active workflow runs, and write down how long it took.
Updates and version pinning
n8n's Docker guide says a new minor version ships most weeks, that the stable tag is for production, and that beta may be unstable. The update guide advises updating frequently to avoid big jumps, at least monthly, checking the release notes for breaking changes, and testing on a separate instance first. It suggests using environments, a paid feature, to stand up a test version of the instance.
A workable routine, and the one we set up on client instances:
- Pin an explicit version tag in the Compose file rather than following the moving stable tag. The Docker guide shows pulling a specific version.
- Once a month, read the release notes for the versions between yours and the latest.
- Take a database and user-folder backup.
- Update a staging copy, run the workflows that touch money, customers or messaging, then update production in a quiet window.
- Record the version, the date and the result.
Never jump from a version many releases back without reading what changed in between, and do not downgrade after a key rotation has written data.
Security: access, webhooks, proxies and tunnels
Start with exposure. Only the reverse proxy should face the internet. n8n's SSL guide recommends a reverse proxy, such as Traefik, or a network load balancer in front of the instance, which also handles certificate renewal. Passing certificates into n8n directly is possible but leaves renewal to you.
Behind a proxy, set the webhook URL explicitly. The reverse proxy guide explains that n8n builds webhook URLs from protocol, host and port, which breaks when the proxy exposes port 443 while n8n listens on 5678. Set N8N_WEBHOOK_URL to the public address, set N8N_PROXY_HOPS to 1, and pass the forwarded-for, forwarded-host and forwarded-proto headers from the last proxy. Wrong values here are the usual reason external services register the wrong callback address. If your first integration is WhatsApp, the failures you will meet are catalogued in why WhatsApp webhooks fail and how to diagnose them in order; if it is payments, the same discipline applies to setting up Razorpay webhooks so no payment is missed.
Then protect each webhook. The Webhook node supports basic auth, header auth, JWT auth and n8n user auth, and an IP allowlist option, and n8n's guidance on securing a webhook is to require authentication. A webhook with no authentication is an open door to a workflow that may write to your CRM or send messages. Use a shared-secret header for your own callers, and the provider's signature scheme for third parties.
n8n gives you tools to find the rest:
- Security audit: run n8n audit, or call the API. It reports unused credentials, risky built-in nodes that can run code on the host, community and custom nodes, unprotected webhooks, missing security settings and whether the instance is outdated. Run it before go-live and after each major change.
- SSRF protection: is switched on with N8N_SSRF_PROTECTION_ENABLED, and once enabled it blocks outbound requests from nodes such as HTTP Request to private ranges, loopback and link-local addresses by default. n8n describes it as defence in depth, with network-level firewalls as the primary control.
- Blocking nodes, disabling the public API and hardening task runners, which isolate Code node execution, are all documented in the security section.
People and roles need a decision too. In the free edition, per the editions page, only the instance owner and the user who creates a workflow or credential can access it, and sharing, projects and SSO are paid features. Enforcing two-factor authentication for all users is a paid policy setting, though individual users can enable 2FA. For a small team the practical pattern is one owner account, named user accounts with 2FA on, credentials created by a few trusted people, and a Business licence once you need roles, projects or SSO.
Monitoring and error workflows
An automation nobody watches fails silently. n8n's monitoring guide lists three endpoints: a health check that returns 200 when the instance is reachable, a readiness check that returns 200 only when the database is connected and migrated, and a metrics endpoint. The metrics endpoint is disabled by default and available on self-hosted editions. Point an uptime monitor at the readiness path, not just the health path, because the health check does not reflect database status.
Inside n8n, set an error workflow. It starts with the Error Trigger node and runs when a linked workflow fails; you attach it in each workflow's settings, and one handler can serve many workflows. It receives the workflow name, the failed node, the error message and a link to the execution. Send that to a channel a person reads, such as WhatsApp, email or Slack. Log streaming to an external system is a paid feature; plain logging is included.
Add the check that catches silence: a scheduled workflow that expects at least one successful run per day from each critical flow and alerts when it does not see one.
Data location and the DPDP Act
Self-hosting is often chosen for data control, so be precise about what it controls. A server in an Indian region keeps the n8n process, its database and its execution logs in India. It does not control where connected services process the data that flows through. A workflow that sends a customer message to a language model, a CRM or a messaging platform passes personal data to that provider wherever it runs. n8n's AI documentation describes connecting models, agents, tools and memory inside workflows, so every model node is a data flow to a provider that belongs on your list. Our answer on how your data is handled when you add AI features goes through that question.
The Digital Personal Data Protection Act, 2023 is the law that matters for personal data of people in India. Four provisions bear on an automation server, all from the Act's text:
- Section 8(1) makes the business that decides the purpose and means of processing responsible for compliance, including for processing done on its behalf by a processor, whatever the agreement says. A partner or vendor who runs your n8n does not take that responsibility from you.
- Section 8(2) allows a business to engage a processor only under a valid contract, so a partner running your instance needs one.
- Section 8(5) requires reasonable security safeguards to prevent a personal data breach, including for processing on your behalf, and section 8(6) requires intimation to the Board and affected people if one occurs. Everything in the security section above is evidence for this duty.
- Section 8(7) requires erasing personal data when consent is withdrawn or the purpose is no longer served, unless law requires retention. Execution logs that keep customer payloads indefinitely work against that, so set pruning and save-on-success deliberately.
Section 16 lets the central government restrict transfers of personal data to notified countries outside India. The Press Information Bureau describes the DPDP Rules as providing an 18-month phased compliance timeline. The detail is in our answer on what the DPDP Act means for a business website. Confirm your specific position, including timelines and retention periods, with your adviser.
One more data-control feature is worth knowing. n8n's Enterprise edition can redact execution data, hiding the payloads while keeping status and timing visible. If your workflows handle regulated records and many people can view executions, plan for it or limit who gets editor access.
What self-hosting costs: the layers
No single figure applies, because the layers depend on your volume and your setup. These are the layers to price, each with an owner. What AI automation costs to run covers the usage-based layers in more detail.
| Cost layer | What drives it | Who normally owns it |
|---|---|---|
| Compute | Size of server, number of workers | Your cloud account |
| Database | PostgreSQL size, backups, high availability | Your cloud account |
| Redis | Only in queue mode | Your cloud account |
| Storage | Execution history, binary files, backup copies | Your cloud account |
| Domain, TLS, proxy | Certificates, load balancer | Your cloud account |
| n8n licence | Only if you need Business or Enterprise features | You, or the client |
| Third-party usage | Model providers, messaging platform charges, API plans | Whoever owns each account |
| Updates and monitoring | Monthly update, restore test, alert handling | Your team or a partner |
| Build and change time | New workflows, changes after launch | Your team or a partner |
The last two rows are where most budgets are wrong. Hosting a small instance is a modest line. The time to keep it patched, watched and restorable is the real cost, and it recurs. If nobody has that time, the rest of the table is moot.
Run it yourself or have a partner run it?
| Situation | Better fit |
|---|---|
| You have a developer or sysadmin who owns the server and has time each month | Run it yourself, using the sections above as the runbook |
| Workflows are simple, volume is low and nobody wants to be on call | n8n Cloud, or a partner-managed instance |
| Workflows touch payments, patient or student records, or customer messaging | Partner-built and hardened, with your team owning accounts and approvals |
| You want the system in your own cloud account but lack the skills to build it | Partner builds and documents, then hands over or retains a support agreement |
| You run automations for several clients | One instance per client in the client's account, or a single instance you alone operate within the licence terms; n8n asks agencies managing n8n across several client environments to contact license@n8n.io |
| Air-gapped or strict-residency environment | Self-hosted with a licence certificate where paid features are needed |
When a partner sets this up, the arrangement should keep control with you. The server, database and backups sit in your cloud account, the domain and the encryption key sit with your named owner, a written runbook covers updates and restores, and your team can operate the instance after handover. That is how we run workflow automation engagements, and how we wire AI model nodes and business apps into n8n. If the partner cannot name where each of those lives, the arrangement hands your business a dependency.
Go-live checklist
- Licence: the intended use is covered by the licence FAQ; unclear points raised with license@n8n.io.
- Hosting: production server in a chosen region, real domain, TLS through a reverse proxy, no tunnel, and only the proxy exposed.
- Database: PostgreSQL with TLS where the database is remote, supported version, tested connection.
- Encryption key: N8N_ENCRYPTION_KEY set explicitly, stored separately in a password manager, shared with every worker.
- Backups: user folder and database backed up on a schedule, copies stored off the server, one full restore tested and timed.
- Execution data: save and prune settings chosen per workflow, with retention agreed with whoever owns data protection.
- Scaling: concurrency limit set; queue mode with Redis and workers if webhook traffic is bursty.
- Webhooks: public URL and proxy hops set; every webhook authenticated; allowlists where the caller's IPs are known.
- Access: named users, 2FA on, few credential creators, SSO and roles if you licence Business.
- Hardening: n8n audit run and findings cleared; SSRF protection on; public API off if unused; risky nodes blocked where not needed.
- Updates: version pinned, monthly review scheduled, staging copy available, rollback plan that respects key rotation.
- Monitoring: uptime check on the readiness path, error workflow alerting a human, a daily heartbeat for critical flows.
- Data flows: every external service that receives personal data listed with its processing location; vendor contracts in place; adviser has reviewed the DPDP position.
- Runbook: one page each for restore, update and "workflows stopped", owned by a named person with a named backup.



