Self-hosted n8n multi-tenant setup for agencies 2026

A self-hosted n8n multi-tenant setup for agencies in 2026 can be your best recurring-revenue product or an operational sinkhole. This guide covers architecture options, ToS compliance, security, real cost comparisons, and when to graduate to custom AI.

How to Comply With Saudi NCA Cybersecurity Controls for AI Agents

A practical, ECC-mapped guide to deploying NCA-compliant AI agents in Saudi Arabia—covering data residency, Shadow AI risk, audit logging, and a 2026 SME checklist.

AI automation for insurance underwriting workflow MENA

AI automation for insurance underwriting workflow MENA is transforming Gulf insurers with up to 90% fewer errors and 40%+ more business. This vendor-neutral guide covers the four-stage workflow, Takaful and SAMA compliance, Arabic document processing, and a build-vs-buy framework for SMEs.

Agent compliance with regulations made easy

Most AI agent compliance content targets Fortune 500 budgets. This guide shows startups and SMEs how to build agent compliance with security, audit, and industry rules from day one—cheaply, using compliance-by-design, self-hosted logging, and free government frameworks.

AI agent cost in Moroccan Dirham and Tunisian Dinar 2026

A definitive 2026 guide to AI agent cost in Moroccan Dirham and Tunisian Dinar, with converted platform pricing tables, currency-volatility analysis, AI-vs-human cost comparisons for Maghreb labor markets, and a practical cost-cutting playbook for SMEs.

How to comply with Turkey KVKK for AI chatbots 2026

A technical, no-nonsense guide to KVKK compliance for AI chatbots in 2026 — covering consent flows, data minimization, retention rules, KVKK vs GDPR, and audit-ready documentation for Turkish and bilingual deployments.

N8n vs Make.com vs Zapier free tier comparison 2026

Zapier counts tasks, Make counts operations, n8n is free when self-hosted. Our 2026 free tier comparison reveals the 60x cost gap at scale — and which automation platform actually fits your startup, agency, or AI agent build.

AI agent for WhatsApp voice notes transcription Arabic 2026

Heading into 2026, AI agents for WhatsApp voice note transcription have moved from passive speech-to-text to action-oriented systems that transcribe Arabic dialects, auto-reply, and convert spoken orders into revenue. Here’s the definitive build-vs-buy guide for MENA SMEs.

Deterministic AI vs LLM: Stock Trading

Deterministic AI guarantees reproducibility for backtesting and position sizing; LLMs excel at interpreting language and drafting strategies. Here’s the SME decision framework for choosing between them — and the hybrid architecture that uses each where it’s strongest.

AI agent for WhatsApp in China 2026 pricing in RMB

WhatsApp is blocked in mainland China, so the real AI agent for WhatsApp China 2026 pricing in RMB only applies overseas. Here’s the full breakdown — Meta token fees, DeepSeek’s 75% cut, WeChat and Yuanbao alternatives, and how to calculate true RMB total cost of ownership.

Companies running 50,000+ automation tasks per month on Zapier can pay over $1,000 monthly — the same workloads cost roughly $7 to $40 in server fees on a self-hosted n8n instance. That gap is why understanding how to self-host n8n? An in-depth guide has become essential reading for startups and SMEs, as self-hosting n8n has emerged as one of the highest-ROI infrastructure decisions for growing companies.

How to self-host n8n comes down to running the open-source automation engine on your own server using Docker, securing it behind a reverse proxy, and maintaining it with backups and monitoring. According to the official n8n hosting documentation, every self-hosted installation uses the identical core product as the paid cloud — and it runs without a license key for standard use. You’re not getting a stripped-down version. You’re getting the whole engine, minus the per-task tax.

This guide is written from hands-on operational experience with self-hosted n8n deployments and is grounded in the official n8n documentation and widely cited community guides. It covers the full lifecycle — planning, installation, security, scaling, and disaster recovery — not just a 3-minute Docker tutorial that leaves you exposed in production.

Quick Summary: Key Takeaways

  • Self-hosted n8n eliminates per-task fees — high-volume workloads that run into the hundreds or thousands of dollars per month on metered SaaS run for a flat $7–$40/month on a basic VPS.
  • Docker is the standard install method, recommended in the official n8n documentation for its reproducibility and easy upgrades.
  • Security is non-negotiable — a reverse proxy (Caddy or Nginx), HTTPS, and credential encryption are mandatory before going live.
  • Self-host when you run high-volume, data-sensitive, or compliance-bound workflows; use managed cloud when you have zero DevOps capacity.
  • Production reliability requires backups — automate PostgreSQL dumps and store them off-server to survive disasters.
  • Queue mode with workers lets self-hosted n8n scale horizontally for thousands of concurrent executions.

