Deploy NATS Server
High-performance messaging system with JetStream
NATS Server
Just deployed
/data
Deploy and Host NATS Server on Railway
NATS Server is a lightweight, high-performance messaging system for microservices, IoT and edge, with persistence through JetStream.
About Hosting NATS Server
This template runs the official nats:alpine image with JetStream enabled and a persistent volume at /data. Client connections use the Railway private network on port 4222 and require the generated NATS_TOKEN. The public URL serves the monitoring endpoint (port 8222, /healthz, /varz).
Common Use Cases
- Messaging between services in the same Railway project
- Streams and durable consumers with JetStream
- Key-value and object storage on top of NATS
Dependencies for NATS Server Hosting
- One service with a volume; nothing else
Deployment Dependencies
Why Deploy NATS Server on Railway?
Railway gives you a public HTTPS URL, a persistent volume and automatic restarts with no server to maintain. Other services connect to nats://${{NATS_TOKEN}}@nats-server.railway.internal:4222 using a reference to this service's token variable.
Template Content
NATS Server
nats:alpine