
Deploy Centrifugo | (Just Updated) Realtime WebSocket Server, API Key and Secrets Generated
Realtime WebSocket server with API key and secrets generated
centrifugo
Just deployed
Deploy and Host Centrifugo on Railway
Centrifugo is an open-source realtime messaging server. Your backend publishes over a simple HTTP API, and browsers, mobile apps and agents receive the messages over WebSocket (or SSE / HTTP streaming) with channel subscriptions, presence and a short message history. This template deploys the official centrifugo/centrifugo image, pinned by digest, with every secret generated for you and nothing to fill in.
About Hosting Centrifugo
Centrifugo runs as a single stateless Go process using its in-memory engine. The template starts it with the HMAC secret for client JWTs, the HTTP API key, and the admin UI credentials all generated at deploy time. The public domain, the /health check and a permissive default channel configuration (clients may subscribe, publish and read history on channels that have no namespace) are preconfigured, so the service is usable the moment it is healthy. Redeploys are safe: the secrets are stored as service variables and do not rotate.
Why Deploy Centrifugo on Railway?
- No manual step: secrets are generated, the port and health path are wired up.
- Official image pinned by digest, so a redeploy never changes what runs.
- Public HTTPS and WSS endpoint out of the box.
- Cheap to run: one small Go process, no database.
Common Use Cases
- Live notifications and activity feeds for web and mobile apps.
- Chat, presence and collaborative features without running your own WebSocket layer.
- Streaming results of long jobs or LLM agents to a browser.
- Replacing Pusher, Ably or PubNub with a self-hosted server.
Dependencies for Centrifugo Hosting
Deployment Dependencies
- Image: centrifugo/centrifugo (v6.9.7)
- Docs: https://centrifugal.dev/docs/getting-started/introduction
- No database or volume needed (memory engine; history lasts 5 minutes and is lost on restart).
Machine-readable contract
service: centrifugo
base_url: https://
health: GET /health -> 200
websocket: wss:///connection/websocket
http_api: POST /api/ header X-API-Key = value of CENTRIFUGO_HTTP_API_KEY
admin_ui: https:/// login secret = value of CENTRIFUGO_ADMIN_PASSWORD
credential_variables:
CENTRIFUGO_CLIENT_TOKEN_HMAC_SECRET_KEY (signs client JWTs, HS256)
CENTRIFUGO_HTTP_API_KEY (server API key)
CENTRIFUGO_ADMIN_PASSWORD
CENTRIFUGO_ADMIN_SECRET
Publish a message:
curl -X POST https:///api/publish \
-H "X-API-Key: $CENTRIFUGO_HTTP_API_KEY" -H "Content-Type: application/json" \
-d '{"channel":"news","data":{"hello":"world"}}'
Connect a client with a JWT (HS256, signed with CENTRIFUGO_CLIENT_TOKEN_HMAC_SECRET_KEY, claim sub = user id) to wss:///connection/websocket.
Defaults are open for convenience: allowed origins are *. Restrict CENTRIFUGO_CLIENT_ALLOWED_ORIGINS and the channel permissions before production use.
Template Content
centrifugo
centrifugo/centrifugo:v6.9.7