selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Centrifugo logo

Self-host Centrifugo

v6.10.3

Scalable real-time PUB/SUB messaging server over WebSockets

ReleaseOpen CoreApache-2.0
docker run --rm -v$PWD:/centrifugo centrifugo/centrifugo:v6 centrifugo genconfig
Updated3 hours ago
LanguageGo
Setup difficultyEasy
Stars
10 956
Port
8000 (HTTP server: client transports (/connection/websocket etc.), server API (/api), admin UI, Prometheus /metrics, /health and gRPC endpoints by default)
Docker
centrifugo/centrifugo
Centrifugo screenshot 1Centrifugo screenshot 2Centrifugo screenshot 3Centrifugo screenshot 4Centrifugo screenshot 5

What is Centrifugo?

Centrifugo sits in front of any application backend as a durable real-time layer: server code pushes events into channels through an HTTP or gRPC API, while browsers and devices receive them instantly over WebSocket, SSE, HTTP-streaming, gRPC, or experimental WebTransport. Channel namespaces, permission strategies, JWT or backend-proxied connection auth, history with reconnect recovery, presence with join/leave events, Fossil delta compression, backend RPC calls, and stream/map/shared-poll subscription types cover chat, live dashboards, multiplayer state sync, and AI token streaming. Running several nodes uses Redis, PostgreSQL or Nats as the engine, with optional Kafka and PostgreSQL-outbox consumers for CDC patterns; single-node setups work out of the box on the embedded memory engine. Self-hosting is a static Go binary, a Docker image, RPM/DEB packages, a Homebrew tap, or an official Helm chart; an embedded React admin panel, Prometheus metrics with a Grafana dashboard, TLS/ACME support and a health endpoint round out operations. The paid Centrifugo PRO edition — still self-hosted — adds device push delivery, ClickHouse analytics, rate limits, channel patterns and single sign-on for the admin panel. Note: by default the server sends anonymous usage counters once per 24 hours (disable with usage_stats.disabled).

Centrifugo alternatives

All self-hosted alternatives to Ably → All self-hosted alternatives to PubNub → All self-hosted alternatives to Pusher →

Should you self-host Centrifugo?

Centrifugo scores 73/100 on selfhost.directory (how scoring works) and ranks #1 of 3 in Real-time. It has 10 956 GitHub stars, +124 in the last 30 days.

It shipped 24 stable releases in the past year. The latest, v6.10.3, came out on 8 November 2026. New versions land roughly every 2 weeks.

Setup is easy: most people get it running in one sitting. An official Docker image is available. It is Apache-2.0-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is Soketi (65/100, 5 635 stars). Centrifugo scores higher overall. See Centrifugo vs Soketi side by side.

Features

  • Backend event proxying
  • CDC / transactional outbox consumers
  • Channel namespaces and permissions
  • Delta compression
  • Embedded admin web UI
  • Horizontal Scaling
  • Message history and recovery
  • Multiple real-time transports
  • Online presence
  • Prometheus Metricsmetrics endpoint disabled by default (prometheus.enabled)
  • Real-time PUB/SUB channels
  • Server HTTP and gRPC API
  • State sync subscriptions
  • WebTransportexperimental

Centrifugo README

Centrifugo

Scalable real-time messaging server in a language-agnostic way.

CI Release Docker Pulls License Telegram Discord

Centrifugo is an open-source scalable real-time messaging server. It instantly delivers messages to application online users connected over supported transports (WebSocket, HTTP-streaming, Server-Sent Events (aka EventSource), GRPC, WebTransport). Centrifugo has the concept of channel subscriptions – so it's a user-facing PUB/SUB server.

Centrifugo is language-agnostic and can be used to build chat apps, live comments, multiplayer games, real-time data visualizations, collaborative tools, AI streaming responses, etc. in combination with any backend. It is well suited for modern architectures and allows decoupling the business logic from the real-time transport layer.

How to install Centrifugo

Install Centrifugo with Docker

Docker Hub image centrifugo/centrifugo
Environment variables
CENTRIFUGO_<OPTION_NAME>

Generate a configuration file.

docker run --rm -v$PWD:/centrifugo centrifugo/centrifugo:v6 centrifugo genconfig

Run:

docker run --rm --ulimit nofile=262144:262144 -v /host/dir/with/config/file:/centrifugo -p 8000:8000 centrifugo/centrifugo:v6 centrifugo -c config.json

Docs advise pinning an exact image tag in production

How to configure Centrifugo

  • client.allowed_originsempty arrayAllowed origin patterns for WebSocket endpoints and CORS, prevents CSRF/WebSocket hijacking

    values: array of origin patterns (supports * wildcard)

  • client.token.hmac_secret_keySecret key used to check client connection/subscription JWT signatures

    values: string

  • http_api.keyKey used for Centrifugo API endpoint authorization

    values: string

  • admin.enabledfalseServe the embedded admin web interface

    values: boolean

  • client.ping_interval25sInterval to send pings to clients

    values: duration

Centrifugo releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

Does Centrifugo support webhooks?

The proxy feature integrates your session mechanism via connect proxy and lets you react to rpc, subscribe and publish events, plus RPC over the real-time connection; unsubscribe/disconnect hooks are not supported.

How can I know a message is delivered to a client?

Centrifugo has no such API – your client must send a confirmation ack to your backend after processing the message.

What if I need to send push notifications to mobile or web applications?

Push notification delivery (APNS, FCM, HMS) is provided by Centrifugo PRO; with the OSS edition you would use another solution or Firebase directly.

Is there a way to use a single connection to Centrifugo from different browser tabs?

Over HTTP/2-based transports it works automatically; with WebSocket each tab creates its own connection.

Does Centrifugo work with HTTP/3?

Experimentally since v4: enable TLS and the http3 option to serve HTTP-based endpoints over HTTP/3; WebSocket does not work over HTTP/3.

Does Centrifugo work with HTTP/2?

Yes, via the built-in Go HTTP server; it can be disabled with GODEBUG="http2server=0". WebSocket itself still runs over HTTP/1.1.

Can I use Centrifugo without reverse-proxy like Nginx before it?

Yes, the Go standard library HTTP server is designed for it, though a proxy helps with load balancing.

Centrifugo stops accepting new connections, why?

Usually the open file limit is reached; raise it as described in the infrastructure tuning docs.

Can I have both binary and JSON clients in one channel?

No – a channel's payload format must be consistent; JSON works fine even over the binary Protobuf protocol.

Any way to exclude message publisher from receiving a message from a channel?

Currently no – the team argues it creates duplicate-message pitfalls, and the correct architecture uses an idempotent identifier instead.

What about best practices with the number of channels?

Channels are lightweight so many are fine, but keep per-client subscriptions reasonable; for messenger-style group chats prefer a single personal channel per user plus broadcast.

Should I create channels explicitly?

No – channels are created automatically on the first subscription and destroyed when the last client unsubscribes; history windows are kept automatically when enabled.

Memory usage per connection?

Roughly 30-50 KB of RAM per WebSocket connection, so a 1 GB server handles about 20-30k connections; other transports differ.

How many connections can one Centrifugo instance handle?

It depends on transport, hardware, message rate and enabled features; the docs suggest keeping roughly 50-100k clients per node, but you should measure your own case.

More in Real-time

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…