Installing Mosquitto on Mac and Raspberry Pi
Introduction I needed to use MQTT for work and researched Mosquitto, which allows easy handling of MQTT. Although many have already documented Mosquitto installation, the methods differ slightly be...

Source: DEV Community
Introduction I needed to use MQTT for work and researched Mosquitto, which allows easy handling of MQTT. Although many have already documented Mosquitto installation, the methods differ slightly between Mac and Raspberry Pi, leading to some confusion. This article serves as my personal reference. Note that I won't delve into what MQTT is—please look it up if needed. Installing Mosquitto For Mac You can install it using Homebrew. brew install mosquitto The software is installed in the following paths: mosquitto (broker): /usr/local/opt/mosquitto/sbin mosquitto_sub (for subscription): /usr/local/opt/mosquitto/bin mosquitto_pub (for publishing): /usr/local/opt/mosquitto/bin Be sure to add these paths to your environment variable Path. For Raspberry Pi For Raspberry Pi or Linux, you can install Mosquitto with the following commands: # Install Mosquitto (Broker). sudo apt-get install mosquitto # Install Mosquitto clients. sudo apt-get install mosquitto-clients Starting the Broker The broker