n8n Self-Hosted Setup Guide: Deploy n8n on Your VPS in Under 30 Minutes (2026)
Key Findings
- Self-hosting n8n eliminates per-workflow fees โ a business running 50 active workflows saves $400+ per month vs n8n Cloud.
- Docker deployment on a $6/month VPS is sufficient for most small business automation needs.
- n8n self-hosted gives full data control โ no usage data sent to n8n GmbH servers.
- Setup time is under 30 minutes with Docker Compose โ no coding knowledge required.
n8n Cloud is the fastest way to try n8n, but it bills by usage, and that bill grows quickly once a business is running dozens of active workflows. Self-hosting removes that ceiling entirely: the same n8n software, running on a VPS you control, for a flat monthly server cost regardless of how many workflows you run or how often they trigger.
This guide walks through the exact setup โ server requirements, Docker Compose, nginx, and SSL โ that gets a self-hosted n8n instance live and production-ready in under 30 minutes, with real commands and configuration files you can copy directly.
Why self-host n8n instead of using the cloud version โ cost, control, and no task limits
n8n Cloud charges based on workflow executions, and that cost scales with usage. A business running 50 active workflows a month can pay $400 or more per month on a cloud plan sized for that volume. Self-hosted n8n runs the identical software for the flat cost of a VPS โ often $6 to $12 a month โ with no execution limit, no per-workflow fee, and no surprise overage charge when a busy month pushes volume higher than expected.
Beyond cost, self-hosting means full data control: every workflow, credential, and execution log stays on a server you manage, with nothing sent to n8n GmbH's servers. For businesses automating WhatsApp conversations, CRM records, or financial data, that is often a compliance requirement, not just a preference. For a deeper comparison against other automation platforms, see our n8n vs Zapier for business and n8n vs Make.com vs Zapier guides.
Server requirements โ minimum 1GB RAM, 1 vCPU, Ubuntu 22.04
n8n is lightweight enough to run on entry-level VPS hardware. The minimum viable specification is 1GB RAM, 1 vCPU, and Ubuntu 22.04 LTS, which is the cheapest tier offered by almost every VPS provider and is enough to handle moderate workflow volume comfortably. If you plan to run many high-volume workflows concurrently, or process large file attachments, size up to 2GB RAM or more โ but there is no need to over-provision before you know your actual usage pattern.
Before installing anything, point a subdomain such as n8n.yourdomain.com at your VPS's IP address with an A record. DNS propagation can take a few minutes, so do this first and let it resolve while you complete the next steps.
Step-by-step Docker Compose installation
With Docker and the Docker Compose plugin installed on the VPS, create a docker-compose.yml file defining the n8n service, its persistent storage volume, and the environment variables that tell n8n which domain it is running on:
version: "3.8"
services:
n8n:
image: n8nio/n8n:latest
restart: unless-stopped
ports:
- "5678:5678"
environment:
- N8N_HOST=n8n.yourdomain.com
- N8N_PROTOCOL=https
- N8N_PORT=5678
- WEBHOOK_URL=https://n8n.yourdomain.com/
- GENERIC_TIMEZONE=Asia/Dubai
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=changeme
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:Replace n8n.yourdomain.com with your actual subdomain and set a strong N8N_BASIC_AUTH_PASSWORD. Start the container with:
docker compose up -dn8n is now running on port 5678 inside the container, persisted to the n8n_data volume so workflows and credentials survive container restarts and updates.
Nginx reverse proxy configuration
n8n should never be exposed directly on port 5678 over plain HTTP. Install nginx and add a server block that proxies your domain to the container, including the headers n8n needs for webhooks and its WebSocket-based editor connection:
server {
listen 80;
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_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400;
}
}Save this as /etc/nginx/sites-available/n8n, symlink it into sites-enabled, then test and reload nginx:
sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginxSecuring with SSL using Let's Encrypt Certbot
With nginx correctly proxying plain HTTP traffic, add a free Let's Encrypt certificate using Certbot's nginx plugin, which edits the server block automatically to add HTTPS and a redirect from port 80:
sudo apt update && sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d n8n.yourdomain.com
sudo certbot renew --dry-runThe first command installs Certbot, the second issues and installs the certificate (Certbot will prompt for an email address and to agree to the Let's Encrypt terms), and the third confirms automatic renewal is working before the 90-day certificate would otherwise expire. Your n8n editor is now reachable at https://n8n.yourdomain.com with a trusted certificate.
Your first workflow after setup โ connect WhatsApp webhook and test end-to-end
With n8n live and secured, the fastest way to validate the whole stack is to build one real workflow end to end. Add a Webhook trigger node, copy its production URL, and set that URL as the callback for a WhatsApp Business API number. Send a test message to that number, and you should see the execution appear instantly in n8n's editor โ confirming that DNS, nginx, SSL, and the n8n container are all wired together correctly.
From there, build out the reply logic โ an HTTP Request node back to the WhatsApp API, or an AI node for a conversational response โ following the same pattern covered in our WhatsApp bot for business in UAE guide. Once one workflow is proven end to end, the rest of your automation can be added with confidence that the underlying infrastructure is solid. For a fully managed alternative, our n8n automation agency in Dubai guide covers what a hands-off setup and ongoing management looks like.
Frequently Asked Questions
How much does it cost to self-host n8n?
A small VPS costing roughly $6 per month is sufficient to self-host n8n for most small business automation needs. A business running 50 active workflows on n8n Cloud can pay $400 or more per month in subscription fees, so self-hosting on a $6 to $12 VPS typically pays for itself within the first week.
Do I need coding knowledge to self-host n8n?
No. Self-hosting n8n with Docker Compose requires copying a handful of terminal commands and editing one configuration file with your domain name โ no programming knowledge is required. The entire setup, from a fresh VPS to a running n8n instance with SSL, takes under 30 minutes following the steps in this guide.
What server specs do I need to run n8n?
n8n runs comfortably on a minimum of 1GB RAM and 1 vCPU on Ubuntu 22.04, which is the entry-level tier offered by most VPS providers. Businesses running many concurrent, high-volume workflows should size up to 2GB RAM or more, but a 1GB instance is enough to get started and handle moderate workflow volume.
Is self-hosted n8n as secure as n8n Cloud?
Self-hosted n8n can be made just as secure as n8n Cloud, and in some respects more secure, because you control every layer: SSH access, firewall rules, SSL certificates, and basic authentication on the n8n editor itself. Following this guide's nginx and Let's Encrypt steps gives you encrypted HTTPS access identical to what a cloud provider would offer.
Can DigiMateAI set up and manage self-hosted n8n for me?
Yes. DigiMateAI provisions, secures, and manages self-hosted n8n instances for clients as part of its automation retainer, including server hardening, SSL renewal, backups, and ongoing workflow development, so businesses get the cost savings of self-hosting without needing in-house DevOps staff.
Don't want to manage servers yourself?
We'll provision, secure, and manage your self-hosted n8n instance for you. Free discovery call included.
Chat with us on WhatsApp โ