Railway

Deploy N8N (w/ postgresql and persistent nodes)

Now you can install your desired nodes once and it's done forever!

Deploy N8N (w/ postgresql and persistent nodes)

n8nio/n8n

n8nio/n8n

Just deployed

/home/node/.n8n

/var/lib/postgresql/data

Deploy and Host N8N (PostgreSQL + Persistent Community Nodes) on Railway

This tempalte provides a production-ready workflow automation platform with durable data storage and long-term support for community nodes across redeploys and version upgrades. This template packages n8n with a managed PostgreSQL instance and a configuration that ensures community nodes remain installed and available, even when the service is redeployed or upgraded.

About Hosting n8n with PostgreSQL and Persistent Nodes

Running n8n with PostgreSQL is the recommended setup for production workloads. PostgreSQL stores workflows, executions, credentials, and settings reliably across restarts. This template goes a step further by configuring n8n to automatically reinstall and persist community nodes, avoiding a common operational issue where custom nodes disappear after redeploys or image updates.

The result is a stable automation backend where workflows, data, and extensions survive infrastructure changes with no manual intervention.

Common Use Cases

  • API orchestration and backend automation
  • Data pipelines and ETL workflows
  • Internal tooling and ops automation
  • Integrations with CRMs, databases, AI services, and third-party APIs
  • Long-running or scheduled workflows requiring reliable persistence

Dependencies for n8n Hosting

  • Docker-based runtime
  • Node.js (bundled with n8n)
  • PostgreSQL (provisioned automatically by Railway)

Deployment Dependencies

Implementation Details (Optional)

This template configures n8n to:

  • Use PostgreSQL as the primary database backend
  • Persist workflow data and credentials across restarts
  • Automatically reinstall missing community nodes on startup
  • Preserve community node availability across redeploys and version upgrades

All required behavior is enabled through environment variables, making the setup reproducible and safe for upgrades without manual npm installs or shell access.

Why Deploy n8n on Railway?

Railway provides a unified platform to deploy applications and databases with minimal configuration. This template allows you to launch a complete n8n automation stack—application plus database—in minutes, while still supporting scaling and upgrades.

By deploying n8n on Railway, you get a clean path from prototyping to production, without managing servers, storage, or database lifecycle yourself.


Template Content

More templates in this category

View Template
Telegram JavaScript Bot
A template for Telegram bot in JavaScript using grammY

Agampreet Singh
View Template
Cobalt Tools [Updated Feb ’26]
Cobalt Tools [Feb ’26] (Media Downloader, Converter & Automation) Self Host

shinyduo
View Template
DiscordJS bot
A basic Discord bot written in JavaScript

opqr
1.1K
Deploy