n8n Download & Self-Host Guide (Docker, npm, VPS)
Complete n8n download and self-host guide. Docker, docker compose, npm install, minimum server specs, HTTPS reverse proxy, backups, and import free templates.
n8n download is a misleading query — there is no installer. What people actually need is a running n8n instance. This guide covers all three legitimate paths (Docker, npm, source) and gives you the production hardening checklist nobody else publishes.
Path 1: Docker (recommended)
Docker is the path n8n GmbH officially recommends. It works on any VPS — DigitalOcean, Hetzner, AWS Lightsail, Linode, Contabo. Cost: USD 5–20 per month for most workloads.
Full step-by-step in our n8n Docker guide. Minimal compose:
services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
ports:
- "5678:5678"
environment:
- N8N_HOST=n8n.yourcompany.com
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://n8n.yourcompany.com/
- GENERIC_TIMEZONE=Asia/Kolkata
- TZ=Asia/Kolkata
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data: Path 2: npm install
Quick for local development. Requires Node.js 22.12 or higher and a persistent home directory for the SQLite database.
npm install n8n -g
n8n start Not recommended for production: you lose the easy upgrade story Docker gives you, and you must manage process supervision (PM2, systemd) yourself.
Path 3: Build from source
Clone the n8n GitHub repo, run pnpm install and
pnpm build. Only worth doing if you are contributing back upstream or running a
fork. For everyone else, the Docker image is identical to what source builds produce.
Minimum server requirements
| Workload | RAM | vCPU | Disk |
|---|---|---|---|
| Personal / hobby | 1–2 GB | 1 | 10 GB SSD |
| Light agency (10 workflows) | 2 GB | 1–2 | 20 GB SSD |
| Heavy agency / AI agents | 4–8 GB | 2–4 | 40 GB+ SSD |
| High concurrency, multiple runners | 16 GB+ | 4+ | 100 GB+ SSD |
HTTPS reverse proxy
In production you must put TLS in front of n8n. Pick one:
- Caddy — easiest. Automatic Let's Encrypt certificates, one-line config.
- Traefik — best for Docker stacks with multiple services.
- Nginx — most familiar to ops engineers.
- Cloudflare Tunnel — no open ports needed; great for home-server setups.
Whichever you choose, ensure X-Forwarded-Proto is set to https and
your WEBHOOK_URL env matches your public URL exactly. Misconfigured headers are the
#1 cause of the redirect-loop login bug.
Backups
n8n stores everything in ~/.n8n — workflows, credentials (encrypted), and the
SQLite database. Back up:
- The volume mount (e.g.
n8n_datain compose). - The
N8N_ENCRYPTION_KEYenvironment variable — without it, restored credentials are unusable. - Your reverse-proxy config and TLS certificates (or rely on Let's Encrypt's auto-renew).
A nightly cron that rsyncs the volume to object storage (S3, Backblaze B2, Hetzner Storage Box) handles 95% of disaster recovery scenarios.
Upgrades
With Docker the upgrade flow is:
docker compose pulldocker compose up -d- Open the editor — n8n will run any database migrations automatically.
Always read release notes for major version bumps. Test on a staging instance with a snapshot of your prod volume before upgrading critical workflows.
Security hardening
- Set a strong
N8N_BASIC_AUTH_USER/N8N_BASIC_AUTH_PASSWORDin addition to the owner account. - Put Cloudflare in front and restrict the editor to your office IPs.
- Disable the public API in production unless you genuinely need it
(
N8N_PUBLIC_API_DISABLED=true). - Rotate
N8N_ENCRYPTION_KEYon a known cadence — but keep the old one until you have re-encrypted all credentials. - Pin your Docker image tag instead of using
latest.
Cost estimate
A real-world agency running ~30 active workflows with light AI usage on a 2-vCPU 4 GB VPS:
- VPS (Hetzner CX22 or DO Premium Intel): $5–8/month
- Object storage backups: $1/month
- Cloudflare free tier in front: $0
- Domain: $10–15/year
Versus the equivalent SaaS-only setup on Zapier or Make: typically 5–10× more once you factor in per-task pricing on AI-heavy flows.
After install: import templates
Related: Docker setup · n8n Cloud comparison · Pricing math
Frequently asked questions
- What does n8n download mean?
- n8n is not a desktop app you download as an installer. "n8n download" usually means getting a runnable instance via Docker, npm, or source build. Docker is the most common production path.
- Is self-hosted n8n really free?
- The software itself has no license fee under fair-code terms. You pay only for infrastructure (a $5–$20/month VPS works for most users) and any APIs your workflows call.
- Minimum server specs for self-hosted n8n?
- Light workloads: 2 GB RAM, 1 vCPU. AI agent and scraping workloads: 4–8 GB RAM, 2 vCPUs. Always use persistent disk for the SQLite database under ~/.n8n.
- Self-host vs n8n Cloud — which is right?
- Self-host wins for cost at scale, data residency, and custom nodes. Cloud wins for fast setup and zero infrastructure ops. Most agencies start on Cloud and migrate to self-host once executions grow.