Installing MQTT Broker on Linux

If you don’t have any idea about what is MQTT protocol. please click on the following link.
What is MQTT Protocol

Follow the following steps to install MQTT Broker on linux:
1)Open Linux Terminal.

2)Execute the following command to update the existing Packages.

sudo apt-get update

3)Execute the following command to install mosquitto broker.

sudo apt-get install mosquitto

While Installing if its asking for Do you want to continue? [Y/n] enter Y and hit ENTER. On linux after executing above command, Broker gets install and Mosquitto service automatically gets start.

4)Execute the following command to install MQTT Clients such as publishers and subscribers. So that you can use Linux terminal as publisher as well as subscriber.

sudo apt-get install mosquitto-clients

While Installing if its asking for Do you want to continue? [Y/n] enter Y and hit ENTER

5)Execute the following command to check Mosquitto version.

mosquitto -v

If its showing mosquitto version 1.4.15 or higher , means broker is installed sucessfully.

Please use the following link to know how to use Linux terminal as publisher and subscriber.
Linux terminal as Publisher and Subscriber

UNINSTALLING MOSQUITTO ON LINUX

If you want to uninstall mosquitto , please follow the following Steps.
1)Open Linux Terminal
2)Execute the following command to stop mosquitto Service on linux.

service mosquitto stop

3)Execute the following command to uninstall mosquitto.

sudo apt-get remove –purge mosquitto

You may also like...

Leave a Reply