Last updated: November 2025. This article is maintained by practitioners with hands-on n8n self-hosting experience; figures are sourced from official documentation and the providers cited inline, and pricing should be re-verified against current provider pages before you commit.

What Is n8n and Why Self-Host It?

n8n is an open-source, fair-code workflow automation platform that connects apps, APIs, and AI models through a visual node-based editor. Self-hosting means running n8n on infrastructure you control — a VPS, a home server, or a cloud instance — instead of paying for the managed n8n Cloud.

n8n was founded in 2019 by Jan Oberhauser in Berlin and has grown into a serious rival to Zapier and Make. The platform supports hundreds of integrations and native AI agent nodes, which is why teams building custom automation increasingly choose it over closed SaaS tools. The self-hosting value proposition is straightforward: you escape the metered pricing model.

Zapier and Make charge per task or per operation. Run a workflow tens of thousands of times and your bill scales toward four figures. Self-hosted n8n charges you nothing per execution — your only cost is the server. According to the n8n hosting docs, the self-hosted edition runs the same engine as paid plans, so you sacrifice no core functionality for that savings.

Three reasons businesses self-host n8n:

  • Cost control — flat server pricing instead of per-task billing that punishes growth.
  • Data sovereignty — API keys, customer records, and credentials stay on your hardware, which matters in GDPR and HIPAA contexts.
  • Unlimited customization — install community nodes, run custom code, and integrate internal tools without vendor approval.

The metered SaaS model can be thought of as a recurring penalty for automating work you’ve already built. Self-hosting removes it. Curious where your own numbers land? Run them through our AI automation ROI calculator before committing to infrastructure.

How to Self-Host n8n? An In-Depth Guide to Installation

Self-hosting n8n in production requires four core components: Docker for containerization, a Linux VPS (minimum 2GB RAM, 2 vCPUs), a PostgreSQL database for persistent storage, and a reverse proxy like Nginx or Caddy with HTTPS via Let’s Encrypt. Docker is the deployment method recommended by n8n’s official documentation and validated by widely cited guides, including Sliplane’s ultimate self-hosting guide, because it isolates dependencies and makes upgrades a one-command operation.

The standard installation follows four logical phases: (1) install Docker and Docker Compose on your VPS, (2) configure a docker-compose.yml file linking n8n to PostgreSQL, (3) set environment variables including N8N_HOST, WEBHOOK_URL, and database credentials, and (4) deploy behind a reverse proxy to enforce HTTPS encryption.

While n8n offers SQLite by default, PostgreSQL is recommended for production because it handles concurrent executions cleanly and avoids the database-locking issues SQLite hits under parallel load.

Before you touch a terminal, provision the right server. For most startups, a VPS with 2 vCPUs and 4GB of RAM comfortably handles thousands of executions monthly. As a verifiable reference point, Hetzner’s Cloud pricing page lists shared-vCPU instances in roughly this class, and DigitalOcean’s Droplet pricing and Hostinger’s VPS hosting offer comparable tiers (verify current rates on each provider’s page, as cloud pricing changes). Choose Ubuntu 22.04 LTS as your operating system — it’s the most documented and stable base for n8n deployments.

Step-by-Step Docker Installation

