Skip to main content
Platforms

Railway

Run Rivet nodes on Railway.

Your service runs as a node: it opens a connection out to the control plane on startup. It needs no public domain and nothing pasted into a connect form.

Requirements

A namespace and a node pool created with PUT /pools/{pool} (see Nodes & Node Pools). In local development, RivetKit creates the default pool for you.

Steps

Deploy the repository

Connect your GitHub account to Railway and select the repository. Railway detects and deploys it. See Railway’s quick start.

Set the environment variables

Add RIVET_ENDPOINT as a service variable. The value is described in Deploy Nodes. See Railway’s variables docs.

If your control plane is another Railway service, reference its private domain rather than a public one.

Set the draining period

Railway kills the old deploy 0 seconds after SIGTERM by default, so actors are cut off mid-drain on every deploy.

Under Settings → Deploy, set Draining seconds. Each Rivet Actor gets up to 15 seconds to save its state, so 60 is a safe value. See Railway’s deployment teardown docs.

Verify

Call one of your Rivet Actors to confirm it responds. It reconnects automatically if the connection drops.

Signal handling

If your start command is a wrapper (npm start, yarn start, a shell script), the wrapper becomes PID 1 and swallows SIGTERM, so the drain never runs regardless of the draining period.

  • Invoke the binary directly, for example node dist/index.js.
  • Or run dumb-init or tini as PID 1 in your Dockerfile.

Scaling

Nodes are interchangeable, so raising the service’s replica count adds capacity with nothing to re-register. New replicas dial out and start serving Rivet Actors.

Removing a replica is the slow direction: it drains for up to a minute, so keep the draining period at 60 and reduce replica count gradually rather than in one step.

Railway has no CPU-target autoscaler, so replica count is fixed until you change it. Size it for peak traffic, or use Kubernetes or AWS ECS where the count moves with load.

Settings to avoid

Do not enable App Sleeping on a node. Sleeping suspends the process, which drops its connection to the control plane, and Railway only wakes a service on inbound HTTP. Node traffic is outbound, so the service would never wake and actors could not be scheduled to it.

Multi-region deploys are supported and place nodes closer to your users.

Next steps