Self-hosting · Field guide

Self-Host n8n on a VPS the Right Way

Own your automation engine without turning it into a maintenance trap.

FlowTinker · 8 min read

Self-hosting n8n gives you control over workflows, credentials and execution data. That control matters only when the service is secured, backed up and observable.

Production mindsetA container that starts is not a production system. Plan for TLS, authentication, persistence, backups and recovery.

Recommended architecture

Internet→Nginx + TLS→n8n→PostgreSQL

1. Use a dedicated subdomain

Point a subdomain to the VPS, put Nginx in front of n8n and issue a valid TLS certificate. Do not expose the internal container port publicly.

2. Persist the right data

Use PostgreSQL for workflow data. Persist the n8n directory and protect the encryption key: without the same key, restored credentials cannot be decrypted.

3. Restrict access

4. Back up for restore

Back up the database, n8n data and configuration. Encrypt off-server copies and regularly perform a restore test.

5. Monitor operations

Availability

Check the HTTPS endpoint and alert when unreachable.

Executions

Track failed workflows, queue delays and repeated retries.

Capacity

Watch disk, memory and database growth before they cause outages.

Update strategy

Read release notes, make a backup, update during a maintenance window and verify critical workflows. Pin versions instead of following latest blindly.

Video coming next

Subscribe for a complete VPS installation and recovery test.

Follow on YouTube ↗