Railway

Deploy N8N Basic

A minimal n8n setup to save on costs, build workflows, and automate tasks.

Deploy N8N Basic

Just deployed

/data

/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

n8n

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

ServicePurpose
Mainn8n editor, API, webhooks, scheduling, and workflow execution
PostgreSQLPersistent 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 BasicScaled n8n Deployment
✅ Minimal infrastructureMultiple services
✅ Lower running costHigher infrastructure cost
✅ Simple to maintainMore operational complexity
✅ PostgreSQL persistencePostgreSQL persistence
Single application instanceMain, workers, Redis, and optional webhook processors
Best for small to moderate workloadsBest for high-volume workloads
Easy starting pointDesigned 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

PlatformSelf-HostedVisual WorkflowsCustom CodeAI AutomationBest Fit
n8n✅ Yes✅ Yes✅ Strong✅ YesDevelopers, APIs, AI workflows, advanced automation
Zapier❌ Primarily SaaS✅ Yes⚠️ Limited✅ YesFast SaaS automation
Make❌ Primarily SaaS✅ Yes✅ Supported✅ YesVisual business automation
Activepieces✅ Yes✅ Yes✅ Extensible✅ YesSelf-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

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:

  1. Open the public domain generated for the Main service.
  2. Create your initial n8n owner account.
  3. Open the workflow editor.
  4. Create your first workflow.
  5. Add triggers and integration nodes.
  6. Configure credentials for the services you want to connect.
  7. Test the workflow.
  8. 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

More templates in this category

View Template
N8N Main + Worker
Deploy and Host N8N with Inactive worker.

jakemerson
120
View Template
Evolution API with n8n
[Jul'26] WhatsApp automation platform using Evolution API, n8n & PostgreSQL

codestorm
68
View Template
Postgres Backup
Cron-based PostgreSQL backup to bucket storage

Railway Templates
870