Skip to content

polizogo67/MQTT-Broker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MQTT Broker

Docker Compose

version: '3.5'

services:

    emos:
        container_name: emos
        image: eclipse-mosquitto
        restart: always
        logging:
            options:
                max-size: 10m
        ports:
            - 1883:1883
            - 1884:1884
        volumes:
            - ./configs:/mosquitto/config
docker compose up -d

Configuration File

The broker configurations are on mosquitto.conf

allow_anonymous true

listener 1883
protocol mqtt

listener 1884
protocol websockets

Add User Authentication

To add authentication first create a text file like this

user1:passw1
user2:passw2
...

Then encrypt the passwords in the file run

docker run -v $PWD:/workspace eclipse-mosquitto mosquitto_passwd -U /workspace/configs/users

The modify the condiguration file like below

allow_anonymous false
password_file /mosquitto/config/users

About

MQTT Broker Dockerized

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published