Deploy N8N Basic
A minimal n8n setup to save on costs, build workflows, and automate tasks.
Main
Just deployed
/data
Just deployed
/var/lib/postgresql/data
Deploy and Host n8n Basic on Railway
n8n is a fair-code workflow automation platform for connecting APIs, apps, databases, AI models, and business processes through a visual workflow builder. It combines low-code automation with custom JavaScript, API integrations, webhooks, and AI capabilities while remaining fully self-hostable.
About Hosting n8n Basic

This template provides a minimal and cost-efficient n8n deployment using a single n8n application service backed by PostgreSQL.
It is designed for users who want the simplicity of a basic deployment without the additional infrastructure required for queue mode, Redis, dedicated workers, or external Task Runners.
PostgreSQL stores persistent application data such as workflows, credentials, execution history, users, and configuration. n8n officially supports PostgreSQL as an alternative to its default SQLite database.
The result is a lightweight architecture suitable for personal automation, small projects, prototypes, and moderate workflow workloads.
Included Architecture
| Service | Purpose |
|---|---|
| Main | n8n editor, API, webhooks, scheduling, and workflow execution |
| PostgreSQL | Persistent database for workflows, credentials, executions, and configuration |
┌─────────────────┐
│ User │
└────────┬────────┘
│
▼
Railway HTTPS Proxy
│
▼
┌─────────────────┐
│ n8n Main │
│ │
│ Editor / API │
│ Webhooks │
│ Executions │
└────────┬────────┘
│
Private Network
│
▼
┌─────────────────┐
│ PostgreSQL │
│ │
│ Persistent DB │
│ + Volume │
└─────────────────┘
Common Use Cases
- Automate repetitive personal and business tasks
- Connect APIs and SaaS applications
- Build webhook-driven workflows
- Schedule recurring automation
- Process and transform data
- Connect databases and internal services
- Send notifications and automated messages
- Build lightweight AI workflows and agents
- Automate CRM, reporting, and operational processes
- Prototype integrations before scaling to a larger architecture
Why Choose n8n Basic?
| n8n Basic | Scaled n8n Deployment |
|---|---|
| ✅ Minimal infrastructure | Multiple services |
| ✅ Lower running cost | Higher infrastructure cost |
| ✅ Simple to maintain | More operational complexity |
| ✅ PostgreSQL persistence | PostgreSQL persistence |
| Single application instance | Main, workers, Redis, and optional webhook processors |
| Best for small to moderate workloads | Best for high-volume workloads |
| Easy starting point | Designed for horizontal execution scaling |
n8n supports more advanced execution architectures such as queue mode, where Redis and separate workers distribute workflow executions. This Basic template intentionally avoids those extra services to keep resource consumption and operational complexity low.
n8n vs Other Workflow Automation Platforms
| Platform | Self-Hosted | Visual Workflows | Custom Code | AI Automation | Best Fit |
|---|---|---|---|---|---|
| n8n | ✅ Yes | ✅ Yes | ✅ Strong | ✅ Yes | Developers, APIs, AI workflows, advanced automation |
| Zapier | ❌ Primarily SaaS | ✅ Yes | ⚠️ Limited | ✅ Yes | Fast SaaS automation |
| Make | ❌ Primarily SaaS | ✅ Yes | ✅ Supported | ✅ Yes | Visual business automation |
| Activepieces | ✅ Yes | ✅ Yes | ✅ Extensible | ✅ Yes | Self-hosted workflow automation |
n8n is particularly useful when you want infrastructure control, custom API integrations, advanced workflow logic, and the ability to self-host your automation platform.
Dependencies for n8n Basic Hosting
- n8n Main — workflow automation application
- PostgreSQL — persistent application database
- Railway Private Networking — internal application-to-database connectivity
- Railway Public Networking — HTTPS access to the n8n editor and webhooks
- Persistent Storage — protects database and n8n state across redeployments
Railway provides an official guide for deploying n8n using its Docker image, persistent storage, environment variables, and webhook configuration.
Deployment Dependencies
- n8n Documentation: https://docs.n8n.io/
- n8n Docker Deployment: https://docs.n8n.io/deploy/host-n8n/install-options/install-with-docker
- n8n Database Configuration: https://docs.n8n.io/deploy/host-n8n/configure-n8n/choose-n8ns-database
- n8n Environment Variables: https://docs.n8n.io/deploy/host-n8n/configure-n8n/basic-configuration/use-environment-variables
- Railway n8n Guide: https://docs.railway.com/guides/n8n
- Railway Volumes: https://docs.railway.com/volumes
Implementation Details
This template uses the official n8n container image:
n8nio/n8n:latest
The application connects to PostgreSQL using environment variables such as:
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=
DB_POSTGRESDB_PORT=
DB_POSTGRESDB_DATABASE=
DB_POSTGRESDB_USER=
DB_POSTGRESDB_PASSWORD=
n8n documents these variables for configuring PostgreSQL as the application database.
Unlike a queue-mode deployment, this template intentionally does not require:
Redis
Workers
Webhook processors
Queue mode
External Task Runners
This keeps the stack smaller and easier to operate.
Persistent Storage
This template uses persistent storage for both the application and database layers.
n8n
The n8n service mounts persistent storage for its local application directory.
n8n recommends persisting its .n8n directory even when PostgreSQL is used because it may contain encryption-related data and other instance-specific files.
PostgreSQL
The PostgreSQL service uses a persistent Railway volume for the database files.
Railway volumes preserve service data across deployments and restarts.
Cost-Efficient by Design
This Basic variant intentionally uses only the infrastructure required for a practical persistent n8n deployment.
Compared with a full queue-mode architecture, it avoids continuously running additional Redis and worker services.
Railway charges based on provisioned plan and actual resource usage, so smaller architectures can help reduce infrastructure consumption for lightweight workloads.
Using Railway private networking for communication with PostgreSQL can also avoid unnecessary public network egress between services.
Getting Started
After deployment:
- Open the public domain generated for the Main service.
- Create your initial n8n owner account.
- Open the workflow editor.
- Create your first workflow.
- Add triggers and integration nodes.
- Configure credentials for the services you want to connect.
- Test the workflow.
- Activate it when ready.
The PostgreSQL database is already connected by the template, so no manual database configuration is required.
When Should You Upgrade to a Larger n8n Stack?
Consider moving to a worker-based or queue-mode deployment when you need:
- Higher workflow execution throughput
- Multiple concurrent workers
- Horizontal execution scaling
- Dedicated webhook processors
- Redis-backed execution queues
- Separation between editor and execution workloads
For smaller automation workloads, n8n Basic keeps the architecture simple and the infrastructure footprint low.
Why Deploy n8n Basic on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying n8n Basic on Railway, you get a minimal workflow automation stack with persistent storage and a dedicated database while keeping infrastructure complexity and running costs low.
Template Content