PubNub Chat

Best Self Hosted Alternatives to PubNub Chat

A curated collection of the 5 best self hosted alternatives to PubNub Chat.

Cloud-hosted real-time messaging infrastructure and SDKs that provide pub/sub messaging, presence, typing indicators, message history and delivery guarantees to implement in-app chat across web and mobile applications.

Alternatives List

#1
Centrifugo

Centrifugo

Open-source, Go-based real-time messaging server for pub/sub and live updates; supports WebSocket, SSE, gRPC and brokers (Redis, NATS) with official SDKs.

Centrifugo screenshot

Centrifugo is an open-source, Go-written real-time messaging server that provides a language-agnostic pub/sub layer for delivering live updates and streaming events to web and mobile clients. It exposes HTTP and gRPC server APIs and ships official client SDKs and multiple real-time transports to integrate with existing backends and frontends. (centrifugal.dev)

Key Features

  • Multi-transport support: bidirectional WebSocket-based SDKs and unidirectional transports (WebSocket, HTTP-streaming, Server-Sent Events, gRPC) for different client constraints. (centrifugal.dev)
  • High-throughput, scalable pub/sub: optimized binary (Protobuf) and JSON protocols, built-in horizontal scaling via brokers (Redis, Redis Cluster and NATS) and idempotent publish options. (centrifugal.dev)
  • Server APIs for backend integration: HTTP API and gRPC API for publishing, presence, history, disconnects and cluster introspection. (centrifugal.dev)
  • Observability and operational tooling: Prometheus metrics, recommended Grafana dashboards and an admin web UI for runtime inspection and control. (centrifugal.dev)
  • Official SDKs and examples: client libraries and tutorials for web and mobile environments plus deployment recipes (binaries, Docker images, Helm charts). (centrifugal.dev)

Use Cases

  • Real-time chat and collaboration: scalable messaging for chat rooms, presence, and live collaboration features.
  • Live dashboards and telemetry: streaming time-series or telemetry data to many clients (metrics, game telemetry, monitoring panels).
  • Notifications and streaming AI responses: push short events or stream incremental model outputs to connected clients.

Limitations and Considerations

  • Unidirectional transports (e.g., plain SSE or HTTP-streaming) support only JSON and lack advanced SDK features such as dynamic subscriptions, automatic recovery and RPC over persistent connections; for full feature set, use bidirectional SDKs. (centrifugal.dev)
  • Some higher-level capabilities (push-notifications API, ClickHouse analytics, advanced tracing and SSO in the web UI) are provided by Centrifugo PRO (commercial add-on), not the OSS distribution. (centrifugal.dev)

Centrifugo is a mature, production-proven component for adding real-time delivery to existing stacks without rewriting application servers. It is optimized for broadcasting to large audiences, supports both JSON and binary protocols, and integrates with common brokers and observability stacks for scalable deployments.

9.7kstars
674forks
#2
ejabberd

ejabberd

ejabberd is an Erlang/OTP-based messaging server providing XMPP chat and presence, MQTT broker capabilities for IoT, and SIP services for real-time communications.

ejabberd screenshot

ejabberd is an open-source, scalable real-time messaging platform built on Erlang/OTP. It provides an XMPP server for chat and presence, and can also act as an MQTT broker and SIP service for broader real-time and IoT workloads.

Key Features

  • XMPP server with support for group chat, publish-subscribe, and many protocol extensions
  • MQTT broker functionality for lightweight device and IoT messaging
  • SIP service support and interoperability options for real-time communications
  • Native clustering designed for high concurrency and large deployments
  • Security-focused design with modern TLS support and configurable authentication options
  • Multiple deployment options including packages and container images

Use Cases

  • Team or consumer chat systems using XMPP (including multi-user chat)
  • IoT telemetry and device messaging using MQTT
  • Real-time communication backends that combine messaging and signaling needs

Limitations and Considerations

  • Full capabilities often depend on correct selection and configuration of modules and protocol extensions
  • Running large clusters typically requires operational expertise in tuning, monitoring, and database/storage choices

ejabberd is a mature, extensible platform suited to organizations needing a reliable messaging core at scale. Its multi-protocol approach makes it useful for both classic chat deployments and modern IoT-oriented messaging architectures.

6.5kstars
1.5kforks
#3
AnyCable

AnyCable

AnyCable is a realtime server for reliable two-way communication over WebSockets and SSE, designed to power chats, notifications, presence, and streaming updates for any backend.

