Last active
September 16, 2024 18:27
-
-
Save ajumalp/0ad2517d15c999cfc440cdf3d623fab8 to your computer and use it in GitHub Desktop.
Install Mosquitto MQTT on Synology NAS Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From https://synocommunity.com add http://packages.synocommunity.com to your NAS package sources. | |
For that, go to NAS->Package Cnter->Click Settings->Package Sources tab. | |
Then from the community, you can see Mosquitto. Install it. | |
After installing, please stop the Mosquitto service before updating configuration. You can start service after changes. | |
Enable Admin login for Synology | |
Enable SSH in NAS | |
Download putty and connect to NAS Server | |
Login using admin | |
Change to root user [sudo -i, {use admin password}] | |
Find mosquitto.conf file [find / -name mosquitto.conf] | |
Go to that path using cd [in my case cd /volume1/@appstore/mosquitto/var] | |
Edit mosquitto.conf [vi mosquitto.conf] | |
Might say it's used by another process. Force edit. | |
Scroll down and find # allow_anonymous [around line 513] | |
Remove # and make [allow_anonymous false] [Use insert on keyboard to edit] | |
Scroll and find #password_file [around line 555] | |
Remove # and make password_file /volume1/@appstore/mosquitto/var/password_file [where 2nd password_file is the actual filename] | |
Save the file [Esc-> :wq to save] | |
Now create a file password_file in /volume1/@appstore/mosquitto/var/ | |
Ensure your are still in same directory, type vi password_file | |
This will create new file, press insert and type your username and password in below format | |
username:password [Username should not contain :]. You can add multiple users line by line | |
Save file and clseo [Esc->:wq] | |
Find mosquitto_passwd [find / -name mosquitto_passwd] | |
Stay in the mosquitto.conf folder itself. Because we have password_file file here. | |
From mosquitto.conf folder, type mosquitto_passwd [along with path] -U password_file to encrypt password. | |
In my case /volume1/@appstore/mosquitto/bin/mosquitto_passwd -U password_file | |
Start/restart Mosquitto Server | |
All done. Thank You. |
Thanks for the detailed tutorial, my MQTT server is online
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This did it for me!