Set up EMQX as a self-hosted scalable MQTT broker with authentication and TLS

domain: emqx.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Download and install EMQX from the official release page for your platform; start the broker with emqx start and verify it is running with emqx_ctl status; the EMQX Dashboard is available at http://localhost:18083 with default credentials that must be changed immediately
  2. Enable TLS on the MQTT SSL listener by placing CA, server certificate, and server key files in the etc/certs/ directory; edit the listener.ssl.default section in emqx.conf (or via the Dashboard) to set cacertfile, certfile, keyfile, and verify = verify_peer for mutual TLS
  3. Configure authentication: for simple setups use the built-in password-based authenticator via the Dashboard under Access Control > Authentication; for production use an external database (MySQL, PostgreSQL, Redis) or JWT authentication plugin to centralize credential management
  4. Set up authorization (ACL rules) to restrict which clients can publish or subscribe to which topics; rules can be stored in files, a database, or evaluated by a webhook — default-deny is the safest starting posture
  5. Enable clustering for high availability by configuring the cluster discovery mechanism (e.g., static, DNS, or etcd) in emqx.conf; join nodes with emqx_ctl cluster join <node@host>; EMQX replicates session state and routing tables across cluster nodes
  6. Monitor broker health via the Dashboard metrics panel or Prometheus endpoint (/api/v5/prometheus/stats with API key auth); watch connected_clients, messages.dropped, and authentication.failure counts as primary health signals

Known gotchas

Related routes

Set up a self-hosted MQTT broker with TLS using Eclipse Mosquitto
mosquitto.org · 6 steps · unrated
Set up MQTT 5.0 shared subscriptions on EMQX to load-balance messages across a consumer group
emqx · 6 steps · unrated
Forward MQTT messages to a Kafka topic using the EMQX rule engine and Kafka Producer sink
docs.emqx.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans