A simple web-based management interface for the Mosquitto MQTT broker with real-time monitoring, data logging, and user management.
- Web-Based Management Interface - Easy-to-use dashboard for managing your Mosquitto broker
- User & Group Management - Create users and groups with granular ACL (Access Control List) permissions
- Real-Time Monitoring - Live MQTT message monitoring with WebSocket support
- Data Logging - Multi-resolution time-series data storage in SQLite
- Raw data (1-second resolution, 15 minutes retention)
- 1-minute intervals (6 hours retention)
- 5-minute intervals (1 day retention)
- 15-minute intervals (1 week retention)
- 1-hour intervals (1 month retention)
- 6-hour intervals (6 months retention)
- 1-day intervals (10 years retention)
- Data Channels - Monitor specific MQTT topics with customizable data extraction
- Support for numeric data, JSON path extraction, and on/off states
- Data validation with min/max thresholds
- Charting & Visualization - Built-in charts for historical data analysis
- Import/Export - Backup and restore your configuration
- Secure by Default - Auto-generated passwords, localhost-first security model
- Python 3.7+
- Mosquitto MQTT Broker (version 2.0.21 or higher recommended)
- Required Python packages (see Installation)
-
Clone the repository
git clone https://github.com/Pieter86/MQTTmanager.git cd MQTTmanager -
Install Python dependencies
pip install fastapi uvicorn paho-mqtt psutil
-
Download Mosquitto
- Windows: Download from mosquitto.org/download
- Linux:
sudo apt-get install mosquitto(or equivalent) - macOS:
brew install mosquitto
Place the
mosquittoexecutable in the same directory asmqttman.py
-
Run mqttman
python mqttman.py
-
Access the web interface
Open your browser to:
http://localhost:8088 -
First-time setup
- The monitor user password is auto-generated and stored in
.monitor_password - Create your first MQTT user via the web interface
- Configure data channels to start monitoring topics
- The monitor user password is auto-generated and stored in
python mqttman.py [options]
Options:
--port, -p PORT Web server port (default: 8088)
--host HOST Host to bind to (default: 0.0.0.0)
--mqtt-port PORT MQTT broker port (default: 1883)
--skip-version-check Skip Mosquitto version validationpython mqttman.py --port 9000python mqttman.py --host 127.0.0.1python mqttman.py --mqtt-port 1884- Local Access: Connections from
127.0.0.1are always allowed without authentication - Remote Access: Requires HTTP Basic authentication (configurable via settings)
- CORS: Restricted to localhost origins only
- Password Storage: Uses PBKDF2-SHA512 hashing for MQTT user passwords
- Auto-generated Credentials: Monitor user password is cryptographically secure
All configuration is stored in the working directory:
mosquitto.conf- Mosquitto broker configurationpasswd- MQTT user passwords (hashed)acl- Access control listusers.json- User metadatagroups.json- Group definitionsmanager_settings.json- Web UI settingsdata_logger.db- SQLite database for logged data.monitor_password- Auto-generated monitor password (keep secure!)
Create data channels to extract and log specific data from MQTT topics:
- Numeric Data: Extract numeric values from messages
- JSON Path: Extract values from JSON payloads using path notation
- On/Off States: Monitor boolean states (1/0, true/false, on/off)
Channels support validation with min/max thresholds and include historical data visualization.
The web interface provides a REST API:
GET /- Main dashboardPOST /users- Create MQTT userPUT /users/{username}- Update userDELETE /users/{username}- Delete userPOST /groups- Create groupPOST /channels- Create data channelGET /channels/{name}/data- Get channel dataPOST /service/start- Start MosquittoPOST /service/stop- Stop MosquittoGET /export- Export configurationPOST /import- Import configuration
Built with:
- FastAPI - Modern web framework
- Paho MQTT - MQTT client library
- SQLite - Time-series data storage
- WebSockets - Real-time updates
- ECharts - Data visualization
Mosquitto not starting?
- Check that
mosquitto.exe(Windows) ormosquitto(Linux/Mac) is in the same directory - Verify version is 2.0.21+ with
mosquitto --help - Check logs in the web interface
Can't access remotely?
- Set a web password in Settings
- Ensure
--host 0.0.0.0is used (default) - Check firewall settings
Data not logging?
- Verify the data channel topic pattern matches your MQTT messages
- Check the data type matches your payload format
- Use the debug view to see raw messages
Report issues on GitHub: Issues can be reported via the GitHub repository
Current version: 0.1.65