Install MQTT Mosquitto on Raspberry Pi


This is a little tutorial to install Mosquitto Broker on Raspberry Pi Raspbian Wheezy and Jessie. So what is Mosquitto? As stated on their website.

Mosquitto is an open source (EPL/EDL licensed) message broker that implements the MQTT protocol versions 3.1 and 3.1.1. MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for “Internet of Things” messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino.

SSH into your Raspberry Pi. We won’t cover how to do that in this tutorial. If you are trying to install a MQTT broker, I assume you already know how to do this. If not, Google is your friend.

First things first, update your packages.

Now, you need to add the Mosquitto repository. Enter the following commands.

Next, make the repository available to apt-get. First we need to change to the apt sources list directory.

Now install the packages list for your version of Raspbian.

For Wheezy (old version)

For Jessie (latest)

Now update apt information and install Mosquitto.

That is it. Mosquitto is now installed and running on your Raspberry Pi.


About Author

I love to tinker, code, and create electronics. I primarily focus on Raspberry Pi (and other linux SBCs) and Arduino (and other microcontrollers that run on the Arduino platform).