n8n Automation on a VPS (2026): Build Workflows Without Heavy SaaS

n8n lets you build automations without coding. A VPS keeps flows fast and reliable.
Table of Contents
- Why n8n
- VPS specs
- Install overview
- Security basics
- Backups
1. Why n8n
Replace small SaaS tasks with your own workflows.
2. VPS specs
Light CPU and RAM; SSD recommended.
3. Install overview
Use Docker; set env vars and HTTPS.
4. Security basics
Strong auth; restrict public nodes.
5. Backups
Export flows and database backups.
See /vps-hosting for plans.
Why people self-host n8n
n8n is the most flexible open-source workflow automation tool in 2026. The pitch versus Zapier/Make:
- No per-task pricing. Run a million executions/day on your own VPS.
- 400+ node integrations, plus a generic HTTP node and code node (JS/Python).
- Your data never leaves your server.
- Forkable, scriptable, version-controlled (workflows export as JSON).
It's not a drop-in replacement for Zapier in every case (some SaaS-only integrations don't exist), but for 80 % of automations it's the better tool.
VPS sizing
| Workflows / executions per day | vCPU | RAM | DB |
|---|---|---|---|
| < 50 workflows, < 1k execs | 1 | 1 GB | SQLite (default) |
| 50-300 workflows, 1-10k execs | 2 | 4 GB | Postgres |
| 300+ workflows, 10k-100k execs | 4 | 8 GB | Postgres + queue mode |
| Heavy AI workflows (LLM calls) | 4-8 | 8-16 GB | Postgres + queue + worker scaling |
Queue mode (Redis-backed) is required once you hit ~1000 executions/hour or any single workflow takes more than 30 s.
docker-compose with Postgres and queue mode
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: n8n
POSTGRES_PASSWORD: CHANGE_ME
POSTGRES_DB: n8n
volumes: [pgdata:/var/lib/postgresql/data]
restart: always
redis:
image: redis:7-alpine
restart: always
n8n:
image: n8nio/n8n:latest
restart: always
ports: ["127.0.0.1:5678:5678"]
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_DATABASE: n8n
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: CHANGE_ME
EXECUTIONS_MODE: queue
QUEUE_BULL_REDIS_HOST: redis
N8N_HOST: n8n.example.com
N8N_PORT: 5678
N8N_PROTOCOL: https
WEBHOOK_URL: https://n8n.example.com/
GENERIC_TIMEZONE: Europe/Amsterdam
N8N_BASIC_AUTH_ACTIVE: "true"
N8N_BASIC_AUTH_USER: admin
N8N_BASIC_AUTH_PASSWORD: CHANGE_ME
volumes:
- n8n-data:/home/node/.n8n
depends_on: [postgres, redis]
n8n-worker:
image: n8nio/n8n:latest
command: worker
restart: always
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_DATABASE: n8n
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: CHANGE_ME
EXECUTIONS_MODE: queue
QUEUE_BULL_REDIS_HOST: redis
depends_on: [postgres, redis]
volumes:
pgdata:
n8n-data:
Add more n8n-worker replicas as load grows.
Things you'll regret not setting on day one
N8N_DEFAULT_BINARY_DATA_MODE=filesystem
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=336 # hours, 14 days
EXECUTIONS_DATA_PRUNE_MAX_COUNT=50000
Without pruning, the executions table grows unbounded and Postgres queries slow down after weeks.
Backups
# database
docker exec n8n-postgres-1 pg_dump -U n8n n8n > /backups/n8n-$(date +%F).sql
# encryption key (without it, all credentials in DB are unrecoverable)
docker cp n8n-n8n-1:/home/node/.n8n/config /backups/n8n-encryption-key
The encryption key is the file most people forget. If you restore the DB without the key, every credential field is dead.
Common breakage
| Symptom | Cause | Fix |
|---|---|---|
| Webhooks return 404 | WEBHOOK_URL not set | set WEBHOOK_URL to public https URL |
| Workflows hang on long ops | execution timeout default | raise EXECUTIONS_TIMEOUT |
| OOM at peak | too few workers, sync mode | switch to queue mode + workers |
| "Encryption key invalid" after restore | key missing | restore /home/node/.n8n/config first |
Quick 2026 Answer
n8n Automation on a VPS (2026): Build Workflows Without Heavy SaaS is safest when you keep the VPS setup small, documented and easy to restore. A beginner should know how to update, reboot, restore a backup and read logs before adding more services. That routine matters more than installing every tool at once.
VPS Operator Checklist
- Create a non root user for daily work.
- Turn on SSH key login where possible.
- Enable basic firewall rules before exposing apps.
- Make a snapshot before risky upgrades.
- Keep app data and config paths written down.
- Test restore steps before you need them.
What Beginners Usually Miss
The hidden risk is not the first install. It is the second month, when packages need updates and nobody remembers where the config lives. Write down ports, service names, data folders and backup commands in one note.
Also watch disk space. Logs, Docker images, media files and old backups can fill a VPS quietly. A full disk can break databases and make a healthy service look broken.
Where to Go Next
For plans and safer operation, use VPS hosting, VPS SSH security hardening, VPS snapshot rollback guide. Good supporting screenshots are a firewall rule list, a snapshot screen and a simple folder map showing where the app stores data.
Real Test Routine
The safest way to handle n8n Automation on a VPS (2026): Build Workflows Without Heavy SaaS is to test the change, document it and make sure you can reverse it. A VPS can run many different services, but every service adds ports, logs, updates and backups. Keep the setup clear enough that you can fix it when tired.
Before making a change, check disk space, memory, active services and open ports. After the change, restart only the service you touched if possible. Then check logs, confirm the port is reachable and make sure the data folder still has the expected files. If the change involves packages or the kernel, make a snapshot first.
For beginners, the best VPS habit is writing down the service name, config path, data path, backup command and restore command. This turns a panic moment into a checklist. It also helps if someone else needs to help later.
When to Split Services
A single VPS is fine for learning and small projects. Split services when one app can fill disk space, use all memory or need a different update schedule. Databases, media libraries, game servers and public web apps often deserve separate backups even if they live on the same machine.
Screenshot or Generated Image Target
A useful supporting image for this page should show the actual setting, console, panel or workflow being discussed. Avoid a generic stock image if possible. A simple generated diagram is fine when it explains the flow better than a screenshot.
- Capture the main settings screen or config file.
- Add one close crop of the important value.
- Add one result screenshot after the fix or setup is working.
- Keep private IPs, tokens, emails and customer names hidden.
