Blog / Tutorials

How to Self-Host n8n on a VPS (2026 Guide)

By the NoctHost TeamJune 27, 20263 min read

If you're paying for Zapier or Make, you already know the problem: every automation costs money. A few hundred runs per month and you're on a paid plan. A few thousand and you're looking at $50, $100, or more — just to run workflows you built yourself.

n8n fixes this. It's open-source, runs on any Linux server, and has zero execution limits. The only recurring cost is your VPS — starting at $10/month. This guide walks you through the full setup, from a blank server to a running n8n instance with HTTPS and automatic backups.

What You Need

  • A VPS with at least 2 GB RAM (4 GB recommended for production)
  • A domain name pointed at your server's IP
  • Basic comfort with SSH and the terminal

The Standard plan on NoctHost (2 vCPU, 4 GB RAM, 80 GB SSD) is a solid starting point — enough headroom to run dozens of active workflows without hitting memory pressure.

Step 1: Update Your Server and Install Docker

Connect over SSH and run:

apt update && apt upgrade -y
curl -fsSL https://get.docker.com | sh
apt install -y docker-compose-plugin

Verify Docker is working:

docker --version
docker compose version

Step 2: Create the Docker Compose File

Create a working directory and the compose file:

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

Paste this:

version: '3.8'
services:
  n8n:
    image: n8nio/n8n:latest
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://n8n.yourdomain.com/
      - GENERIC_TIMEZONE=UTC
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:

Replace n8n.yourdomain.com with your actual subdomain.

Step 3: Set Up Nginx and SSL

Install Nginx and Certbot:

apt install -y nginx certbot python3-certbot-nginx

Create an Nginx config for n8n:

nano /etc/nginx/sites-available/n8n
server {
    server_name n8n.yourdomain.com;

    location / {
        proxy_pass http://localhost:5678;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Enable the site and get a certificate:

ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
certbot --nginx -d n8n.yourdomain.com
nginx -t && systemctl reload nginx

Step 4: Start n8n

cd ~/n8n
docker compose up -d

Open https://n8n.yourdomain.com in your browser. You'll see the n8n setup wizard. Create your admin account and you're in.

Step 5: Set Up Backups

The n8n data volume contains your entire setup — workflows, credentials, settings. Back it up daily:

crontab -e

Add this line:

0 2 * * * docker run --rm -v n8n_data:/data -v /root/backups:/backup alpine tar czf /backup/n8n-$(date +%Y%m%d).tar.gz -C /data .

This creates a compressed backup every night at 2 AM. Keep at least 7 days of backups.

Cost Comparison

OptionMonthly CostExecution Limit
Zapier Starter$19.99750 tasks
Make Basic$910,000 ops
n8n Cloud Starter$202,500 executions
Self-hosted on VPS$10Unlimited

The math is clear. Self-hosting pays for itself the moment you exceed a few hundred automations per month.

Spin one up in about a minute

Email signup, pay with crypto, hourly billing. Trying a box costs cents — destroy it when you are done.

Deploy a server

Frequently asked

How much RAM does n8n actually need?
For light personal use or testing, 1 GB can work. For production with multiple active workflows, start with 2 GB and upgrade if you see out-of-memory errors. Complex parallel workflows benefit from 4 GB.
Can I run n8n without a domain name?
You can access n8n via IP and port 5678 for testing, but most webhook-based integrations require HTTPS, which requires a domain. Get a domain before going to production.
How do I update n8n?
Pull the latest image and recreate the container: cd ~/n8n, then docker compose pull, then docker compose up -d.
Is self-hosted n8n as good as n8n Cloud?
The core product is identical. You lose managed hosting and automatic updates, but gain unlimited executions, full data ownership, and no vendor lock-in.

Keep reading