Eclipse Mosquitto

Eclipse Mosquitto

Open-source MQTT broker

Eclipse Mosquitto is an open-source MQTT broker implementing versions 5.0, 3.1.1, and 3.1 of the MQTT protocol. It is lightweight and suitable for devices from single board computers to full servers, providing publish/subscribe messaging capabilities with support for TLS, WebSockets, and various authentication methods.

🏠 Home: https://mosquitto.org/ 📦 Source: https://github.com/eclipse/mosquitto 📜 Docs: https://hub.docker.com/_/eclipse-mosquitto Configure Authentication: https://mosquitto.org/documentation/authentication-methods/

TODO: Consider enabling TLS/SSL certificates for secure connections on port 8883 TODO: Implement authentication with password file and ACL for access control TODO: Configure performance tuning for high-throughput environments (max_connections, max_queued_messages)

name: mosquitto
services:
  mosquitto:
    image: eclipse-mosquitto:2.0.22-openssl
    container_name: mosquitto
    restart: unless-stopped
    environment:
      TZ: ${TIMEZONE}
    ports:
      - "1883:1883"  # Standard MQTT
      - "8883:8883"  # MQTT over TLS
      - "9001:9001"  # WebSockets
    volumes:
      - ./mosquitto:/mosquitto/config
      - ${DOCKER_VOLUMES}/mosquitto/data:/mosquitto/data
      - ${DOCKER_VOLUMES}/mosquitto/log:/mosquitto/log
    networks:
      - proxy
    labels:
      traefik.enable: true
      traefik.http.routers.mosquitto.rule: Host(`mosquitto.${MYDOMAIN}`)
      traefik.http.routers.mosquitto.middlewares: localaccess@file
      traefik.http.services.mosquitto.loadbalancer.server.port: 9001
      homepage.group: Automation
      homepage.name: Eclipse Mosquitto
      homepage.icon: mosquitto.png
      homepage.href: https://mosquitto.${MYDOMAIN}/
      homepage.description: "Open-source MQTT broker"

networks:
  proxy:
    external: true