Home
Softono

Mosquitto Docker Compose

Open source MIT Makefile
149
Stars
98
Forks
1
Issues
3
Watchers
11 months
Last Commit

 About Mosquitto Docker Compose

A simple Mosquitto Docker Compose template

Platforms

Web Self-hosted Docker

Languages

Makefile

Links

Need Help Installing Mosquitto Docker Compose?

We provide expert installation service for this software. Our team will install, configure, and secure Mosquitto Docker Compose on your server. plans start at just $30.

Mosquitto Docker Compose

View on GitHub

Simple Mosquitto broker

Mosquitto Logo

This is a simple Mosquitto broker to quickly initialize projects requiring an MQTT broker.

Prerequisite

How to use

At first startup, you need to setup the project:

make setup-project

Then, and for other startup, you just have to run:

make up

Find other make helper command in the Makefile

The Mosquitto broker is now available on localhost. You can test it easily (require Mosquitto client):

| In one shell:

mosquitto_sub -h localhost -t "sensor/temperature"

| In a second shell:

mosquitto_pub -h localhost -t sensor/temperature -m 23

Configuration

The config file is in the file mosquito.conf

By default we activated the log and data persistance (logs are in the log folder, and data are stored in a docker volume).

Authentication

Enable authentication

In the config file, set the value allow_anonymous to false, then uncomment the last line (password_file) and finaly restart the container.

The default user is admin/password.

Change user password / create a new user

docker compose exec mosquitto mosquitto_passwd -b /mosquitto/config/password.txt user password
make restart

Delete user

docker compose exec mosquitto mosquitto_passwd -D /mosquitto/config/password.txt user
make restart