- Run with
docker compose up
or another container orchestration tool - The broker will be available at
<container_ip>:1883
. You can check it usingdocker inspect <container_id> | grep -i ipaddress
- You can set the password using
mosquitto_passwd -c ./mqtt-broker/passwd <username> <password>
- Subscribe to a topic using
mosquitto_sub -h "<container_ip>" -p 1883 -t <topic> -u <username> -P <password>