Eclipse Mosquitto — a lightweight open-source MQTT broker for IoT and pub/sub messaging (MQTT 3.1/3.1.1/5.0). Deployed as a host-networked Nomad service with a rendered config and a persistent volume for retained messages.
Save as values.hcl, edit, then run:
# The name of the Nomad job.
job_name = "mosquitto"
# The Nomad namespace to deploy into.
namespace = "default"
# The datacenters to deploy to.
datacenters = ["*"]
# The Eclipse Mosquitto container image. Pin a tag in production.
image = "eclipse-mosquitto:2"
# Host port for the MQTT listener (TCP).
port = 1883
# Allow clients to connect without credentials. Fine on a trusted network; set false and manage a password file for real use.
allow_anonymous = true
# Docker named volume for /mosquitto/data (retained messages / persistence DB). A prestart task chowns it to uid 1883 (the mosquitto user).
data_volume = "mosquitto_data"
# Placement constraints — pin to one node so the local volume stays put. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []
# The task resources.
resources = {
cpu = 200
memory = 128
}
| Name | Type | Default | Description |
|---|---|---|---|
| job_name | string | "mosquitto" | The name of the Nomad job. |
| namespace | string | "default" | The Nomad namespace to deploy into. |
| datacenters | list | ["*"] | The datacenters to deploy to. |
| image | string | "eclipse-mosquitto:2" | The Eclipse Mosquitto container image. Pin a tag in production. |
| port | number | 1883 | Host port for the MQTT listener (TCP). |
| allow_anonymous | bool | true | Allow clients to connect without credentials. Fine on a trusted network; set false and manage a password file for real use. |
| data_volume | string | "mosquitto_data" | Docker named volume for /mosquitto/data (retained messages / persistence DB). A prestart task chowns it to uid 1883 (the mosquitto user). |
| constraints | list | [] | Placement constraints — pin to one node so the local volume stays put. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true". |
| resources | object | {
cpu = 200
memory = 128
} | The task resources. |
No variables match.
Eclipse Mosquitto — a lightweight open-source MQTT broker for IoT and pub/sub messaging (MQTT 3.1 / 3.1.1 / 5.0). Host-networked Nomad service with a rendered config and a persistent volume for retained messages.
nomad-pack registry add nomploy github.com/Nomploy/nomad-packs
nomad-pack run mosquitto --registry nomploy
In nomploy: create a Compose service, type Nomad Pack, pack mosquitto, custom registry
github.com/Nomploy/nomad-packs, then Deploy. Broker at <node-ip>:1883.
| Variable | Default | Notes |
|---|---|---|
image |
eclipse-mosquitto:2 |
Pin a tag in production. |
port |
1883 |
MQTT listener (TCP). |
allow_anonymous |
true |
Open on a trusted network; set false + a password file for real use. |
data_volume |
mosquitto_data |
Persistence DB / retained messages. |
constraints |
[] |
Pin to a node so the local volume stays put. |
resources |
cpu 200 / mem 128 |
Lightweight. |
count is fixed to 1 (local volume). A prestart task chowns the volume to
uid 1883 (the mosquitto user). Pin with constraints.allow_anonymous = true lets anyone publish/subscribe — only for trusted
networks. For real use, disable it and mount a passwordfile (extend the rendered config).listener for WebSockets (9001) or
TLS by extending the config.