Docker is an open-source containerization platform that packages applications and their dependencies into isolated, portable containers, which reduces “works on my machine” deployment conflicts. On a fresh Ubuntu 22.04 VPS, the full installation typically takes 10–15 minutes.

  1. Provision and update the server. Spin up an Ubuntu 22.04 LTS VPS with at least 2GB RAM (4GB recommended for production), SSH in, and run system updates: sudo apt update && sudo apt upgrade -y.
  2. Install Docker and Docker Compose. Use the official Docker installation script to get the latest stable engine: curl -fsSL https://get.docker.com | sh. Verify with docker --version (expect 24.0 or higher) and docker compose version (the Compose plugin ships with Docker since 20.10). Confirm with a smoke test: sudo docker run hello-world.
  3. Create a Docker Compose file. Define three services: the n8n application, a PostgreSQL database for persistent storage, and a Caddy reverse proxy for automatic HTTPS. A minimal production stack looks like this:

    services:
      n8n:
        image: docker.n8n.io/n8nio/n8n:latest
        restart: always
        environment:
          - N8N_HOST=n8n.yourcompany.com
          - WEBHOOK_URL=https://n8n.yourcompany.com/
          - N8N_ENCRYPTION_KEY=<your-32-char-key>
          - DB_TYPE=postgresdb
          - DB_POSTGRESDB_HOST=postgres
        volumes:
          - n8n_data:/home/node/.n8n
      postgres:
        image: postgres:16
        restart: always
        volumes:
          - pg_data:/var/lib/postgresql/data

    Pin specific image tags (for example n8nio/n8n:1.x.x) in production rather than latest, so upgrades are deliberate and reproducible. Always consult the official hosting docs for the current canonical Compose reference.

  4. Set environment variables. Configure N8N_HOST, WEBHOOK_URL, N8N_ENCRYPTION_KEY, and database credentials. The encryption key protects stored credentials and must never change after setup. Generate a strong key with openssl rand -hex 32.
  5. Point your domain. Add an A record in your DNS pointing your subdomain (e.g., n8n.yourcompany.com) to the server’s IP.
  6. Launch the stack. Run docker compose up -d. Caddy will automatically issue a free Let’s Encrypt SSL certificate within seconds once DNS resolves.
  7. Create your owner account. Visit your domain, set up the admin user, and confirm the instance loads over HTTPS.

A critical detail teams miss: always pair n8n with PostgreSQL, not the default SQLite. SQLite works for testing but can corrupt under concurrent production load. PostgreSQL handles parallel executions cleanly and makes backups straightforward.

Need help with this stage? Our custom workflow automation services include hardened n8n deployments configured for your exact compliance and scaling needs.

How Do You Secure a Self-Hosted n8n Instance?

Securing a self-hosted n8n instance comes down to five core measures: enforcing HTTPS through a reverse proxy, setting a permanent encryption key, enabling basic auth or SSO, locking down the firewall to only ports 80, 443, and your SSH port, and keeping n8n updated. An exposed n8n instance is a direct gateway to every connected API key and database you’ve integrated — security isn’t optional.

The most common mistake found in audits is running n8n on a raw IP over HTTP. That sends credentials and webhook payloads in plaintext. A reverse proxy like Caddy or Nginx terminates SSL and shields the application, which is why Localtonet’s installation guide treats HTTPS as a baseline requirement rather than an upgrade. As a general security principle, publicly reachable services are routinely probed by automated scanners shortly after going live, so an unauthenticated instance on a public IP is a meaningful exposure.

Essential Security Hardening Checklist

Security depends on defense in depth — apply these layers together, not in isolation:

  • Force HTTPS everywhere using Caddy, which automatically provisions and renews Let’s Encrypt certificates with no manual intervention.
  • Set a strong, permanent N8N_ENCRYPTION_KEY of at least 32 characters — losing or changing it makes all stored credentials permanently unrecoverable.
  • Enable authentication — turn on n8n’s built-in user management or front the instance with OAuth/SSO for team access; never expose an unauthenticated instance.
  • Configure a firewall — use UFW to allow only SSH, HTTP (80), and HTTPS (443); block everything else by default. Where possible, bind internal services to 127.0.0.1 and expose only what the reverse proxy needs.
  • Disable root SSH login and use key-based authentication instead of passwords.
  • Keep n8n updated — pin a version in Docker Compose and update deliberately after testing, since the platform ships frequent releases that include fixes.

For regulated industries, self-hosting is often the cleanest path to compliance. Under the EU GDPR framework, keeping personal data on infrastructure you control simplifies data residency and processor obligations that managed SaaS can complicate. Healthcare teams handling protected health information gain the same advantage — your data never traverses a third party’s servers. (Compliance also depends on your broader processes, not the platform alone; treat self-hosting as an enabler, not a guarantee.)

One practical reliability rule worth internalizing: the most common avoidable failure in self-hosted n8n is a missing or rotated encryption key. Set it once, back it up in a secrets manager, and never touch it again.

What Does Self-Hosted n8n Actually Cost vs. Managed Cloud?

Self-hosted n8n costs roughly $7–$40 per month in server fees and supports unlimited workflow executions, while equivalent automation volume on Zapier or n8n Cloud ranges from tens to over a thousand dollars per month. The total cost of ownership shifts decisively toward self-hosting once you exceed roughly 5,000–10,000 monthly task executions.

The catch isn’t the server bill — it’s the engineering time. Self-hosting trades cash for maintenance hours. A managed plan costs more dollars but near-zero DevOps effort.

