OSI-licensed only · self-hostable

Open-Source PubNub Alternatives (2026)

PubNub is a hosted real-time messaging platform: publish and subscribe channels, presence and push delivered over a global network. It is proprietary, billed by usage. Open-source replacements give you the same publish/subscribe model on your own servers, but you run the infrastructure and handle scaling yourself.

Every tool below is under an OSI-approved licence (Apache-2.0, MIT or AGPL-3.0), checked against its repository. EMQX, a popular MQTT broker, moved to the Business Source License and is listed separately at the end.

Licences checked against each repository on November 7, 2026.

What you're replacing

  • •Publish/subscribe channels for web and mobile clients
  • •Live updates pushed to browsers
  • •Presence and shared state between users
  • •Chat and notification fan-out

At a glance

ToolBest forLicenceRuns as
CentrifugoClosest drop-in real-time messaging serverApache-2.0Docker
Socket.IOBidirectional events inside a Node.js appMITServer
MercureServer-sent events for live updatesAGPL-3.0Server
NATSBackend messaging between servicesApache-2.0Server
Supabase RealtimePostgres changes and ephemeral messagesApache-2.0Server
SoketiPusher-compatible WebSocketsAGPL-3.0Docker

1. Centrifugo

Apache-2.0

Best for: Closest drop-in real-time messaging server

An open-source scalable real-time messaging server. Clients connect over WebSocket and other transports and subscribe to channels while your backend publishes through an API.

Strengths

  • + Channel-based pub/sub like PubNub
  • + Runs as a standalone server
  • + Apache-2.0 licence

Trade-offs

  • − You operate and scale it
  • − SDK breadth differs from PubNub's

2. Socket.IO

MIT

Best for: Bidirectional events inside a Node.js app

Bidirectional, low-latency communication for every platform. A library with client and server components, including rooms for grouping connections.

Strengths

  • + Very large developer community
  • + Rooms and automatic reconnection
  • + MIT licence

Trade-offs

  • − A library, not a managed messaging network
  • − Scaling across servers needs extra setup

3. Mercure

AGPL-3.0

Best for: Server-sent events for live updates

A protocol for pushing live updates to browsers and other HTTP clients, with a free reference hub written in Go. The managed hub on mercure.rocks is a separate paid service.

Strengths

  • + Builds on plain HTTP and SSE
  • + Authorisation built into the protocol
  • + Simple hub to run

Trade-offs

  • − One-way push, not full pub/sub chat
  • − AGPL-3.0 obligations if you modify it

4. NATS

Apache-2.0

Best for: Backend messaging between services

A simple, secure and performant communications system for digital systems, services and devices. Strong for service-to-service messaging; browser clients typically connect through its WebSocket support.

Strengths

  • + Lightweight server
  • + Clustering and persistence options
  • + Apache-2.0 licence

Trade-offs

  • − Not built around browser presence features
  • − Needs design work for end-user channels

5. Supabase Realtime

Apache-2.0

Best for: Postgres changes and ephemeral messages

Sends ephemeral messages, tracks and synchronises shared state, and listens to Postgres changes over WebSockets.

Strengths

  • + Broadcast and presence-style features
  • + Reacts to database changes
  • + Apache-2.0 licence

Trade-offs

  • − Designed around the Supabase stack
  • − Elixir runtime to operate

6. Soketi

AGPL-3.0

Best for: Pusher-compatible WebSockets

A next-gen, Pusher-compatible, open-source WebSockets server. Useful if your clients already speak the Pusher protocol.

Strengths

  • + Pusher-compatible API
  • + Simple to run
  • + Fast and resilient design

Trade-offs

  • − README notes maintenance has been infrequent
  • − Not PubNub-compatible

New open-source tools, weekly

One email a week with the open-source projects, launches and releases added to TechLogHub. Unsubscribe in one click.

Get the TechLogHub digest

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.

How to choose

If you need…Start with
A standalone pub/sub server with channelsCentrifugo
Real-time events in a Node.js appSocket.IO
One-way live updates over HTTPMercure
Messaging between backend servicesNATS
Realtime on a Postgres-based stackSupabase Realtime
Existing Pusher clientsSoketi

Often called open source, but aren't

Public source code, but under licences the Open Source Initiative doesn't approve. Fine to use; read the terms first.

  • EMQX (Business Source License 1.1)

    Source is public, but since version 5.9.0 the project moved from Apache-2.0 to BSL 1.1, and multi-node clusters need a licence file. BSL is not an OSI-approved licence.

Open-source PubNub alternatives: FAQ

Quick answers to common questions

Is there an open-source alternative to PubNub?

Yes. Centrifugo (Apache-2.0) is a standalone real-time messaging server with channel subscriptions, and is the closest open-source analogue. Socket.IO, NATS and others cover different parts of the same job.

Can I self-host a PubNub replacement?

All six tools here are self-hostable. Centrifugo, Mercure and Soketi are deployed as servers or containers; Socket.IO is embedded into your own application.

Is EMQX open source?

Not any more. The repository states that from version 5.9.0 it uses the Business Source License 1.1, which is not OSI-approved.

Which option supports presence?

Supabase Realtime lists tracking and synchronising shared state among its features. Check each project's docs for presence support before committing to one.

What do I lose by leaving a hosted service?

You take on scaling, monitoring and uptime yourself. PubNub's managed global network has no direct open-source equivalent, so plan capacity for peak connection counts.

Maintain an open-source PubNub alternative?

List it on TechLogHub and we'll review it for this page.

Submit a project