I’m running Mosquitto in Docker on a Raspberry Pi 5 and trying to add MMC. The MMC part of my compose file looks like this:
management-center:
image: cedalo/management-center:dev
container_name: management-center
environment:
# Do not change these settings for the moment!
CEDALO_MC_BROKER_ID: mosquitto-2.0
CEDALO_MC_BROKER_NAME: Mosquitto 2.0
CEDALO_MC_BROKER_URL: mqtt://${MQTT_HOST}:1883
CEDALO_MC_BROKER_USERNAME: ${MQTT_USERNAME}
CEDALO_MC_BROKER_PASSWORD: ${MQTT_PASSWORD}
CEDALO_MC_PROXY_CONFIG_DIR: /management-center/config/config.json
ports:
- 1888:8088
depends_on:
- mosquitto
network_mode: bridge
The container starts ok - logs show this - some warnings that I think I can ignore:
2024-05-10T09:22:13.711205331Z Starting Management Center for Eclipse Mosquitto
2024-05-10T09:22:14.087775203Z No license key found or provided.
2024-05-10T09:22:14.283389587Z Fri, 10 May 2024 09:22:14 GMT express-session deprecated undefined resave option; provide resave option at start.js:180:10
2024-05-10T09:22:14.283466217Z Fri, 10 May 2024 09:22:14 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at start.js:180:10
2024-05-10T09:22:14.286913024Z Connecting to "Mosquitto 2.0" on mqtt://myhostname.domain.com:1883
2024-05-10T09:22:14.312367896Z Started Mosquitto proxy at http://localhost:8088
2024-05-10T09:22:14.321776888Z "CEDALO_MC_PLUGIN_DIR" is not set. Skipping loading of plugins
2024-05-10T09:22:14.326667013Z Mosquitto proxy server started on port 8088
2024-05-10T09:22:14.334005980Z Connected to 'Mosquitto 2.0' at mqtt://myhostname.domain.com:1883
I’ve seen other logs where I can see core and login plugins loading. I tried setting CEDALO_MC_PLUGIN_DIR to /management-center/src/plugins but that didn’t help.
Am I missing something to make the MMC front-end listen on all interfaces?
Can you set the following EnvVar: CEDALO_MC_PROXY_HOST: 0.0.0.0
This is because by default MMC listens on localhost and inside docker localhost interfaces are not forwarded to the host machine.
install mosquitto_psswd with mosquitto or mosquitto-clients package (sudo apt install mosquitto-client / brew install mosquitto etc)
Generate mosquitto password file with mosquitto_passwd -c ./mosquitto/passwd_file admin (in this case I use username admin)
Export the environment variables used in docker compose: source ./env.sh
Run the docker compose: docker-compose up -d
Check management-center logs with: docker logs management-center. In my case I get the following logs:
Starting Management Center for Eclipse Mosquitto
No license key found or provided.
Thu, 16 May 2024 08:00:32 GMT express-session deprecated undefined resave option; provide resave option at start.js:180:10
Thu, 16 May 2024 08:00:32 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at start.js:180:10
Connecting to "Mosquitto 2.0" on mqtt://mosquitto:1883
Started Mosquitto proxy at http://localhost:8088
"CEDALO_MC_PLUGIN_DIR" is not set. Skipping loading of plugins
Mosquitto proxy server started on port 8088
Connected to 'Mosquitto 2.0' at mqtt://mosquitto:1883
Go to http://localhost:1888 and login with credentials defined with MMC_USERNAME and MMC_PASSWORD environment variables.
However, if I remove CEDALO_MC_PROXY_HOST from the docker compse file, I get behavior that you describe and cannot reach MMC.
Note that you can of course also have mosquitto running externally on some other machine in your network and not necessarily define in the same docker-compose. I use it just as a proof of concept
I’m not sure what changed but it all started working when I rebuilt everything per your steps. The config looked the same but presumably I missed something.