---
title: "Deploy N8N"
description: "n8n on SQLite in a single service with a volume. Cheapest to run."
category: "Automation"
url: https://railway.com/deploy/n8n-7
---

# Deploy N8N

n8n on SQLite in a single service with a volume. Cheapest to run.

**[Deploy N8N on Railway](https://railway.com/template/n8n-7)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/n8n-7/manifest.json

- **Creator:** darseen
- **Category:** Automation

## Template content

### n8n https://devicons.railway.com/i/n8n.svg

- **Image:** n8nio/n8n:2.40.7
- **Start command:** `sh -c 'test "$(stat -c %U /home/node/.n8n)" = node || chown -R node:node /home/node/.n8n; export HOME=/home/node; exec su -p -s /bin/sh node -c "exec /sbin/tini -- /docker-entrypoint.sh"'`
- **Health check:** /healthz/readiness
- **Public domain:** Yes

## Documentation

# Deploy and Host N8N on Railway

**This variant: n8n Lite, a single service on SQLite.** The cheapest way to run n8n: one container and one volume, no database service to pay for. n8n is an open-source workflow automation platform with 400+ integrations, AI agent nodes and a visual editor: a self-hosted alternative to Zapier and Make with no per-execution fees.

## About Hosting N8N

This template deploys one service, `n8n`, with a volume at `/home/node/.n8n`. Workflows, credentials and execution history live in a SQLite database on that volume, next to binary files and any community nodes you install. n8n is pinned to 2.40.7.

The first boot creates the database, which takes under a minute before the healthcheck on `/healthz/readiness` turns green. Then open the public URL and **create the owner account right away**: the first visitor to an unclaimed instance becomes its owner.

## Common Use Cases

- Personal automations and side projects at the lowest monthly cost
- Trying n8n before committing to a Postgres or queue-mode setup
- Small internal tools: form handlers, notifications, scheduled reports

## Dependencies for N8N Hosting

- Nothing to bring. The n8n encryption key is generated at deploy time.
- Optional: API keys for the services your workflows connect to, added later as n8n credentials.

### Deployment Dependencies

- n8n: https://github.com/n8n-io/n8n
- Docker image: https://hub.docker.com/r/n8nio/n8n
- Database docs: https://docs.n8n.io/hosting/configuration/supported-databases-settings/

### Implementation Details 

- **Other N8N variants.** This creator also publishes n8n with Postgres, n8n in queue mode with workers, workers plus webhook processors, and a version with external task runners for Python Code nodes.
- **When to move to Postgres.** SQLite is fine for one instance, but n8n does not support queue mode on it. To move later, use n8n's `export:workflow` and `export:credentials` CLI commands, then import into a Postgres deploy with the same `N8N_ENCRYPTION_KEY`.
- **Back up `N8N_ENCRYPTION_KEY`** and the volume. The key encrypts every stored credential.
- **WAL mode.** `DB_SQLITE_POOL_SIZE=2` opens SQLite in WAL mode with two read connections, which n8n benchmarks at up to 10 times faster than the rollback journal.
- **Volume permissions.** Railway mounts volumes owned by root, so the start command hands `/home/node/.n8n` to the `node` user and then starts n8n as `node`, never as root.
- **Custom domain.** After adding one, set `N8N_EDITOR_BASE_URL` and `N8N_WEBHOOK_URL` to `https://your-domain`.
- **Upgrading.** Change the image tag to a newer `n8nio/n8n` version and redeploy; migrations run on boot.

## Why Deploy N8N 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 on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.



## 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) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [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-7
