EMQX — Scalable MQTT Broker for IoT and Connected Devices
EMQX is the most scalable open-source MQTT message broker. It handles 100 million+ concurrent connections with millisecond latency, powering IoT platforms, connected vehicles, industrial automation, and real-time messaging for smart devices.
What it is
EMQX is an open-source MQTT message broker designed for large-scale IoT deployments. It implements MQTT 5.0 and 3.1.1 protocols and is built on the Erlang/OTP platform, which gives it strong concurrency and fault-tolerance characteristics. EMQX powers IoT platforms, connected vehicles, industrial automation, and smart city infrastructure.
The broker targets IoT architects, embedded engineers, and backend teams building systems that need reliable pub/sub messaging at scale. If your application involves thousands to millions of devices publishing telemetry, EMQX is built for that workload.
How it saves time or tokens
EMQX eliminates the need to build custom message routing, device authentication, and connection management for IoT. Instead of stitching together a message queue, a connection pool, and an auth layer, you get a single binary that handles all three. Its rule engine processes and routes messages without writing custom code, and built-in integrations push data to databases and cloud services directly.
How to use
- Run EMQX with Docker:
docker run -d --name emqx \
-p 1883:1883 -p 8083:8083 \
-p 8084:8084 -p 8883:8883 \
-p 18083:18083 \
emqx/emqx:latest
- Access the dashboard at
http://localhost:18083with default credentials (admin / public).
- Connect an MQTT client to port 1883 and start publishing messages.
- Use the rule engine in the dashboard to route messages to databases, webhooks, or cloud services.
Example
import paho.mqtt.client as mqtt
def on_connect(client, userdata, flags, rc):
print(f'Connected with result code {rc}')
client.subscribe('sensors/temperature')
def on_message(client, userdata, msg):
print(f'{msg.topic}: {msg.payload.decode()}')
client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message
client.connect('localhost', 1883, 60)
client.loop_forever()
This subscribes to a temperature sensor topic. Any device publishing to sensors/temperature will have its messages printed.
Related on TokRepo
- Self-Hosted Solutions -- Self-hosted infrastructure platforms for IoT and beyond
- Monitoring Tools -- Tools for observing system health and device telemetry
Common pitfalls
- Default credentials on the dashboard are a security risk. Change the admin password immediately after deployment, especially in production.
- EMQX clustering requires proper network configuration. Nodes need to discover each other via DNS or static seeds, and firewalls must allow Erlang distribution ports.
- MQTT QoS 2 (exactly-once delivery) adds significant overhead. Use QoS 0 or 1 unless your application truly requires exactly-once semantics.
Frequently Asked Questions
EMQX is designed to handle millions of concurrent MQTT connections on a single cluster. The exact number depends on hardware, message rates, and QoS levels. Official benchmarks demonstrate 100 million+ connections in clustered configurations.
Yes. EMQX fully implements MQTT 5.0 including shared subscriptions, topic aliases, flow control, message expiry, and user properties. It also supports MQTT 3.1.1 and 3.1 for backward compatibility.
Yes. The built-in rule engine can route messages to PostgreSQL, MySQL, MongoDB, ClickHouse, TimescaleDB, and other databases without writing custom bridge code. Configuration is done through the dashboard or API.
EMQX has an open-source edition under the Apache 2.0 license that is free. There is also an Enterprise edition with additional features like advanced clustering, data integration, and commercial support.
Mosquitto is a lightweight single-node MQTT broker suited for small deployments. EMQX is built for horizontal scaling with native clustering, a rule engine, and a dashboard. Choose Mosquitto for embedded use; choose EMQX for production IoT platforms.
Citations (3)
- EMQX GitHub— Open-source MQTT broker handling millions of connections
- EMQX Documentation— MQTT 5.0 and 3.1.1 protocol support
- OASIS MQTT Standard— MQTT protocol specification
Related on TokRepo
Discussion
Related Assets
HumHub — Open-Source Enterprise Social Network
A flexible, open-source social networking platform built on Yii2 for creating private communities, intranets, and collaboration spaces within organizations.
Dolibarr — Open-Source ERP & CRM for Business Management
A modular open-source ERP and CRM application written in PHP for managing contacts, invoices, orders, inventory, accounting, and more from a single web interface.
PrestaShop — Open-Source PHP E-Commerce Platform
A widely adopted open-source e-commerce platform written in PHP with a rich module marketplace, multi-language support, and a strong European user base.