Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Tool · OtherFree

Eclipse Mosquitto

Eclipse Mosquitto is a lightweight, open source MQTT broker that runs on anything from a Raspberry Pi to a server, with the mosquitto_pub and mosquitto_sub command-line clients for testing. The standard choice for running your own broker in an IoT project. Free.

Topics
GitHub stars

11.2k (eclipse-mosquitto/mosquitto)

GitHub · Sept 2026

Latest version

2.1.2

GitHub · Sept 2026

Licence

EPL / EDL

mosquitto.org · Sept 2026

Format

Tool

Topic

Other

Provider

Eclipse Foundation

Time needed

Running in minutes, configured in an hour

Level

Beginner

Access

Free

What Mosquitto is

Eclipse Mosquitto is an open source message broker for the MQTT protocol. Its website describes it as lightweight and suitable for devices from low-power single-board computers to full servers, and it implements MQTT versions 5.0, 3.1.1 and 3.1. The project also ships two command-line clients, mosquitto_pub and mosquitto_sub, which are the quickest way to publish a test message or watch everything arriving on a topic. It is part of the Eclipse Foundation, with development driven by Cedalo, and is dual licensed under the EPL and EDL.

Why use it in an IoT project

Almost every student IoT system needs a broker in the middle: devices publish readings, and dashboards, databases and alert services subscribe. Mosquitto is small enough to run on a Raspberry Pi gateway, runs on Windows, macOS and Linux, and is available as a Docker image. Running your own broker means you control authentication and data, and you can demonstrate your project without depending on a cloud service's free tier.

The one thing that confuses beginners

Mosquitto 2.0 changed the default behaviour for security. According to the migration guide, if you start it with no listener configured, it binds only to the loopback interface, so it accepts connections only from the same machine, and in that mode anonymous clients are allowed. As soon as you configure a listener, for example on port 1883 so your ESP32 can connect, allow_anonymous defaults to false, and you must set up a password file or explicitly allow anonymous access. If your board cannot connect to a fresh install, this is almost always why.

Prerequisites and time

Basic command-line skills are enough. Installing it and watching a topic with mosquitto_sub takes minutes. Adding a listener, a password file and TLS takes an hour with the documentation.

What you can do with it

  • Run a local broker on a laptop or Raspberry Pi for development and demos.
  • Test topics and payloads with mosquitto_sub -v -t 'site/#' before writing firmware.
  • Secure it with usernames, passwords, access control lists and TLS.
  • Try clients against the public test server at test.mosquitto.org, remembering it is open to anyone.

Free or paid?

Mosquitto is free and open source. Cedalo sells a commercial broker and management tools built around it, which you do not need for learning or for most projects.

Common questions

Can many devices connect? Yes. It comfortably handles the scale of a student or small business project.

Is the test server safe for real data? No. It is public, so anything you publish can be read by others.

Best for: anyone building an MQTT-based IoT system who wants a broker they control.

open sourcedevopsbeginner friendly

Ready to start?

Opens on Eclipse Foundation in a new tab.

Open resource
Link broken or out of date?

Report a problem

With "Eclipse Mosquitto". Only Tauseef reads this.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.