Self-Hosting n8n: A Step-by-Step Guide for 2026
A complete 2026 guide to self-hosting n8n — Docker setup, PostgreSQL, security hardening, the best proxies to pair with your instance, and the production mistakes to dodge.
n8n adoption has exploded — the open-source workflow automation platform passed 80,000 GitHub stars in 2026 and now powers internal automations at companies like Verizon, Cisco, and Delivery Hero. Self-hosting is the natural next step once your workflows mature beyond a handful of test runs.
Running n8n on your own infrastructure unlocks unlimited workflow executions, fair-use pricing (read: zero per-execution cost), and complete data ownership — but it also means you own the security, scaling, and upgrade cycle. In a recent developer survey, 62% of n8n self-hosters said the migration paid back within the first three months thanks to lower subscription costs and tighter integration with internal systems.
This guide walks you through every step of self-hosting n8n in 2026 — from picking the right deployment method to securing your instance, pairing it with proxies for scraping workflows, and avoiding the production-grade mistakes that bite most teams. Bookmark this if you are planning a serious rollout.
Why Self-Host n8n in 2026?
n8n Cloud is convenient, but it caps you at execution limits and stores your credentials on a shared platform. For teams running heavy scraping, AI agents, or sensitive data pipelines, self-hosting is the smarter long-term play.
Self-hosting gives you unlimited workflow executions, full SSO and queue mode, the ability to install community nodes, and infrastructure that satisfies GDPR, HIPAA, or internal compliance requirements. You also dodge the per-execution pricing that gets expensive the moment a workflow hits production volume.
Self-Hosted n8n vs n8n Cloud: Which Should You Pick?
Before you spin up a server, confirm self-hosting is the right call. Cloud is fine for hobby workflows and quick prototypes — self-hosting wins as soon as you cross roughly 5,000 executions per month or need to install community nodes.
| Feature | Self-Hosted n8n | n8n Cloud |
|---|---|---|
| Pricing | Free (infra cost only) | From $20/month |
| Workflow Executions | Unlimited | Capped by plan |
| Community Nodes | Full support | Verified only |
| Data Residency | Your servers | n8n cloud (EU/US) |
| Maintenance | Your responsibility | Fully managed |
| Best For | Production, scraping, compliance | Quick prototypes |
System Requirements and Prerequisites
n8n is lightweight, but production workloads — especially scraping flows that hold many concurrent HTTP connections — need a bit of headroom. Here is what we recommend for 2026.
| Workload | CPU | RAM | Storage | OS |
|---|---|---|---|---|
| Test / Personal | 1 vCPU | 2 GB | 20 GB SSD | Ubuntu 22.04+ |
| Small Team (≤50 workflows) | 2 vCPU | 4 GB | 40 GB SSD | Ubuntu 22.04+ |
| Production (queue mode) | 4 vCPU | 8 GB+ | 80 GB SSD | Ubuntu / Debian |
You will also need Docker 24.0+, Docker Compose v2, and a domain name with DNS pointed at your server so you can issue an SSL certificate via Let''s Encrypt.
Step-by-Step Installation Methods
There are four mainstream ways to install n8n in 2026. Pick the one that matches your scale and comfort level — most teams start with Docker Compose and stay there.
1. Docker (Recommended for Most Users)
Docker is the fastest path to a working n8n instance. Pull the official image, mount a volume for persistent data, and you are running in under five minutes. This is the deployment method n8n officially supports for both personal and small-team workloads.
Create a named volume with docker volume create n8n_data, then run docker run -d --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n n8nio/n8n. Open the editor at http://localhost:5678 and create your owner account. The default SQLite database is fine for testing but should be replaced with PostgreSQL before going live.
2. Docker Compose with PostgreSQL
For production, run n8n alongside PostgreSQL and a reverse proxy (Caddy or Traefik) in a single Compose stack. PostgreSQL handles concurrent writes far better than SQLite and is mandatory for queue mode.
Define three services — n8n, postgres, and caddy — in a single docker-compose.yml, share a Docker network between them, and pass database credentials via environment variables. Caddy auto-issues TLS certificates the moment you point your domain at the host, so your editor goes live on HTTPS with zero manual configuration.
3. npm Installation
If you prefer running n8n directly on a host without Docker, install Node.js 20 LTS and run npm install -g n8n. Start the process with n8n start and supervise it with PM2 or systemd so it survives reboots.
npm installs are quicker to debug but harder to upgrade and reset cleanly. Use this path only if you have a specific reason to avoid containers — Docker is the officially recommended deployment method and gets the most community support.
4. One-Click Cloud VPS Deployment
Hetzner, Hostinger, DigitalOcean, and Railway all ship n8n one-click images that provision a configured stack in 60 seconds. These hide the Docker boilerplate and pre-configure the reverse proxy and SSL — ideal if you want a production-ready setup without writing YAML.
Expect to pay $5–$15 per month for a VPS large enough to host n8n plus a small PostgreSQL database. Always change the default admin password immediately after the first login — the marketplace images ship with predictable defaults that bots scan for within hours.
Securing Your Self-Hosted n8n Instance
An exposed n8n instance is a credential goldmine — every workflow contains API keys, OAuth tokens, and database passwords. Lock it down before you build anything important on top of it.
At minimum: terminate TLS with Let''s Encrypt, set N8N_BASIC_AUTH_ACTIVE=true with a strong password, rotate N8N_ENCRYPTION_KEY and back it up off-site, restrict the firewall to ports 80 and 443, and put the admin UI behind your VPN or an IP allowlist where possible. Enable two-factor authentication for every user account as soon as you upgrade to a multi-seat plan.
Finally, audit your community nodes. Some third-party nodes bundle outbound telemetry or background HTTP calls — review the package source on GitHub before installing it on a production instance.
Best Proxies to Pair with Self-Hosted n8n
Most production n8n workloads include at least one HTTP node that scrapes a third-party site, monitors prices, or rotates accounts. Pairing n8n with a residential or ISP proxy network is the difference between a workflow that runs for years and one that hits an IP ban inside three weeks. These four providers are battle-tested with n8n''s HTTP Request node.
1. NodeMaven
NodeMaven''s filter-first IP rotation delivers the cleanest residential traffic on the market, with sticky sessions that survive up to 24 hours — perfect for n8n workflows that log into an account and pull data across multiple steps. The 99.9% uptime is unusual for residential and means your overnight cron jobs actually complete.
2. Decodo
Decodo (formerly Smartproxy) ships with 115M+ IPs across 195 countries and exposes a clean REST API that pairs naturally with n8n''s Set and HTTP Request nodes. The pay-as-you-go residential plan is the easiest entry point if you are still calibrating bandwidth usage.
3. IPRoyal
IPRoyal''s non-expiring traffic model is a perfect fit for self-hosters without predictable monthly volume. Buy a GB pool, burn it down over months, and never lose unused bandwidth — ideal for personal n8n instances that scrape sporadically rather than around the clock.
4. Webshare
Webshare is the budget pick — its datacenter and rotating residential plans start at a few dollars a month, making it the best fit for hobby projects or low-volume n8n flows. The dashboard auto-generates the proxy URL format n8n expects, so setup is a single copy-paste away.
Common Mistakes to Avoid When Self-Hosting n8n
Most production incidents in self-hosted n8n trace back to the same handful of mistakes. Here is what to watch for as your deployment matures from a single Docker container into a real internal platform.
1. Skipping the External Database
SQLite is the default, and it is fine for personal workflows. The moment you move to production traffic or queue mode, you will see slow writes, locked databases, and lost executions. Switch to PostgreSQL before you build anything you cannot afford to lose — migrating later is far more painful than starting on Postgres from day one.
2. Losing the Encryption Key
n8n encrypts every stored credential with N8N_ENCRYPTION_KEY. If you redeploy without backing it up, every credential in the database becomes unrecoverable garbage. Store the key in a password manager and in your infrastructure secrets store — never check it into the same Git repo as your Compose file.
3. Exposing the Editor to the Public Internet
The default Docker config binds port 5678 to all interfaces. Without a reverse proxy and authentication, anyone who finds your IP can browse your workflows and pull credentials. Always terminate TLS, enable basic or SSO auth, and consider putting the editor behind a VPN or IP allowlist for sensitive environments.
4. Ignoring Webhook URLs After Migration
Webhook URLs in n8n are absolute — they embed your N8N_HOST. If you change domains or move servers without updating the env vars, external services keep posting to the old URL and your workflows go silent. Set WEBHOOK_URL explicitly to match your public address whenever you migrate.
5. Running Heavy Workflows on the Main Process
By default, every workflow runs on the same Node process that serves the editor. A single slow scraping job can lock up the UI for everyone else on the team. Once you have more than a handful of workflows, enable queue mode with Redis and run separate worker processes — your editor stays snappy and failures stay isolated.
Scaling n8n From Single Container to Production Cluster
Self-hosted n8n is happy as a single Docker container until your workflow count and execution volume start pushing the host. Three changes — better hardware sizing, queue mode, and database tuning — carry most deployments from prototype to confident production scale.
Vertical Scaling Tactics
Before reaching for distributed setups, exhaust vertical scaling. Bump the host to 4 vCPUs and 8 GB of RAM, switch the Node memory limit to --max-old-space-size=4096, and put your PostgreSQL data on an SSD volume separate from the OS disk. Most teams running fewer than 100 workflows never need to look past this — single-host n8n with PostgreSQL handles surprising load when the underlying machine is sized correctly.
Enabling Queue Mode with Redis
Queue mode is n8n''s answer to horizontal scale. Set EXECUTIONS_MODE=queue, point n8n at a Redis instance, and spin up dedicated worker containers that pull jobs off the queue. The editor stays responsive even when a long-running scrape is in flight, and you can add workers behind a load balancer as traffic grows. Queue mode is essential once you operate AI agents or schedule heavy scraping jobs on tight cron intervals.
Database Performance Tuning
The execution history table balloons faster than anything else in n8n. Schedule a daily purge of completed executions older than 14 days using EXECUTIONS_DATA_PRUNE=true and EXECUTIONS_DATA_MAX_AGE=336, and add indexes on the workflow ID columns if you run heavy reporting queries. Vacuum PostgreSQL weekly to keep the table small and the dashboard fast — a bloated database is the single most common cause of slow editor performance.
Tips and Best Practices
- Automate backups — snapshot the PostgreSQL volume nightly and ship it off-site. n8n''s value is in your workflows, not the engine itself.
- Pin your Docker tag — never run
n8nio/n8n:latestin production. Pin a specific version (e.g.1.65.0) and upgrade on a schedule. - Watch memory — add an alert at 80% utilization. Runaway loops or oversized HTTP responses can OOM the host without warning.
- Use environment variables for secrets — never store API keys inline in HTTP Request nodes. Use the Credentials store or pull from a secrets manager.
- Test upgrades in a staging instance first — minor releases sometimes break community nodes. Always validate before bumping production.
Frequently Asked Questions
Conclusion
Self-hosting n8n in 2026 is the smartest long-term call for any team serious about workflow automation. The free unlimited executions, full credential control, and freedom to install any community node easily outweigh the moderate setup cost — especially when you start with Docker Compose and PostgreSQL from day one instead of bolting it on later.
Pair your instance with a clean residential proxy network so scraping flows actually survive their first big run, lock down the editor before you push anything sensitive, and never lose your encryption key. If you are still picking a network, start with our best proxy providers for n8n guide, dig into the best n8n nodes for proxy data collection, or browse the full proxy directory to compare every provider head-to-head.