122 lines
3.9 KiB
Markdown
122 lines
3.9 KiB
Markdown
---
|
|
title: Eclipse Mosquitto
|
|
created: 2026-06-08
|
|
updated: 2026-06-08
|
|
type: app
|
|
tags: [catalogue, internet-of-things, mqtt, broker, app-marathon3-rattrapage-a]
|
|
confidence: high
|
|
contested: false
|
|
sources: [https://selfh.st/apps/?tag=IoT, https://mosquitto.org/]
|
|
---
|
|
|
|
# 🦟 Eclipse Mosquitto
|
|
|
|
> **Broker MQTT léger et conforme OASIS** : le standard de la messagerie IoT, utilisé dans 90% des projets domotique, capteurs et edge computing.
|
|
|
|
## 📋 Informations Générales
|
|
|
|
| Champ | Valeur |
|
|
| :--- | :--- |
|
|
| **Site web** | [mosquitto.org](https://mosquitto.org) |
|
|
| **GitHub** | [eclipse/mosquitto](https://github.com/eclipse/mosquitto) |
|
|
| **License** | EPL-2.0 |
|
|
| **Langage** | C |
|
|
| **Étoiles GitHub** | 9.8k ⭐ |
|
|
| **Catégorie** | [[cat-internet-of-things|Internet of Things]] |
|
|
|
|
## 📝 Description
|
|
|
|
**Eclipse Mosquitto** est un **broker MQTT open source** extrêmement léger, écrit en C par Roger Light et maintenant maintenu sous l'**Eclipse Foundation** (projet Eclipse IoT).
|
|
|
|
Pourquoi c'est le standard :
|
|
- ✅ **Conforme MQTT 3.1.1 et 5.0** (OASIS standard)
|
|
- ✅ **Poids plume** : binaire ~300 KB, RAM idle < 1 MB
|
|
- ✅ **Support QoS 0/1/2** et **messages retenus (retained)**
|
|
- ✅ **Last Will & Testament** : notification de déconnexion d'un client
|
|
- ✅ **Authentification multi-sources** : fichier, base, plugin externe
|
|
- ✅ **TLS/SSL** natif (chiffrement + auth client par certificat)
|
|
- ✅ **Bridge** : interconnecter plusieurs brokers
|
|
- ✅ **Auth plugins** : MySQL, PostgreSQL, Redis, JWT
|
|
- ✅ **WebSockets** : support pour clients web (port 8083/8084)
|
|
|
|
**Différence vs RabbitMQ/HiveMQ** : Mosquitto = ultra-léger, optimisé pour IoT (milliers de clients avec peu de CPU), gratuit. HiveMQ = plus riche, Java, license commerciale.
|
|
|
|
**Pour qui** : projets domotique (Home Assistant, Zigbee2MQTT), capteurs industriels, télémétrie de véhicules, fleet management, edge AI.
|
|
|
|
## 🚀 Installation
|
|
|
|
### Docker Compose (recommandé)
|
|
|
|
```yaml
|
|
version: '3.8'
|
|
services:
|
|
mosquitto:
|
|
image: eclipse-mosquitto:2.0
|
|
container_name: mosquitto
|
|
restart: unless-stopped
|
|
ports:
|
|
- "1883:1883" # MQTT
|
|
- "9001:9001" # WebSockets (optionnel)
|
|
volumes:
|
|
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf
|
|
- ./passwd:/mosquitto/config/passwd
|
|
- mosquitto_data:/mosquitto/data
|
|
- mosquitto_log:/mosquitto/log
|
|
|
|
volumes:
|
|
mosquitto_data:
|
|
mosquitto_log:
|
|
```
|
|
|
|
### Configuration minimale
|
|
|
|
```conf
|
|
# mosquitto.conf
|
|
listener 1883
|
|
allow_anonymous false
|
|
password_file /mosquitto/config/passwd
|
|
persistence true
|
|
persistence_location /mosquitto/data/
|
|
log_dest file /mosquitto/log/mosquitto.log
|
|
```
|
|
|
|
### Générer le fichier d'utilisateurs
|
|
|
|
```bash
|
|
docker run --rm -it eclipse-mosquitto:2.0 \
|
|
mosquitto_passwd -c /mosquitto/config/passwd mqtt_user
|
|
```
|
|
|
|
## 🔄 Alternatives
|
|
|
|
### Open Source
|
|
- [[app-mqtt-web-interface]] — interface web pour Mosquitto
|
|
- [[app-zigbee2mqtt]] — pont MQTT pour Zigbee
|
|
- **EMQX** — broker MQTT distribué Erlang
|
|
- **VerneMQ** — broker MQTT en cluster
|
|
- **RabbitMQ** — broker AMQP généraliste (plugin MQTT)
|
|
- **HiveMQ Community** — broker Java
|
|
|
|
### Propriétaires
|
|
- **AWS IoT Core** — MQTT managé dans le cloud AWS
|
|
- **Azure IoT Hub** — solution Microsoft managée
|
|
- **HiveMQ Cloud** — broker managé commercial
|
|
|
|
## 🔐 Sécurité
|
|
- **TLS/SSL** : chiffrement de bout en bout (port 8883)
|
|
- **Authentification par certificat client** : X.509
|
|
- **ACL (Access Control Lists)** : limiter les topics par utilisateur
|
|
- **Auth dynamique** : plugins MySQL/Postgres pour utilisateurs en base
|
|
- **Rate limiting** : limiter les connexions par IP
|
|
- **Mises à jour Eclipse** : suivre les CVE régulièrement
|
|
|
|
## 📚 Ressources
|
|
- [Documentation officielle](https://mosquitto.org/documentation/)
|
|
- [GitHub](https://github.com/eclipse/mosquitto)
|
|
- [Test public](https://test.mosquitto.org/)
|
|
|
|
## Pages Liées
|
|
- [[cat-internet-of-things]] — Catégorie IoT
|
|
- [[app-zigbee2mqtt]] — Pont Zigbee MQTT
|
|
- [[recettes-docker-compose]] — Templates Docker
|