Install/Configure the Mosquitto MQTT Broker on Synology NAS

  • Install
    1. Install Community Packages Source: https://synocommunity.com/#easy-install
    2. Search in Community and install Mosquitto
  • Configure
    1. Connect via SSH
    2. Locate mosquitto.conf: sudo find / -iname mosquitto.conf
    3. Edit config file: sudo nano /volume1/@appstore/mosquitto/var/mosquitto.conf
      • Note: if nano is not installed, use vi
    4. Locate line #allow_anonymous and edit: allow_anonymous false
    5. Locate line #password_file and edit: password_file /volume1/@appstore/mosquitto/var/pwd_file
    6. Save and close
  • Create Password File
    1. Create a new Password file with username test-user: sudo /volume1/@appstore/mosquitto/bin/mosquitto_passwd -c /volume1/@appstore/mosquitto/var/pwd_file test-user
      • Note: -U instead to add more user, -D to delete a user
    2. Type in a password when asked
  • Start and Test
    1. Start Mosquitto in the Package Center
    2. Test the connection using a MQTT Tool like MQTTBox

Leave a Reply

Your email address will not be published. Required fields are marked *