AnyCable screenshot

AnyCable is an open source realtime server providing reliable, low-latency two-way communication over WebSockets and Server-Sent Events (SSE). It is commonly used as a scalable replacement or companion for realtime features such as chats, notifications, and presence, and integrates well with Rails and other backends.

Key Features

  • WebSockets and SSE transport support for realtime messaging
  • Delivery reliability features designed to handle brief connectivity interruptions
  • Channel/subscription abstractions (compatible with common realtime app patterns)
  • JWT-based authentication support
  • Prometheus and StatsD instrumentation for monitoring and metrics
  • Supports different deployment models, including Docker and Kubernetes-friendly setups

Use Cases

  • Realtime chats, notifications, typing indicators, and presence in web applications
  • Streaming incremental responses to clients (for example, AI response streaming)
  • Realtime dashboards and collaborative UI updates where low latency matters

AnyCable is a strong fit when you need predictable, scalable realtime delivery while keeping control of your infrastructure and integrations with existing backend services.

2.3kstars
113forks
#4
Spectrum 2

Spectrum 2

A protocol gateway that bridges users across different instant messaging networks using libpurple adapters, enabling cross-network chat and presence.

Spectrum 2 screenshot

Spectrum 2 is an open-source instant messaging transport that bridges users across disparate IM networks. It provides protocol adapters so a single client or service can communicate with contacts on other networks through a transport layer.

Key Features

  • Protocol bridging using libpurple adapters to connect many legacy and modern IM networks
  • Acts as a transport/gateway layer (commonly used with XMPP servers) to expose remote contacts and presence
  • Modular architecture with per-protocol transports and account management
  • Runs as a standalone daemon; builds with CMake and offers Docker packaging for deployment
  • Supports roster and presence synchronization and basic message relaying across networks
  • Extensible via scripting and configuration for custom behaviors and protocol tweaks

Use Cases

  • Provide an XMPP server with transports to reach users on IRC, legacy IMs, and other networks
  • Enable bots or services to interact with multiple IM ecosystems through a single gateway
  • Bridge communities using different chat protocols to allow cross-network conversations

Limitations and Considerations

  • Protocol support quality depends on the underlying libpurple adapter; some networks have limited or incomplete implementations
  • Closed or heavily encrypted platforms may be unsupported or require custom adapters and maintenance
  • Configuration and protocol troubleshooting can be complex for multi-transport deployments

Spectrum 2 is a practical solution for organizations and operators that need to interconnect multiple IM protocols via transports. It is best suited where protocol adapters exist and where operators can manage and maintain protocol-specific configuration and updates.

413stars
89forks
#5
Tigase XMPP Server

Tigase XMPP Server

Scalable, modular XMPP/Jabber server written in Java supporting TCP, BOSH, WebSockets, federation, components, HTTP API and push notifications.

Tigase XMPP Server screenshot

Tigase XMPP Server is a highly optimized, modular XMPP (Jabber) server implemented in Java. It provides core XMPP services for real-time messaging, presence, and federation and is designed for high performance and large-scale deployments.

Key Features

  • Implements core XMPP standards and many XEP extensions including stream management, message archiving, message carbons, MUC, publish-subscribe and HTTP file upload
  • Supports client connections over TCP, BOSH (HTTP long-polling), and WebSockets, plus server-to-server federation and component connections
  • Modular architecture with optional components and connectors for features like MUC, PubSub, STUN, SOCKS5 proxy and database connectors
  • HTTP API and high-performance Jetty-based components for integration and management
  • Push notifications support and tooling for large-scale, low-latency deployments
  • Designed for scalability and optimization with monitoring and management tools available as companion projects

Use Cases

  • Powering real-time chat and presence for consumer or enterprise messaging applications
  • Implementing group chat, pub/sub systems, and message archiving for collaboration platforms
  • Backend for IoT messaging and presence use cases that require XMPP interoperability

Limitations and Considerations

  • Advanced configuration and tuning requires familiarity with XMPP concepts and Java-based deployments; many capabilities are provided via optional components rather than a single monolithic UI

Tigase is suited for operators needing a standards-compliant, extensible XMPP server capable of handling large user bases and custom integrations.

351stars
113forks

Why choose an open source alternative?

  • Data ownership: Keep your data on your own servers
  • No vendor lock-in: Freedom to switch or modify at any time
  • Cost savings: Reduce or eliminate subscription fees
  • Transparency: Audit the code and know exactly what's running