---
title: "Deploy n8n [Aug 26]"
description: "n8n workflow automation + Postgres — 400+ integrations · Updated Aug 26"
category: "Automation"
url: https://railway.com/deploy/n8n-postgres-1
---

# Deploy n8n [Aug 26]

n8n workflow automation + Postgres — 400+ integrations · Updated Aug 26

**[Deploy n8n [Aug 26] on Railway](https://railway.com/template/n8n-postgres-1)**

- **Creator:** Marco Quintella's Projects
- **Category:** Automation

## Template content

### web

- **Source:** https://github.com/marco-quintella/n8n-postgres
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

## Documentation

# Deploy and Host n8n + Postgres on Railway

## About Hosting

Railway provides a streamlined platform for deploying web applications and databases. This template runs n8n — the popular workflow automation platform with 400+ integrations — on Railway with a PostgreSQL database. n8n's official Docker image is pinned to a stable version, so deploys are reproducible and updates are a one-line bump.

## Why Deploy

Deploying this template gives you a self-hosted automation platform in minutes:

- **Workflow automation** — build no-code/code workflows with 400+ integrations (HTTP, webhooks, AI, Slack, Gmail, and more)
- **Postgres-backed** — workflows, credentials, and execution history stored in PostgreSQL 16 instead of the default SQLite, ready for production
- **Zero manual setup** — database migrations run automatically on boot; the Railway deploy wizard prompts for the encryption key
- **Cheap to run** — the n8n service supports sleep (serverless) when idle; the Postgres service stays warm

## Common Use Cases

- **Automation server** — centralize integrations, webhooks, and scheduled jobs for your SaaS
- **AI workflows** — connect LLM nodes with your data and APIs (n8n has native AI/agent nodes)
- **Team productivity** — notifications, syncs, and internal tooling without writing glue code
- **Self-hosted alternative** — replace hosted automation tools with your own instance and data control

## Dependencies for

This template requires:

### Deployment Dependencies

- **PostgreSQL 16** — add the Postgres service in the Railway dashboard; the template maps `DB_*` variables automatically
- **N8N_ENCRYPTION_KEY** — required to encrypt stored credentials; generate with `openssl rand -hex 16` (the deploy wizard will prompt you)
- n8n 2.33.x image pinned in the `Dockerfile` (bump the tag to update)

## Getting Started

1. Click **Deploy on Railway**
2. In the deploy wizard, provide `N8N_ENCRYPTION_KEY` (or generate one with `openssl rand -hex 16`)
3. Add a **Postgres** service — Railway injects the connection variables automatically
4. Open the generated domain and create your n8n account

## Next Steps

- **Webhooks** — set `WEBHOOK_URL` to `https://${{RAILWAY_PUBLIC_DOMAIN}}/` so webhook URLs are reachable
- **Custom domain** — add one to your n8n service and set `N8N_HOST`
- **Sleep (serverless)** — enable sleep on the n8n service so it pauses when idle; Postgres stays awake

## License

n8n is fair-code (Sustainable Use License). This template's wrapper and configuration are MIT.


## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — [Jul'26] WhatsApp automation platform using Evolution API, n8n & PostgreSQL
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/n8n-postgres-1
