# Node.js on Railway

Canonical: https://inetgeek.com/stacks/nodejs-on-railway/

Railway publishes its own guide for deploying Node.js.

JavaScript runtime used to run servers and build tooling outside the browser.

## What Node.js needs

Every host claims to run Node.js, so the claim on its own decides nothing. These are the things Node.js requires from the platform underneath it, and what Railway publishes about each. Railway documents 4 of the 4.

| Requirement | Railway | Why it matters |
| --- | --- | --- |
| Persistent processes | Supported | A long-running process is the point: WebSocket connections, in-memory caches and job queues all die with it. A host that only runs functions cannot keep one alive. |
| Max request duration | 15 minutes while data keeps transferring; closed after 5 minutes with no data transferred. Websocket connections are exempt and can stay open indefinitely. | Anything the process does inside a request — a large upload, a slow query, a streamed response — is bounded by this ceiling. |
| Docker deployment | Supported | Node apps routinely need a system binary the platform's buildpack does not ship. A Dockerfile is the escape hatch when they do. |
| Scales to zero | Limited — Serverless sleeps an idle service, but a slept service still holds a slot and is de-prioritised. | An always-on process bills while idle. Scaling to zero removes that cost and adds a cold start to the next request instead. |

- Persistent processes source: https://docs.railway.com/services
- Max request duration source: https://docs.railway.com/networking/public-networking/specs-and-limits
- Docker deployment source: https://docs.railway.com/guides/dockerfiles
- Scales to zero source: https://docs.railway.com/reference/app-sleeping

## What Railway documents

> In this guide, you'll learn how to deploy a Node.js and Express.js API to production using Railway.

Source: https://docs.railway.com/guides/deploy-node-express-api-with-auto-scaling-secrets-and-zero-downtime

### Node.js features on Railway

- **websockets**: Supported — Support for websockets over HTTP/1.1. [...] Websocket connections are exempt from these duration and inactivity limits, and can stay open indefinitely, even while idle. ([source](https://docs.railway.com/networking/public-networking/specs-and-limits))
- **background_workers**: Supported — A background worker is an always-on service that processes work continuously. Unlike a cron job, it does not exit after completing a task. [...] On Railway, deploy a worker as a separate service in the same project as your API. ([source](https://docs.railway.com/guides/cron-workers-queues))
- **ssh_shell_access**: Supported — Open an interactive shell session inside a deployed Railway service container, or manage the SSH keys registered with your Railway account. ([source](https://docs.railway.com/cli/ssh))

## What it costs to run there

|  | Railway |
| --- | --- |
| Entry paid plan | $5 / month (Hobby) |
| Pricing model | A base subscription fee that goes towards usage, with the plan's own credit included; anything beyond the credit is billed as resource usage. |
| When you exceed a cap | Billed automatically: on the Hobby plan ($5/month, includes $5 of resource usage) usage above the included amount is charged as a delta on top of the subscription — no throttling or suspension is documented |
| Regions | 4 regions: California, Virginia, Amsterdam, Singapore |

- Entry paid plan source: https://docs.railway.com/reference/pricing/plans
- Pricing model source: https://docs.railway.com/reference/pricing/plans
- When you exceed a cap source: https://docs.railway.com/pricing/plans
- Regions source: https://docs.railway.com/reference/regions

## Whether it suits you

Teams that want a plan fee which doubles as usage credit, and deploy services straight from a Dockerfile without managing servers. The $5 Hobby fee comes back as $5 of resource usage.

Consider something else if: You need to run in a region outside California, Virginia, Amsterdam or Singapore.

Written by Palash Bagchi on 2026-09-05. This is a recommendation, not a sourced fact — it carries no citation because it is an opinion.

## Related

- Best hosting for Node.js: https://inetgeek.com/stacks/nodejs/
- Railway: https://inetgeek.com/hosting/railway/
