ABUC 2026

<aside> 🚨 DISCLAIMER: This material has been produced using various openly available online resources to enhance its quality and comprehensiveness. In creating this document, we have attempted to acknowledge the original authors and primary contributors of the sourced materials. However, due to the extensive range of resources consulted, there may be instances where some contributors should be explicitly mentioned. Should there be any concerns or complaints regarding the attribution or content of this material, please do not hesitate to contact [email protected] for resolution and clarification.

</aside>

A containerized MQTT broker

<aside> 🗣️ based on http://www.steves-internet-guide.com/mosquitto-bridge-configuration/

</aside>

An MQTT broker can be executed as a Docker container. This fact provides flexibility when deploying these services, especially in edge devices.

In this demo, we will use

Starting an MQTT broker as a container

We will use Compose, a tool for defining and running possibly multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.

Using Compose is a two-step process:

  1. Define the services that make up your app in docker-compose.yml so they can be run together in an isolated environment. For more information, see the Compose file reference.

  2. Run docker compose up and the Docker compose command starts and runs your entire app.docker-compose has commands for managing the whole lifecycle of your application:

    you can check the manual here: https://docs.docker.com/compose/

The docker-compose.yml file below indicates how to start up an MQTT broker locally:

services:
  mosquitto:
    image: eclipse-mosquitto:latest
    container_name: mybroker
    ports:
      - "1883:1883"
    volumes:
      - ./mosquitto:/mosquitto
    networks:
      - pubsub-net

networks:
  pubsub-net:
    driver: bridge

In this case, we need a ./mosquitto/config/mosquitto.conf file as simple as this:

allow_anonymous true
listener 1883

Executing docker compose up we will get something like:

[+] up 6/6
 ✔ Image eclipse-mosquitto:latest Pulled                                                                                                7.9s
 ✔ Network broker_pubsub-net      Created                                                                                               0.0s
 ✔ Container mybroker             Created                                                                                               0.1s
Attaching to mybroker
mybroker  | 1770731315: Info: running mosquitto as user: mosquitto.
mybroker  | 1770731315: mosquitto version 2.1.2 starting
mybroker  | 1770731315: Config loaded from /mosquitto/config/mosquitto.conf.
mybroker  | 1770731315: Bridge support available.
mybroker  | 1770731315: Persistence support available.
mybroker  | 1770731315: TLS support available.
mybroker  | 1770731315: TLS-PSK support available.
mybroker  | 1770731315: Websockets support available.
mybroker  | 1770731315: Opening ipv4 listen socket on port 1883.
mybroker  | 1770731315: Opening ipv6 listen socket on port 1883.
mybroker  | 1770731315: mosquitto version 2.1.2 running

MQTT clients