Installing an MQTT Broker

Posted on
Thu Aug 15, 2019 10:15 am
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Installing an MQTT Broker

The most common MQTT broker is Mosquitto. It can be installed using the Brew or Ports package systems. But I prefer to run Mosquitto in a Docker container. Here's how to do that.

First, install the Docker Desktop application for MacOS X. Go to https://hub.docker.com/ and create an account, then install the client application.

Then, run this command in Terminal:
Code: Select all
docker run --detach --publish 1883:1883 --name=mosquitto  eclipse-mosquitto

This will download the eclipse-mosquitto container and run it in the background. It will map (publish) port 1883 on the local machine to port 1883 inside the Docker container.

That's it. You can now configure an MQTT Broker device for port 1883 at the local machine's IP address or the 127.0.0.1 loopback address.

Go to https://docs.docker.com/docker-for-mac/ for detailed docs on using Docker.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests