Centrifugo: Your Own Real-Time Messaging Engine, No Lock-In
If you've ever needed to add real-time features to an app—think live notifications, chat, or collaborative editing—you know the drill. You often end up choosing a third-party service. It gets you up and running fast, but then you're tied to their platform, their pricing, and their limits. What if you could have that power, but run it on your own infrastructure?
That's exactly what Centrifugo offers. It's an open-source, self-hosted server for real-time communication. It acts as a scalable connection layer between your users and your application backend, handling the persistent WebSocket or HTTP-based connections so you don't have to.
What It Does
In simple terms, Centrifugo is a real-time messaging server. Your application backend (written in any language) publishes events to it, and Centrifugo instantly pushes those events to connected clients (web, mobile, desktop). It supports common patterns like channels (for pub/sub), presence (seeing who's online), and message history.
It's not a full-stack solution that includes a backend framework. Instead, it's designed to work alongside your existing backend. You keep your user authentication, business logic, and database, and let Centrifugo handle the hard part of managing thousands of concurrent persistent connections efficiently.
Why It's Cool
The "no vendor lock-in" tagline isn't just marketing. This is the core appeal. You deploy it on your own servers or cloud VMs. You control the data, the scaling, and the costs. There's no surprise monthly bill based on connection minutes.
Beyond that, it's packed with serious features that make it production-ready:
- Multiple Protocols: It speaks WebSocket, WebTransport, Server-Sent Events (SSE), and even SockJS for fallback compatibility. Clients don't have to speak a proprietary protocol either.
- Scalability Built-In: It supports Redis, KeyDB, or Nats for backplane communication, letting you easily scale out by adding more Centrifugo nodes.
- Flexible Integration: It works with any backend. Your app can communicate with Centrifugo via its HTTP API or a gRPC API (for blazing-fast performance).
- Modern Features Out of the Box: It includes useful abstractions like channel presence, join/leave notifications, message history with automatic expiration, and connection recovery for unreliable networks.
It removes the heavy lifting of building a robust real-time layer, without handing over the keys to a third party.
How to Try It
The quickest way to see it in action is to run it via Docker. It has a sensible default configuration that lets you experiment locally.
- Pull and run the server:
docker run -p