How to read the figures below: Server costs reflect published VPS pricing from Hetzner, DigitalOcean, and Hostinger (see links in the installation section; verify current rates). Managed n8n figures reference n8n’s own published pricing page, which is tiered by active workflows/executions. Zapier figures reference Zapier’s published pricing page, whose paid tiers scale by task volume — high task counts land on its higher Professional/Team tiers. All vendor pricing changes over time, so treat these as order-of-magnitude comparisons and confirm against the live pages before budgeting.

FactorSelf-Hosted n8nn8n Cloud (Managed)Zapier (Comparable)
Monthly cost (high volume, ~50k tasks)$7–$40 (server)Tiered by workflows/executionsHigher paid tiers (task-metered)
Per-task feesNonePlan-limitedYes, scales up
Setup effort2–6 hoursMinutesMinutes
Maintenance burdenYou own itVendor-managedVendor-managed
Data controlFull (your server)Vendor cloudVendor cloud
Custom/community nodesUnlimitedRestrictedNone
Best forVolume + privacyNo DevOps capacitySimple, low-volume

Over a three-year horizon, the gap compounds. A heavy automation workload on a task-metered SaaS plan can run into tens of thousands of dollars across three years; the same workload self-hosted on a sub-$25/month VPS costs under $900 in server fees over the same period — even after factoring in periodic maintenance time. The exact percentage depends on your current plan and volume, which is why running your own numbers matters more than any headline figure.

A Worked Cost Example (Reproducible)

Consider a typical SME workload: an e-commerce operation running order-confirmation, inventory-sync, and customer-notification workflows totaling about 30,000 task executions per month.

  • Self-hosted path: A 2 vCPU / 4GB RAM VPS (verify current price on the provider pages above) running n8n + PostgreSQL + Caddy handles this comfortably. Flat server cost, no per-execution fee, plus ~1–3 hours/month of maintenance.
  • Managed path: On a task-metered SaaS, 30,000 monthly tasks pushes you onto a mid-to-upper paid tier, with the bill scaling further as volume grows.

The break-even point isn’t really about price per task — it’s about whether you have the technical capacity to run infrastructure. A team with basic Linux and Docker familiarity captures the savings; a team without it may find the managed premium cheaper than an outage they can’t diagnose.

That said, self-hosting isn’t free. Budget 1–3 hours monthly for updates, monitoring, and backup verification. If your team has no technical capacity, the managed cloud’s premium often pays for itself in avoided downtime. We help SMEs model this exact tradeoff before they commit.

When Should Your Startup Actually Self-Host n8n?

Self-host n8n when you run high-volume workflows, handle sensitive data, need custom nodes, or want to escape per-task pricing — and when you have at least minimal DevOps capacity. Stick with managed cloud if reliability matters more than cost and nobody on your team can maintain a server.

The decision isn’t ideological. It’s a function of volume, sensitivity, and skills. A common failure pattern: founders self-host out of principle, then lose a week to a database corruption they can’t diagnose. The opposite pattern is just as common: SMEs cut high four-figure annual bills dramatically by moving proven, high-volume workflows off metered SaaS. Context decides.

You Should Self-Host If:

  • You exceed 5,000+ task executions monthly and the metered bill is climbing.
  • You process customer data, PII, or regulated information requiring data residency control.
  • You need community nodes, custom code, or internal API integrations closed platforms block.
  • You have basic Linux and Docker familiarity on the team — or a partner who does.

You Should Use Managed Cloud If:

  • Your workflows are low-volume and non-sensitive, where the cost gap is negligible.
  • You have zero DevOps capacity and can’t afford downtime from a misconfiguration.
  • You’re prototyping and want to validate automation value before investing in infrastructure.

For most growing SMEs, the pragmatic answer is a hybrid: prototype on cloud, then migrate proven high-volume workflows to a self-hosted instance once the per-task savings justify the maintenance. Our 90-day AI automation roadmap sequences exactly that transition without disrupting live operations.

How Do You Maintain, Back Up, and Scale Self-Hosted n8n?

How to Self-Host n8n? An In-Depth Guide plays a pivotal role in this context.

Maintain self-hosted n8n by automating daily PostgreSQL backups stored off-server, monitoring uptime, updating versions deliberately, and enabling queue mode with workers to scale horizontally. A production instance without backups is a liability, not an asset — disaster recovery is the difference between a hiccup and a catastrophe.

