At 2 a.m. your n8n server stops answering webhooks, the Stripe dashboard fills with red retries, and the culprit is a $6 virtual machine doing exactly what you asked it to do: run everything at once. Self-hosting n8n is cheap, but cheap hardware fails in a specific order. This guide walks through the build we recommend for a one-vCPU server, shows what n8n's own published benchmark says about where regular mode cracks, and lists the settings, backups, and limits that keep the box alive.
Key takeaways
- Regular Mode Hits a Wall: In n8n's own benchmark on a 1-vCPU, 4 GB AWS c5.large, single mode reached response times up to 12 seconds with a 1% failure rate at 200 virtual users, and failed 38% of requests on a ten-workflow test.
- Queue Mode Fixes Intake: On the same hardware, queue mode held about 72 to 74 requests per second with zero failures, because the main process only accepts webhooks while workers run the jobs.
- Memory Is the Real Limit: A $6 DigitalOcean droplet has 1 GiB of RAM, so Postgres, Redis, the main process, and a worker compete for it. Cap concurrency and prune execution data before anything else.
- Backups Need Two Parts: A database dump alone is useless without the N8N_ENCRYPTION_KEY, because every saved credential is encrypted with it.
What a $6 Server Actually Gives You
A $6 plan gives you one shared vCPU, roughly one gigabyte of memory, and a small disk. DigitalOcean's current price list shows 1 GiB RAM, 1 vCPU, 25 GiB SSD and 1,000 GiB of transfer for $6.00 a month. Hetzner's shared-vCPU line starts around four to five euros and gives more memory for the money.
That hardware is enough for a personal automation hub, a small agency, or a side project with a few thousand runs a day. It is not enough for the default setup plus Postgres plus Redis plus a worker, unless you shape the workload on purpose. The rest of this article is that shaping.
One honest note before the numbers. We have not load-tested a 1 GiB droplet ourselves for this piece. Every throughput figure below comes from n8n's published benchmark on larger hardware, and every sizing rule is labeled as a rule of thumb you should verify with the test script near the end. If you want the cost side first, read our n8n vs Make vs Zapier cost breakdown, which shows where self-hosting starts to pay.
Choosing the Server: RAM Beats CPU
For n8n, RAM decides how many workflows survive a busy minute. Most workflows spend their time waiting on APIs, so one vCPU goes a long way, but memory is consumed by every item held in flight.
n8n's documentation says plainly that it does not restrict how much data a node can fetch, so one large API response can end a small server.
| Plan | vCPU / RAM | Disk | Price | Fits |
|---|---|---|---|---|
| DigitalOcean Basic | 1 / 1 GiB | 25 GiB | $6.00/mo | Regular mode, small Postgres, light use |
| DigitalOcean Basic | 1 / 2 GiB | 50 GiB | $12.00/mo | Queue mode with one worker, comfortable |
| DigitalOcean Basic | 2 / 2 GiB | 60 GiB | $18.00/mo | Two workers, heavier JSON jobs |
| Hetzner shared vCPU | 2 / 4 GB class | 40 GB | about 4 to 5 EUR | Best value if an EU region is fine |
Prices come from DigitalOcean's pricing page and Hetzner's cloud page, checked in November 2026. Hetzner changed its prices during 2026, so confirm the current figure before you buy.
The honest recommendation: start on 1 GiB only if you also add a swap file and cap concurrency. If the budget stretches to $12, take the 2 GiB plan and skip the swap tricks.
The Base Install: Docker Compose With Postgres
Run n8n with Docker Compose and a Postgres database, not SQLite. n8n's docs say queue mode with SQLite is not recommended, and Postgres lets you add Redis and workers later without a migration. Put the encryption key in an environment file and back it up on day one.
services:
postgres:
image: postgres:16-alpine
restart: always
environment:
POSTGRES_USER: n8n
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: n8n
volumes:
- pg_data:/var/lib/postgresql/data
n8n:
image: n8nio/n8n:latest
restart: always
ports:
- "127.0.0.1:5678:5678"
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: ${DB_PASSWORD}
DB_POSTGRESDB_DATABASE: n8n
N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
WEBHOOK_URL: https://n8n.example.com/
EXECUTIONS_DATA_SAVE_ON_SUCCESS: none
EXECUTIONS_DATA_MAX_AGE: 72
N8N_CONCURRENCY_PRODUCTION_LIMIT: 10
volumes:
- n8n_data:/home/node/.n8n
depends_on:
- postgres
volumes:
pg_data:
n8n_data:
The port binds to 127.0.0.1 on purpose. Put Caddy or Nginx in front for HTTPS, or use a Cloudflare Tunnel so the VPS exposes no inbound ports at all. Pin the image to a specific version tag once you are in production, so an update never lands by accident at 3 a.m.
What Breaks First: The Failure Order
On small servers n8n degrades in a predictable sequence: the event loop saturates, memory climbs, the operating system kills the process, and the database fills with execution history. The first symptom is slow webhook responses, not errors. The last is a restart loop. Knowing the order tells you what to fix first.
n8n's scalability benchmark makes the first stage concrete. On a c5.large (1 vCPU, 2 threads, 4 GB RAM), single mode handled up to 100 virtual users on one webhook, then reached response times up to 12 seconds with a 1% failure rate at 200. With ten different workflows triggered in parallel it was far worse: above 14 seconds at 50 users with an 11% failure rate, then 21% failures at 100 users and 38% at 200.
The cause is architectural. In regular mode one Node.js process receives webhooks, runs the workflows, and serves the editor. n8n's concurrency docs warn that too many concurrent executions thrash the event loop and degrade performance, and they note regular mode does not limit concurrent production executions unless you switch the limit on.
Treat "50 concurrent runs" as an alarm threshold, not a goal. A webhook that responds late makes the sender retry, and the retries create the next wave. Our guide to self-hosted LLMs with Ollama shows the same pile-up pattern on the inference side.
Fix One: Cap Concurrency Before Anything Else
Set N8N_CONCURRENCY_PRODUCTION_LIMIT to a number your RAM can carry. Executions above the limit wait in a first-in, first-out queue instead of running together. It is free, takes one line, and turns a crash into a short delay. n8n's docs say it applies to production executions started by webhooks or triggers.
A sensible starting value is 5 to 10 on 1 GiB and 10 to 20 on 2 GiB. Treat those as rules of thumb, not measured results. The right number is the highest one that keeps memory under about 80% during your heaviest workflow. Two details matter: manual runs, sub-workflow executions and error executions are not limited, and you cannot retry executions that are sitting in the queue.
Fix Two: Queue Mode, and When It Is Worth It
Queue mode splits the job. The main instance receives triggers and webhooks, Redis holds the queue of execution IDs, and worker processes pick jobs up and write results to the database. On the benchmark's c5.large, that change moved the single-webhook test to about 72 requests per second with latency under three seconds and zero failures at 200 virtual users.
The multi-webhook test is the strongest argument. Single mode collapsed there. Queue mode sustained about 74 requests per second from 3 to 200 virtual users with a 0% failure rate on identical hardware. The gain comes from decoupling intake from execution, not from extra CPU.
On a $6 box the catch is memory. Queue mode adds Redis and at least one worker, each a separate process. Our rule: use queue mode on 2 GiB or more, or on 1 GiB only when intake spikes are the problem and your workflows are light. Add the services like this:
redis:
image: redis:7-alpine
restart: always
command: ["redis-server", "--maxmemory", "64mb", "--maxmemory-policy", "noeviction"]
n8n-worker:
image: n8nio/n8n:latest
command: worker --concurrency=5
restart: always
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: ${DB_PASSWORD}
DB_POSTGRESDB_DATABASE: n8n
N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
EXECUTIONS_MODE: queue
QUEUE_BULL_REDIS_HOST: redis
depends_on:
- redis
- postgres
Add EXECUTIONS_MODE=queue and QUEUE_BULL_REDIS_HOST=redis to the main n8n service as well. The encryption key must be identical on the main instance and every worker, or workers cannot read credentials. Redis uses noeviction here so a full queue becomes a loud error instead of silently dropped jobs.
Fix Three: Stop the Database Growing Forever
Execution history is the quiet disk killer. n8n saves data for every run by default. Set EXECUTIONS_DATA_SAVE_ON_SUCCESS to none, keep failures, and shorten retention. Per n8n's variable reference, pruning is on by default, executions are deleted after 336 hours (14 days), and up to 10,000 are kept.
| Variable | Default | Small-server setting |
|---|---|---|
| EXECUTIONS_DATA_SAVE_ON_SUCCESS | all | none |
| EXECUTIONS_DATA_SAVE_ON_ERROR | all | all (you need these to debug) |
| EXECUTIONS_DATA_MAX_AGE | 336 hours | 72 hours |
| EXECUTIONS_DATA_PRUNE_MAX_COUNT | 10,000 | 2,000 to 5,000 |
| EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS | true | false |
Binary data deserves its own warning. In queue mode, n8n stores binary data in the database by default unless you configure another mode. A workflow that moves PDFs or images through a 25 GiB disk will eat it. Process files in small batches and pass only the fields each step needs.
Memory Survival on 1 GiB
If you stay on 1 GiB, add swap and shrink what each workflow holds. n8n's own support guidance for large workflows says to paginate and process records in controlled batches, often 100 to 200 small records at a time, and to split heavy parts into sub-workflows that pass back only what the parent needs.
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile && sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo sysctl vm.swappiness=10
docker stats --no-stream
Swap is a parachute, not a seat. If docker stats shows the stack living in swap during normal hours, the workload has outgrown the plan. n8n's docs list the signs of an out-of-memory crash: messages like "Execution stopped at this node", "Connection Lost", a 503, or "JavaScript heap out of memory" in the logs. Docker's restart policy brings n8n back, but the interrupted runs are gone.
Backups: The Two Files That Matter
A restorable n8n backup is a Postgres dump plus the encryption key. Credentials in the database are encrypted with N8N_ENCRYPTION_KEY, so a dump restored with a different key leaves every credential unreadable. Store the key in a password manager, store dumps off the server, and test one restore before you need it.
#!/usr/bin/env bash
# /usr/local/bin/n8n-backup.sh (run from cron nightly)
set -euo pipefail
STAMP=$(date +%F)
docker compose -f /opt/n8n/docker-compose.yml exec -T postgres \
pg_dump -U n8n n8n | gzip > /var/backups/n8n-$STAMP.sql.gz
# keep 14 days locally
find /var/backups -name 'n8n-*.sql.gz' -mtime +14 -delete
# copy off-box (rclone remote must exist)
rclone copy /var/backups/n8n-$STAMP.sql.gz remote:n8n-backups/
Also export your workflows as JSON into a Git repository now and then. A database dump restores everything at once, but a Git history tells you which edit broke last Tuesday's flow. Snapshots from your VPS provider are a useful third layer, though they cost extra and capture a moment, not a history.
What Nobody Tells You: Senders Retry, Updates Bite
Three failures arrive from outside the server. First, webhook senders retry on timeouts, so a slow n8n multiplies its own load. Second, the "latest" image tag will eventually move you across a breaking change. Third, the editor and the webhook endpoints share a host, so an exposed editor is an attack surface.
Fix the first with fast acknowledgement: respond to the webhook immediately and do the heavy work afterwards, and make each workflow safe to run twice by checking an event ID before acting. Fix the second by pinning versions and reading release notes before an upgrade. Fix the third by putting the editor behind a login you control, such as Cloudflare Access, and leaving only the webhook paths open.
Run a monthly "restart drill": reboot the VPS, confirm containers return on their own, send one test webhook, and check that a scheduled workflow fires. Most small-server outages are boring, and a drill finds them on your schedule instead of the customer's.
Test Your Own Box Before You Trust It
Do not trust anyone's numbers for your workflows, including ours. n8n published its benchmark scripts, and the same approach works on a small server with the free k6 tool. Create a webhook workflow that does one realistic step, then ramp up virtual users while you watch docker stats in a second terminal.
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '1m', target: 10 },
{ duration: '2m', target: 50 },
{ duration: '2m', target: 100 },
{ duration: '1m', target: 0 },
],
thresholds: {
http_req_failed: ['rate<0.01'],
http_req_duration: ['p(95)<3000'],
},
};
export default function () {
const res = http.post('https://n8n.example.com/webhook/load-test',
JSON.stringify({ id: `${__VU}-${__ITER}` }),
{ headers: { 'Content-Type': 'application/json' } });
check(res, { 'status is 200': (r) => r.status === 200 });
sleep(0.2);
}
Record three numbers at each stage: the 95th percentile response time, the failure rate, and memory in use. The step where p95 passes three seconds or failures pass 1% is your real ceiling. Set the concurrency limit just below the load that produced it, then rerun to confirm the box now slows down gracefully instead of failing.
A Plain Decision Guide
Pick the smallest setup that passes your own test. For most solo builders that means regular mode with Postgres, a concurrency cap, and pruning. Move to queue mode when intake spikes break the test. Move to a bigger plan when swap is in constant use. Leave self-hosting only when nobody owns the server, and use a managed plan then. Our cost guide shows what that costs.
Frequently Asked Questions
Can n8n run on a $6 VPS?
Yes, for light use. A $6 droplet has 1 vCPU and 1 GiB of RAM, which suits regular mode with Postgres, a concurrency cap, execution pruning, and a swap file. For bursty webhook traffic or file-heavy workflows, the 2 GiB plan is safer.
Do I need queue mode for self-hosted n8n?
Only when regular mode fails your own load test. In n8n's benchmark, queue mode held 72 to 74 requests per second with zero failures on hardware where single mode degraded badly. It needs Redis, Postgres and workers, so it costs memory a small server may not have.
How do I back up a self-hosted n8n instance?
Back up two things: a nightly Postgres dump copied off the server, and your N8N_ENCRYPTION_KEY stored in a password manager. Without the key, restored credentials cannot be decrypted. Test a full restore once, and export workflow JSON to Git for history.
What does N8N_CONCURRENCY_PRODUCTION_LIMIT do?
It caps how many production executions run at once. Extra executions wait in a first-in, first-out queue until a slot frees up. It applies to webhook and trigger runs, not manual runs or sub-workflows, and it is disabled by default.
How long does n8n keep execution data?
By default, n8n prunes executions older than 336 hours (14 days) and keeps at most 10,000. Both limits are configurable with EXECUTIONS_DATA_MAX_AGE and EXECUTIONS_DATA_PRUNE_MAX_COUNT. You can also stop saving successful runs entirely.
Is SQLite fine for a small n8n server?
SQLite works for a single regular-mode instance, but n8n's docs say it is not recommended for queue mode. Starting on Postgres costs a little memory and saves a migration when you add Redis and workers later.
Sources: n8n documentation (queue mode, concurrency control, execution variables, memory issues), the n8n scalability benchmark blog post, and the DigitalOcean and Hetzner pricing pages, all read in November 2026.
Originally published on aivlyn.com, where the tables and code render properly. This is a syndicated copy with a canonical link back to the original.
Top comments (0)