All posts
·8 min read

How to Self-Host n8n: Complete Setup Guide (2026)

n8n is free to self-host at any scale — unlimited workflows, unlimited executions, no per-task billing. Here's the complete guide to getting it running on a VPS or serverless platform in 2026.

n8n is free to self-host at any scale — unlimited workflows, unlimited executions, no per-task billing. The cloud version costs $20–50+/month depending on execution volume; a self-hosted instance runs on a $5–10/month VPS. That gap is why serious automation builders are switching to n8n self-hosting as their default setup in 2026.

This guide covers both the Docker path (recommended) and the no-server path, plus custom domains, HTTPS, and an honest comparison against n8n Cloud.


Why Self-Host n8n?

The case is straightforward. n8n free self-hosting gives you unlimited workflow executions — there's no execution counter ticking down, no surprise overage charges, and no artificial limits on how many workflows you can activate. Your data stays on your infrastructure, which matters for workflows that touch PII, internal systems, or anything you'd rather not route through a third-party cloud. Code nodes run without restriction — no sandboxing quirks, no module import limitations. And you get full control over your n8n version, so you can stay on a known-good release instead of absorbing breaking changes on someone else's release schedule.

For anyone running more than a handful of active workflows, the n8n self-hosted 2026 economics are difficult to argue with. If you're still weighing automation platforms before committing to a setup, Zapier vs Make vs n8n covers the full landscape.


What You Need Before You Start

You need a VPS or server with at least 1GB RAM (2GB preferred), basic command-line comfort — SSH, running commands, editing files — and optionally a domain name (not required to get running, but needed for webhooks and a professional URL). Recommended VPS options: DigitalOcean Basic Droplet ($6/mo), Hetzner CX11 (€4/mo, best price-to-performance), or Railway.app if you want to skip server management entirely (free tier works for light use). Any Ubuntu 22.04 or 24.04 LTS server works for the Docker path below.


Method 1: Docker (Recommended)

Docker is the cleanest way to run n8n — isolated, easy to update, and straightforward to back up. This is the standard n8n Docker setup for production use.

Step 1: Install Docker and Docker Compose

SSH into your server, then run:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
newgrp docker

Verify Docker is installed:

docker --version
docker compose version

Step 2: Create the docker-compose.yml

Create a directory for n8n and the compose file:

mkdir ~/n8n && cd ~/n8n
nano docker-compose.yml

Paste this configuration:

version: "3.8"

services:
  n8n:
    image: n8nio/n8n:latest
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=your-domain.com
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://your-domain.com/
      - GENERIC_TIMEZONE=America/New_York
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:

Replace your-domain.com with your actual domain (or your server's IP if skipping the domain for now). Set N8N_PROTOCOL=http and remove the WEBHOOK_URL line if you're running without HTTPS initially.

Step 3: Start n8n

docker compose up -d

Step 4: Access Your Instance

Open http://YOUR_SERVER_IP:5678 in your browser. On first load, n8n prompts you to create an owner account — email and password. Do this immediately; leaving it open is a security risk.

Your n8n VPS install is running. Workflows, credentials, and execution history persist in the n8n_data Docker volume, so they survive container restarts and updates.

To update n8n later:

docker compose pull
docker compose up -d

Method 2: Railway / Render (No Server Needed)

If you don't want to manage a VPS, Railway is the fastest path. Click-to-deploy from the Railway n8n template takes about 5 minutes — connect your Railway account, deploy the template, and you get a running n8n instance with a Railway-provided URL. The free tier is available but comes with cold starts (the container spins down after inactivity, so the first request after idle can take 10–20 seconds to respond). Webhooks may time out during cold starts, so if your workflows rely on real-time webhook triggers, upgrade to a paid Railway plan or move to the Docker-on-VPS path.

Render works similarly with its free tier. Same cold-start caveat applies. Both platforms are the right choice if you want the Docker-based n8n architecture without the operational overhead of managing a server — Railway is effectively the middle ground between n8n Cloud and a self-managed VPS.


Setting Up a Custom Domain + HTTPS

Running n8n on a raw IP with HTTP is fine for testing, but webhooks require a public HTTPS URL and most integrations expect a stable domain.

Caddy is the easiest option — it auto-provisions SSL certificates via Let's Encrypt with zero configuration. Install it on your server:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy

Create /etc/caddy/Caddyfile:

your-domain.com {
  reverse_proxy localhost:5678
}

That's it. Three lines. Caddy handles certificate provisioning, renewal, and HTTPS redirect automatically. Reload Caddy:

sudo systemctl reload caddy

Make sure your domain's A record points to your server IP, then visit https://your-domain.com — it should load n8n over HTTPS within 1–2 minutes of DNS propagation.

Update your docker-compose.yml N8N_PROTOCOL to https and WEBHOOK_URL to https://your-domain.com/, then restart n8n:

docker compose up -d

Self-Hosted n8n vs n8n Cloud: Honest Comparison

Here's the self-hosted n8n vs cloud breakdown without the marketing spin. For a broader look at how n8n compares to other platforms, see n8n vs Make.com.

Self-Hosted n8nn8n Cloud
Price~$5–10/month (VPS cost)$20–120+/month depending on tier
Execution limitsUnlimitedTiered — limited by plan
Data privacyFull control, data stays on your serverData processed on n8n's infrastructure
Setup time15–30 minutes (Docker method)2 minutes — instant
MaintenanceYou manage updates, backups, uptimeManaged for you
Best forTeams running high execution volume, privacy-sensitive workflows, or anyone optimizing for cost at scaleTeams that want zero ops overhead and are comfortable paying a per-execution premium for it

The honest read: n8n Cloud is worth it if server management is genuinely not something you want to touch and you're running low-to-moderate execution volume. Self-hosting wins economically once you're running more than ~1,000 executions/month, and it's the only option if data residency matters.


The Blank-Canvas Problem

Self-hosting n8n is the easy part. Once the instance is running, the real work begins: actually building the workflows that justify the setup.

This is where most self-hosted n8n users lose time. You have a running instance, full power, no execution limits — and you spend the first two or three days rebuilding workflows that already exist as tested templates. Lead enrichment pipelines, CRM sync workflows, Slack notification chains, invoice automation, AI-assisted triage — the structural work of figuring out nodes, mapping fields, and handling edge cases has already been done for every common workflow pattern.

Starting from best n8n templates skips that phase entirely. Import, connect your credentials, run. The node logic is already optimized, the error handling is in place, and you're not debugging a webhook trigger at 11pm trying to figure out why a field isn't mapping correctly.

Self-host for the cost and control. Start from templates for the speed.