Deploy Centrifugo | (Just Updated) Realtime WebSocket Server, API Key and Secrets Generated

Realtime WebSocket server with API key and secrets generated

Deploy Centrifugo | (Just Updated) Realtime WebSocket Server, API Key and Secrets Generated

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

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

More templates in this category

View Template
Celery | Web, Worker and Scheduler as Three Services
Web, worker and scheduler wired up: Celery on Redis, outcomes in Postgres.

Templates Guru
0
View Template
Redpanda
Redpanda 26.2: Kafka-compatible streaming, single node, with Kafbat UI.

Agaz Self-Host
0
View Template
smoothmq
A drop-in replacement for AWS SQS

poundifdef
7