Works on any VPS provider

How to Install n8n on a VPS

Six steps, real spec guidance, and Docker + Caddy instead of the usual Nginx + Certbot sprawl. Provider-agnostic — pick your VPS first, then follow along.

Before You Start

A VPS with root SSH access (any provider)
A domain name, with access to its DNS records
Docker and Docker Compose installed on the server
Ports 80 and 443 open in the VPS firewall

The Setup, Step by Step

  1. 1

    Provision the VPS and note its public IP

    Any provider works — the steps below are the same on DigitalOcean, Hetzner, Linode, or a bare VPS. Pick Ubuntu 22.04 or newer if you have the choice; it's what most Docker install guides (including n8n's own) assume.

  2. 2

    Point a DNS A record at that IP

    Create an A record for the subdomain you want n8n on (e.g. n8n.yourdomain.com) pointing at the server's IP. DNS propagation can take a few minutes to a few hours depending on your registrar.

  3. 3

    SSH in and install Docker

    curl -fsSL https://get.docker.com | sh installs both Docker and the Compose plugin on most distros in one line. Confirm with docker compose version before moving on.

  4. 4

    Write the compose file and a Caddyfile

    n8n + Postgres in docker-compose.yml (see our Docker guide for the full file), plus a two-line Caddyfile — Caddy handles SSL certificate issuance and renewal automatically, no separate Certbot setup:

    n8n.yourdomain.com {
      reverse_proxy n8n:5678
    }
  5. 5

    Bring it up and verify

    docker compose up -d, then watch docker compose logs -f n8n until it reports it's listening. Visit your domain — Caddy should present a valid certificate within a few seconds of the first request.

  6. 6

    Set up backups before you rely on it

    A cron job running pg_dump against the Postgres container, shipped somewhere off the server, is the minimum viable backup. Volume snapshots at the provider level are a good second layer.

Need the full n8n + Postgres compose file? See our Docker guide.

How Much VPS Do You Actually Need?

RAM is n8n's real bottleneck, not CPU. Size for your workflow volume, not a generic recommendation.

WorkloadSpecsFits
Light1 vCPU / 2 GB RAMA handful of workflows, occasional triggers, no queue mode
Moderate2 vCPU / 4 GB RAMRegular webhook traffic, several concurrent workflows — the point where queue mode starts to matter
Heavy4+ vCPU / 8+ GB RAMHigh-volume automation, queue mode with multiple workers, large JSON payloads

Already picked a provider?

We've written the provider-specific versions of this guide for the two we use ourselves:

Or Get These Exact Specs, Pre-Installed

These are the same VPS tiers, already running n8n with backups and updates handled. From $7/mo.

Basic
Light workloads and simple automation
$7/moFree 10 days
1 vCPU
1 GB RAM
25 GB NVMe SSD
1 TB
Automatic n8n updates
Daily backup add-on ($2.2/mo)
Live logs access
One-click workflow migration
Custom domain + free subdomain
Most Popular
Standard
Small to medium workflows
$16/moFree 10 days
1 vCPU
2 GB RAM
50 GB NVMe SSD
2 TB
Automatic n8n updates
Daily backup add-on ($3.4/mo)
Live logs access
One-click workflow migration
Custom domain + free subdomain
Enhanced
Medium workloads with better performance
$29/moFree 10 days
2 vCPUs
2 GB RAM
60 GB NVMe SSD
3 TB
Automatic n8n updates
Daily backup included free
Live logs access
One-click workflow migration
Custom domain + free subdomain

Frequently Asked Questions

What's the minimum VPS size for n8n?

n8n's own documentation lists 1 GB RAM as the floor, but that's a bare-minimum figure for light testing. Once you're running scheduled workflows or handling real webhook traffic, 2 GB RAM is a more realistic starting point — RAM is n8n's actual bottleneck, not CPU, since each active execution holds its payload in memory.

Which VPS provider should I use for n8n?

Any provider that gives you root access and a public IP works — the Docker setup is identical. DigitalOcean and Hetzner are the two most commonly used for n8n specifically (see our provider-specific guides), largely because both have simple per-hour billing and NVMe storage by default.

Do I need a domain name, or can I use just an IP address?

You can run n8n on a bare IP for testing, but webhook-triggered workflows and Let's Encrypt/Caddy's automatic SSL both expect a real domain. Get a cheap domain (or a subdomain of one you own) before going further than a local test.

Is Caddy really enough for SSL, or do I need Certbot too?

Caddy handles certificate issuance and renewal on its own — no separate Certbot process, no cron job to remember. It's the reverse proxy this site's own infrastructure uses for exactly that reason: fewer moving parts than the Nginx + Certbot combination most older guides describe.

How is this different from the DigitalOcean or Hetzner-specific guides?

The steps are the same everywhere — this page is the provider-agnostic version. Our DigitalOcean and Hetzner guides add the provider-specific parts: which image to pick, region selection, and each provider's firewall UI.

What if I outgrow the VPS I picked?

Most providers let you resize a VPS to a larger plan with a short reboot, as long as you're moving up within the same CPU family. Plan for it — moving from 2 GB to 8 GB later is normal and not something you need to get right on day one.

Or Skip Straight to a Working Instance

Same specs, same n8n, zero setup — provisioned in minutes with updates and backups already handled. Free for 10 days.