---
title: "Deploy ERPNext"
description: "A complete open-source ERP platform for managing modern businesses."
category: "Other"
url: https://railway.com/deploy/erpnext-railway-template
---

# Deploy ERPNext

A complete open-source ERP platform for managing modern businesses.

**[Deploy ERPNext on Railway](https://railway.com/template/erpnext-railway-template)**

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

- **Creator:** INF Labs
- **Category:** Other

## Template content

### MariaDB https://cdn.svgporn.com/logos/mariadb-icon.svg

- **Image:** mariadb
- **Start command:** `docker-entrypoint.sh mariadbd --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --skip-character-set-client-handshake`

### Redis Queue https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### Redis Cache https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### ERPNext https://www.gravatar.com/avatar/66422f771feabcf067f8c2d8f0b781d9

- **Image:** frappe/erpnext
- **Start command:** `bash -lc 'set -e; cd /home/frappe/frappe-bench; echo "[1/7] Waiting MariaDB"; wait-for-it -t 120 "$DB_HOST:$DB_PORT"; echo "[2/7] Waiting Redis Cache"; wait-for-it -t 120 "$REDIS_CACHE"; echo "[3/7] Waiting Redis Queue"; wait-for-it -t 120 "$REDIS_QUEUE"; echo "[4/7] Configuring Frappe"; ls -1 apps > sites/apps.txt; bench set-config -g db_host "$DB_HOST"; bench set-config -gp db_port "$DB_PORT"; bench set-config -g redis_cache "redis://$REDIS_CACHE"; bench set-config -g redis_queue "redis://$REDIS_QUEUE"; bench set-config -g redis_socketio "redis://$REDIS_QUEUE"; bench set-config -gp socketio_port "$SOCKETIO_PORT"; bench set-config -g chromium_path /usr/bin/chromium-headless-shell; echo "[5/7] Checking site"; if [ ! -f "sites/$SITE_NAME/site_config.json" ]; then bench new-site "$SITE_NAME" --mariadb-user-host-login-scope="%" --db-root-username="$DB_ROOT_USER" --db-root-password="$DB_ROOT_PASSWORD" --admin-password="$ADMIN_PASSWORD" --install-app erpnext --set-default; else bench --site "$SITE_NAME" migrate; fi; echo "[6/7] Starting processes"; start.sh & PID_BACKEND=$!; node /home/frappe/frappe-bench/apps/frappe/socketio.js & PID_SOCKETIO=$!; bench worker --queue short,default & PID_SHORT=$!; bench worker --queue long,default,short & PID_LONG=$!; bench schedule & PID_SCHEDULER=$!; echo "[7/7] Starting nginx"; nginx-entrypoint.sh & PID_NGINX=$!; trap "kill $PID_BACKEND $PID_SOCKETIO $PID_SHORT $PID_LONG $PID_SCHEDULER $PID_NGINX 2>/dev/null || true" TERM INT EXIT; wait -n $PID_BACKEND $PID_SOCKETIO $PID_SHORT $PID_LONG $PID_SCHEDULER $PID_NGINX; echo "One ERPNext process exited unexpectedly"; exit 1'`

## Documentation

# Deploy and Host ERPNext on Railway

ERPNext is a comprehensive open-source ERP platform built on the Frappe Framework. It provides integrated modules for accounting, CRM, sales, purchasing, inventory, manufacturing, HR, payroll, projects, assets, support, and other core business operations from a single self-hosted application.

## About Hosting ERPNext

Hosting ERPNext requires more than running a single web application because the platform depends on several supporting services for database storage, caching, background jobs, realtime communication, and scheduled tasks.

This Railway template runs ERPNext using the official `frappe/erpnext` image and consolidates its main application processes into a single ERPNext service. MariaDB stores the primary application data, Redis Cache handles transient cache data, and Redis Queue supports background jobs and realtime operations. Persistent Railway storage is mounted to the ERPNext sites directory so site configuration and uploaded files survive redeployments.

## Common Use Cases

- Run accounting, invoicing, purchasing, and financial operations
- Manage CRM, sales pipelines, customers, and quotations
- Track inventory, warehouses, stock movements, and procurement
- Manage manufacturing, bills of materials, and production workflows
- Handle HR, employees, attendance, leave, payroll, and recruitment
- Manage projects, tasks, timesheets, and internal operations
- Build a self-hosted ERP platform for small and medium-sized businesses

## Dependencies for ERPNext Hosting

- ERPNext application service using the official `frappe/erpnext` image
- MariaDB for ERPNext application and business data
- Redis Cache for application caching
- Redis Queue for background jobs and realtime communication
- Railway persistent volume mounted at `/home/frappe/frappe-bench/sites`
- Railway private networking between ERPNext, MariaDB, and Redis services
- Railway public networking for the ERPNext web interface

### Implementation Details

This template uses a Railway-friendly consolidated deployment model.

The ERPNext service runs the primary Frappe processes inside a single container:

```text
ERPNext
├── Nginx frontend
├── Gunicorn backend
├── Socket.IO
├── Queue Short
├── Queue Long
└── Scheduler
````

This allows all Frappe processes to access the same persistent sites directory:

```text
/home/frappe/frappe-bench/sites
```

The supporting architecture is:

```text
Internet
   │
   ▼
Railway Public HTTPS
   │
   ▼
ERPNext
   │
   ├── Persistent Volume
   │   └── /home/frappe/frappe-bench/sites
   │
   └── Railway Private Network
       ├── MariaDB
       ├── Redis Cache
       └── Redis Queue
```

MariaDB should remain private and use persistent storage at:

```text
/var/lib/mysql
```

Redis Cache does not require persistent storage, while Redis Queue can use:

```text
/data
```

for persistence.

Only the ERPNext service should be publicly exposed. MariaDB and both Redis services should remain accessible only through Railway's private network.

## ERPNext vs Alternatives

| Feature                   | ERPNext | Odoo |   Dolibarr | Tryton |
| ------------------------- | ------: | ---: | ---------: | -----: |
| Open source               |       ✅ |    ✅ |          ✅ |      ✅ |
| Self-hosted               |       ✅ |    ✅ |          ✅ |      ✅ |
| Accounting                |       ✅ |    ✅ |          ✅ |      ✅ |
| CRM                       |       ✅ |    ✅ |          ✅ |      ✅ |
| Inventory                 |       ✅ |    ✅ |          ✅ |      ✅ |
| Manufacturing             |       ✅ |    ✅ | ⚠️ Limited |      ✅ |
| HR & Payroll              |       ✅ |    ✅ | ⚠️ Limited |     ⚠️ |
| Project Management        |       ✅ |    ✅ |          ✅ |      ✅ |
| Built-in business modules |       ✅ |    ✅ |          ✅ |      ✅ |
| ERP-focused               |       ✅ |    ✅ |          ✅ |      ✅ |

ERPNext is particularly suitable for organizations that want a comprehensive ERP platform with accounting, CRM, inventory, manufacturing, HR, and project management integrated into a single self-hosted system.

## Why Deploy ERPNext 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 ERPNext 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

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/erpnext-railway-template
