sd-mqtt

fleet/+/telemetry

A message published on node-2 of a three-node cluster is routed to node-1, queued and copied to node-3, delivered to the device when it reconnects on node-3, and posted to an HTTP API by a rule. sensor your API node-2 node-1 node-3 device device queued copy
  1. A device subscribes to fleet/+/telemetry on node-1, then goes offline. Its session is durable, so nothing is lost.
  2. A sensor publishes on node-2, and the cluster routes the message to node-1, where the subscriber's session lives.
  3. node-1 queues the message for the absent device and copies it to node-3, so losing a node loses nothing.
  4. The device comes back on node-3. Its session moves there and the message is delivered.
  5. A rule posts the same message to your HTTP API, with a durable outbox and retries, without a plugin.

A distributed MQTT broker, Apache 2.0 licensed, all of it

Clustering, replicated queues, rules that carry messages to and from HTTP, and the admin interface are all in the one binary, under the Apache License 2.0. There is no enterprise edition and no open-core line: what is on this page is what you get. MQTT 3.1.1 and 5. Version 0.8.0.

What the sd-mqtt broker does

Apache 2.0, every feature
One licence over the whole repository and the whole binary. Clustering, replication, rules, authentication and the interface are not an upgrade; they are the product. The notices for everything compiled in ship inside every archive and image.
MQTT 3.1.1 and 5
Shared subscriptions, retained messages, wills, topic aliases and enhanced authentication, checked against Eclipse Paho's interoperability suite over TCP, TLS and WebSocket.
Durable when you give it a directory
Sessions, their subscriptions and their queued messages survive a restart, and no publisher is acknowledged before its message is on the disk.
Clustering
Nodes route to each other's subscribers, move a session to wherever its client reconnects, and keep each queue on more than one node. In synchronous mode, losing the node that owns a queue loses none of it.
Rules and connectors
Send matching messages to HTTP endpoints, accept HTTP posts as publications, poll an API, or bridge to another broker, with a durable outbox and dead letters for what could not be delivered.
Who may do what
Users with argon2 passwords or SCRAM-SHA-256, access control rules by user or client, API keys with read, write and admin scopes, and limits on publish rate and failed logins.
An interface in the broker
Live rates, connected clients, a topic browser that watches messages as they arrive, rule statistics, cluster health, and settings, served by the broker itself.

Measured on one node

  • 100,000MQTT connections held on one node for a minute, every one still answering a ping at the end
  • 2.5 sto open all 100,000 of them, about 40,000 a second, none refused
  • 32 KBof broker memory for each held connection
  • 19.4 MBresident memory on Linux, idle, with a store open and no clients
  • 9.88 MBrelease binary, static, with clustering, rules and the interface inside it
  • 10 MBcontainer image on disk, the binary and its notices and nothing else

sd-mqtt beside Mosquitto, NanoMQ, EMQX, VerneMQ and HiveMQ

What each project says about its own licence and what it ships for free, and the size of its container image. Nothing here is a speed comparison: no two published benchmarks ran on the same machine, so none is quoted.

BrokerLicenceClustering without a commercial licenceAdmin interface includedImage, compressedSource
sd-mqttApache-2.0Yes, with replicated queuesYes5.5 MBlicence
Mosquitto 2EPL-2.0 or EDL-1.0No, bridging between brokersNo13.0 MBmosquitto.org
NanoMQMITNo, bridging between brokersNo4.8 MBnanomq.io
EMQX 5.9 and laterBSL 1.1, free in production for one nodeNo, a commercial licenceYes150.2 MBlicence FAQ
VerneMQApache-2.0 source; the official packages and images need a paid subscription in productionYes, if you build it yourselfNo102.9 MBlicences
HiveMQ Community EditionApache-2.0No, the commercial editionsNo199.7 MBHiveMQ forum

Image sizes are the compressed amd64 layers of each project's current tag on Docker Hub, and of ours on GitHub's registry, read on 17 October 2026. Licence terms are as each project states them on the page linked; read that page before relying on this table.

Run the MQTT broker

Either way you get a broker on port 1883 and its admin interface on port 1884.

In a container

The image is the static broker and nothing else. It refuses to start without an admin token, because inside a container the admin port is reachable from outside.

docker run -d -p 1883:1883 -p 1884:1884 \
  -v sdmqtt-data:/data \
  -e SDMQTT_ADMIN_TOKEN="$(openssl rand -hex 24)" \
  ghcr.io/clement880101/sd-mqtt:0.8.0

As a binary

Static builds for Linux on x86-64 and ARM, and builds for macOS. Each archive carries its checksum, the licence, and the notices for everything compiled in.

tar -xzf sdmqtt-0.8.0-x86_64-unknown-linux-musl.tar.gz
cd sdmqtt-0.8.0-x86_64-unknown-linux-musl
./sdmqtt serve --store-directory ./data

Questions

Is sd-mqtt free for commercial use?
Yes. The whole repository and the whole binary are under the Apache License 2.0, including clustering, queue replication, rules, authentication and the admin interface. There is no enterprise edition and no feature behind a commercial licence.
Which MQTT versions does sd-mqtt support?
MQTT 3.1.1 and MQTT 5, over TCP, TLS, WebSocket and secure WebSocket. Shared subscriptions, retained messages, wills, topic aliases and enhanced authentication with SCRAM-SHA-256 are included, and the broker is checked against Eclipse Paho's interoperability suite.
How is sd-mqtt different from Mosquitto?
Mosquitto is a single-node broker that links brokers by bridging. sd-mqtt is a cluster: nodes route publications to each other's subscribers, a session follows its client to whichever node it reconnects to, and each queue is kept on more than one node. It also ships rules to and from HTTP and an admin interface in the same binary.
How is sd-mqtt different from EMQX?
From version 5.9, EMQX is under the Business Source License 1.1, which allows one node in production and needs a commercial licence to run a cluster. sd-mqtt is under the Apache License 2.0 and its clustering is free to run at any size.
Does sd-mqtt need a database or other services?
No. It is one static binary with an embedded store: give it a directory and sessions, subscriptions, queued messages, retained messages, rules and users survive a restart. Without a directory it runs in memory.
Which platforms does sd-mqtt run on?
Linux on x86_64 and aarch64 as a static binary, macOS on Apple silicon and Intel, and a container image for amd64 and arm64. There is no Windows build.
How do I run an MQTT cluster with sd-mqtt?
Start three nodes with the same cluster name and secret, each listing the others as seeds. The setup guide in the repository takes a Docker Compose file from nothing to a three-node cluster in six steps.
Is sd-mqtt ready for production?
It is at version 0.8.0, before 1.0. The protocol and clustering are tested, but until 1.0 the stored format may change between releases, and a store written by an earlier build is refused rather than migrated. Read the changelog before upgrading.