The most overlooked phase of self-hosting is everything after installation. The 3-minute tutorials end at “it works.” Real production reliability starts there.

Backup and Disaster Recovery

  1. Automate database dumps. Schedule a daily pg_dump of your PostgreSQL database via cron. A minimal example: 0 3 * * * docker exec postgres pg_dump -U n8n n8n > /backups/n8n_$(date +\%F).sql.
  2. Back up the encryption key. Store N8N_ENCRYPTION_KEY in a separate secrets manager — without it, restored credentials are useless.
  3. Push backups off-server. Sync dumps to S3, Backblaze, or another remote bucket so a server failure doesn’t erase your recovery point.
  4. Test restores quarterly. A backup you’ve never restored is a hope, not a plan.

Scaling for Growth

n8n’s default “main mode” runs everything in one process — fine until concurrent executions overwhelm it. Queue mode separates the main instance from dedicated worker processes coordinated through Redis, letting you add workers as volume grows. Per the n8n hosting documentation, queue mode is the supported path to high availability and horizontal scaling.

  • Enable queue mode by setting EXECUTIONS_MODE=queue and adding a Redis service.
  • Add worker containers to process executions in parallel across CPU cores.
  • Separate the webhook processor so inbound triggers never block heavy workflows.
  • Monitor with tools like Uptime Kuma or Grafana to catch failures before users do.

In practice, moving a high-throughput onboarding automation from single main mode to queue mode with multiple workers is the standard fix for peak-hour execution lag — it spreads concurrent runs across worker processes without requiring any change to the workflows themselves. Scaling self-hosted n8n is an infrastructure problem, not a redesign problem.

Actionable Takeaways: Your Self-Hosting Action Plan

Ready to escape the per-task tax? Here’s a deterministic path:

  1. Calculate your TCO first. Compare your current automation bill against $20–$40/month in server costs before committing.
  2. Provision a 4GB Ubuntu VPS from Hetzner, Hostinger, or DigitalOcean (verify current pricing on their pages).
  3. Deploy with Docker Compose — n8n + PostgreSQL + Caddy for automatic HTTPS.
  4. Harden security immediately — firewall, permanent encryption key, authentication.
  5. Automate off-server backups from day one, not after your first scare.
  6. Scale with queue mode only when volume demands it — don’t over-engineer early.

Self-hosting n8n isn’t about saving a few dollars. It’s about owning your automation infrastructure, your data, and your costs — the three things metered SaaS quietly takes from you as you grow. The teams winning with AI automation aren’t necessarily the ones paying the most for it; they’re the ones who chose to own what they could control.

Frequently Asked Questions

Is self-hosting n8n free?

Self-hosted n8n is free to run — the software requires no license key for standard use, per the official n8n documentation. Your only cost is the server hosting it, typically $7–$40/month on a basic VPS. You pay for infrastructure, not per-task fees.

What server do I need to self-host n8n?

A VPS with 2 vCPUs and 4GB of RAM running Ubuntu 22.04 LTS handles most startup workloads comfortably — thousands of executions per month. Providers like Hetzner, Hostinger, and DigitalOcean offer suitable instances in the single-to-low-double-digit dollar range per month (verify current rates on their pricing pages). High-volume operations should scale to more RAM and enable queue mode.

Is self-hosted n8n secure enough for sensitive data?

When properly hardened, self-hosted n8n keeps your data and credentials on infrastructure you control, which is an advantage for sensitive workloads. Enforce HTTPS via a reverse proxy, set a permanent encryption key, enable authentication, and configure a firewall. Self-hosting can simplify GDPR and HIPAA data residency obligations, though overall compliance also depends on your broader processes.

How do I update a self-hosted n8n instance?

Update self-hosted n8n by pinning a version in your Docker Compose file, pulling the new image, and recreating the container with docker compose up -d. Always back up your PostgreSQL database before updating, and test on a staging instance for major version jumps, since n8n ships frequent releases.

Self-hosted n8n vs. Zapier — which is cheaper?

Self-hosted n8n is dramatically cheaper at scale because it has no per-task fees — your cost is a flat $7–$40/month server bill, while Zapier’s paid tiers scale with task volume (see Zapier’s pricing page). Zapier wins on convenience for low-volume users with no technical capacity to maintain a server.

Sources & References

Methodology note: Cost figures in this article are order-of-magnitude comparisons based on the publicly listed prices linked above as of the last update. Vendor pricing and plan structures change frequently; always confirm against the live pages before making a budgeting decision.