# 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. ## Install Save in your project root: # EMQX — Scalable MQTT Broker for IoT and Connected Devices ## Quick Use ```bash # Run 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 dashboard at http://localhost:18083 # Default: admin / public # Test with MQTT client pip install paho-mqtt python3 -c " import paho.mqtt.client as mqtt client = mqtt.Client() client.connect('localhost', 1883) client.publish('test/topic', 'Hello MQTT!') client.disconnect() print('Message published') " ``` ## Introduction EMQX is the world's most scalable MQTT broker, designed for mission-critical IoT deployments. A single EMQX cluster can handle over 100 million concurrent device connections with sub-millisecond message latency. It is the backbone of IoT platforms at companies like HPE, VMware, Veolia, and automotive manufacturers. With over 16,000 GitHub stars, EMQX supports MQTT 5.0, MQTT-SN, CoAP, and LwM2M protocols. It provides built-in authentication, rule engine for data routing, and integrations with databases, message queues, and cloud services. ## What EMQX Does EMQX receives messages from IoT devices via MQTT protocol, routes them based on configurable rules, and delivers them to subscribers or external systems. Its rule engine can filter, transform, and forward messages to Kafka, databases, HTTP endpoints, and cloud services without writing code. ## Architecture Overview ``` [IoT Devices / Sensors / Apps] MQTT 3.1.1, MQTT 5.0, WebSocket, CoAP, LwM2M | [EMQX Cluster] Distributed Erlang/OTP Masterless clustering | +-------+-------+-------+ | | | | [Auth] [Rule [Data LDAP, Engine] Bridge] JWT, Filter, Kafka, MySQL, transform PostgreSQL, Redis route HTTP, S3 | [Dashboard] Real-time monitoring Client management Rule configuration ``` ## Self-Hosting & Configuration ```bash # Docker Compose cluster version: "3.8" services: emqx1: image: emqx/emqx:latest environment: EMQX_NAME: emqx EMQX_CLUSTER__DISCOVERY_STRATEGY: static EMQX_CLUSTER__STATIC__SEEDS: "[emqx@emqx1.emqx.io, emqx@emqx2.emqx.io]" ports: - 1883:1883 - 18083:18083 emqx2: image: emqx/emqx:latest environment: EMQX_NAME: emqx EMQX_CLUSTER__DISCOVERY_STRATEGY: static EMQX_CLUSTER__STATIC__SEEDS: "[emqx@emqx1.emqx.io, emqx@emqx2.emqx.io]" ``` ## Key Features - **100M+ Connections** — handle massive device fleets per cluster - **MQTT 5.0** — full support for the latest MQTT standard - **Rule Engine** — no-code data routing, filtering, and transformation - **Data Bridges** — forward to Kafka, PostgreSQL, MySQL, HTTP, and more - **Authentication** — built-in JWT, username/password, LDAP, X.509 certs - **Clustering** — masterless cluster with automatic discovery - **WebSocket** — MQTT over WebSocket for browser clients - **Dashboard** — real-time monitoring, client management, and configuration ## Comparison with Similar Tools | Feature | EMQX | Mosquitto | HiveMQ | VerneMQ | NanoMQ | |---|---|---|---|---|---| | Scale | 100M+ connections | Single-node | Enterprise | Distributed | Embedded | | Clustering | Yes (masterless) | No | Yes | Yes | No | | Rule Engine | Yes (built-in) | No | Yes | No | No | | Dashboard | Yes | No | Yes | No | No | | Language | Erlang/OTP | C | Java | Erlang | C | | Best For | Large IoT platforms | Small/embedded | Enterprise Java | OSS distributed | Edge/embedded | | License | Apache-2.0 | EPL/EDL | Commercial | Apache-2.0 | MIT | ## FAQ **Q: EMQX vs Mosquitto — which should I use?** A: Mosquitto for small deployments, embedded systems, and learning MQTT. EMQX for production IoT platforms that need clustering, rule engine, authentication, and monitoring dashboards. **Q: How does EMQX handle 100 million connections?** A: Built on Erlang/OTP (designed for telecom), EMQX uses lightweight processes and distributed state. A cluster of nodes shares the connection load with automatic discovery and failover. **Q: Can EMQX replace Kafka for IoT?** A: They serve different purposes. EMQX is a message broker for device connectivity (pub/sub). Kafka is a distributed log for data streaming. Many architectures use both: EMQX for device communication, bridging messages to Kafka for processing. **Q: Is EMQX free?** A: EMQX Open Source is free (Apache-2.0) with no connection limits. EMQX Enterprise adds features like data persistence, schema validation, and priority support. ## Sources - GitHub: https://github.com/emqx/emqx - Documentation: https://docs.emqx.com - Website: https://www.emqx.com - Created by EMQ Technologies - License: Apache-2.0 --- Source: https://tokrepo.com/en/workflows/8d172897-3734-11f1-9bc6-00163e2b0d79 Author: AI Open Source