MQTT for Home (Brokers)
Mosquitto, EMQX, NanoMQ — home-scale MQTT brokers for Z2M / ESPHome / Tasmota.
MQTT is the lingua franca of consumer IoT. For the broader broker landscape (Kafka, NATS, RabbitMQ, multi-tenant MQTT) see Message Brokers; for realtime web (WebSockets, multiplayer) see Realtime. This page is the home-network slice. For the explorer GUIs to look at messages, see MQTT Explorers & Clients.
The default
- ★ Eclipse Mosquitto — the canonical home MQTT broker. Single binary, low footprint, MQTT 3.1 / 3.1.1 / 5. Available as a Home Assistant add-on (one-click install). Ships in every Linux distro.
- ★ HA Mosquitto add-on — the recommended path for HA users; integrates with HA's auth so users in HA can also auth as MQTT clients. Backups via HA snapshots.
More featureful brokers
- ★ EMQX — Erlang-based; runs comfortably at home but scales to millions of clients; great web dashboard; rule engine for transforming/forwarding messages. The "Mosquitto outgrew me" answer.
- HiveMQ Community Edition — Java; enterprise lineage; CE is free / Apache-2.0. Solid but heavier than Mosquitto.
- VerneMQ — Erlang; clustering-first; older. Niche.
- Aedes — Node.js MQTT broker; embeddable in your own Node app; small.
- NanoMQ — C; tiny; designed for edge gateways; runs on routers / SBCs at the edge of a Wi-Fi network. MQTT-SN bridge for constrained devices.
What to actually subscribe to
For a typical 2026 home stack:
- Zigbee2MQTT publishes under
zigbee2mqtt/<friendly_name>. - Z-Wave JS UI publishes under
zwave/<nodename>. - ESPHome can publish via MQTT (or use HA's native API).
- Tasmota publishes under
tasmota/<topic>. - Shelly Gen 2/3 publishes under
<device-id>/...once "Generic MQTT" is enabled. - OpenMQTTGateway publishes under
home/OMG_*/.... - room-assistant / ESPresense for BLE presence:
presence/<room>/....
mosquitto_sub -h localhost -t '#' -v is the universal "what is on my MQTT bus right now" diagnostic.
Auth, TLS, and segmentation
- ★ Use a separate username/password per client class (e.g.,
z2m,esphome,nodered). Mosquitto'spasswd_fileis fine at home scale; EMQX has built-in auth backends. - ★ TLS only matters if MQTT crosses the LAN/WAN boundary. On a flat home LAN, plaintext over a trusted Wi-Fi VLAN is the pragmatic choice.
- WebSockets endpoint — Mosquitto + EMQX both speak MQTT-over-WebSockets; useful for in-browser dashboards (see Home Assistant Dashboards) and tools like MQTT Explorer's web build.
- ACLs — limit which topics each client can read/write. The 30-second config that prevents a compromised ESP32 from publishing to your alarm topic.
Bridging / federation
- ★ Mosquitto bridge — point one Mosquitto at another, optionally filtering / remapping topics. Two ways to use it:
- Off-site sync — bridge home → cloud broker so a Grafana dashboard can see telemetry without exposing the home broker.
- HA + standalone broker — keep Z2M's broker isolated from the rest of the house and bridge only the topics HA needs.
- EMQX rule engine — transforms / routes messages between MQTT topics, Kafka, Postgres, HTTP webhooks. Handy when MQTT is your edge but your storage is elsewhere.
Persistence and retention
- Retained messages are how Z2M / Tasmota make state available immediately on restart. Don't disable.
- Persistence file (Mosquitto) — back it up; it's where retained messages and subscriptions live across restarts.
- MQTT 5 features worth knowing: shared subscriptions (load-balance among consumers), message expiry, user properties (metadata).
Sizing
- Mosquitto on a Pi comfortably handles dozens of devices and ~100 msg/sec. That covers virtually every home.
- EMQX on the same Pi handles thousands of devices with comfort.
- If you're hitting limits with Mosquitto in a single home, audit the source — usually one chatty device or a
sensor.<entity>flapping every second.
Pick this if…
- Default home broker: Mosquitto via HA add-on.
- Outgrew Mosquitto / want a UI / multi-tenant: EMQX.
- Embedding MQTT in a Node app: Aedes.
- Edge / OpenWrt router gateway: NanoMQ.
- Cross-network bridging: Mosquitto bridge feature is enough.