Centrifugo
Centrifugo is an open source realtime messaging server you can self-host — a Pusher, Ably, and PubNub alternative that pushes live updates, chat, and presence to your web and mobile clients over WebSocket, SSE, and other transports.
What is Centrifugo?
Centrifugo is an open source realtime messaging server that pushes messages to connected users over persistent connections. It sits next to your existing backend, holds the WebSocket (and other) connections your app server shouldn’t, and broadcasts messages published to a channel out to every client subscribed to it. It’s written in Go and language-agnostic, so any backend can use it.
What is Centrifugo best for?
Centrifugo is best when you need to add live updates — chat, notifications, live scores, dashboards, collaborative presence — to an app that already has a backend in any language. It shines once you have real users, mobile clients, or more than one app server, where a bare WebSocket setup gets hard to scale. Teams reach for it to avoid the per-connection billing of hosted services while keeping data on their own infrastructure.
What can Centrifugo do?
- Multiple transports: WebSocket, HTTP-streaming, Server-Sent Events (SSE), GRPC, and experimental WebTransport, multiplexed over a single connection.
- Pub/sub channels with flexible JWT-based authentication and per-channel permissions.
- Presence and join/leave events — see who is online in a channel in real time.
- Message history and recovery — clients automatically catch up on missed messages after a reconnect.
- Delta compression (Fossil algorithm) to cut bandwidth for repetitive updates.
- Horizontal scaling across nodes via a Redis, NATS, or PostgreSQL broker — Centrifugo cites one million WebSocket connections and 30 million messages per minute.
- Server APIs over HTTP and GRPC to publish from your backend, plus Kafka and PostgreSQL consumers for a transactional-outbox pattern.
- Official client SDKs for JavaScript, Dart/Flutter, Swift/iOS, Java, Python, Go, and .NET, plus an admin web UI and Prometheus metrics.
Where does Centrifugo fall short?
- It’s a delivery layer, not a backend. Centrifugo moves messages; it doesn’t own your users, data, or business logic. You still issue auth tokens, run your own app server, and (optionally) let Centrifugo proxy connection events back to it. It complements your stack rather than replacing it.
- The headline enterprise features are PRO-only. Push notifications, ClickHouse-backed analytics, real-time tracing, rate limiting, and SSO for the admin UI live in the commercial Centrifugo PRO, not the Apache-2.0 build.
- Overkill for a single-server hobby project. If you have one app server and a handful of users, a plain WebSocket or a library like Socket.IO is simpler. Centrifugo earns its keep at scale, with mobile clients, or across multiple nodes.
Is Centrifugo free?
Yes — Centrifugo is free and open source under the Apache-2.0 license, with no connection or message limits when you self-host it. A separate commercial tier, Centrifugo PRO, adds enterprise features (push notifications, analytics, tracing, rate limiting, SSO). PRO pricing is flat and quote-based by company size (contact sales); it also offers a free sandbox mode capped at 20 concurrent connections, 2 nodes, and 5 API requests/second for evaluation.
What does Centrifugo replace?
Centrifugo is a self-hosted stand-in for hosted realtime messaging services — most directly a Pusher alternative, and also an Ably and PubNub alternative. Those services meter by connections and messages (Pusher’s paid plans start at hundreds of dollars a month with capped connections); Centrifugo trades that recurring bill for running the server yourself. It’s a different layer from backend brokers like Apache Kafka or RabbitMQ, which move messages between services rather than out to browser and mobile clients.
FAQ
Is Centrifugo open source? Yes. The core server is licensed under Apache-2.0 and developed in the open on GitHub. Only the optional Centrifugo PRO add-on is commercial and closed.
Can I self-host Centrifugo for free? Yes. The open source server is free to run with no connection or message caps. You provide the hosting; a broker like Redis or NATS is only needed once you scale beyond a single node.
Is Centrifugo a good Pusher or Ably alternative? For teams that want to avoid per-connection billing and keep data in-house, yes — it covers the same core pub/sub, presence, and history features. The tradeoff is that you operate the server and provide auth yourself, whereas Pusher and Ably are fully managed.
What do I need to run Centrifugo? A single Go binary or Docker container runs a standalone node. For multiple nodes or presence across a cluster, add a Redis, NATS, or PostgreSQL broker. Your backend issues the JWTs that clients use to connect.