EMQX — a high-performance, scalable MQTT broker for IoT, with a web dashboard, MQTT over TCP/WebSocket, rules engine, and ACLs. Deployed as a single host-networked Nomad service with a persistent data volume. A feature-rich alternative to the mosquitto pack.
Save as values.hcl, edit, then run:
# The name of the Nomad job.
job_name = "emqx"
# The Nomad namespace to deploy into.
namespace = "default"
# The datacenters to deploy to.
datacenters = ["*"]
# The EMQX container image. Pin a tag in production.
image = "emqx/emqx:5"
# Host port for MQTT over TCP.
mqtt_port = 1883
# Host port for MQTT over WebSocket.
ws_port = 8083
# Host port for the EMQX dashboard and REST API.
dashboard_port = 18083
# Initial dashboard admin password (user "admin", EMQX_DASHBOARD__DEFAULT_PASSWORD). CHANGE THIS.
dashboard_password = "public"
# UID EMQX runs as. The data volume is chown'd to this at startup.
uid = 1000
# Named volume for EMQX data — retained messages, sessions, rules (/opt/emqx/data).
data_volume = "emqx_data"
# Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []
# The task resources.
resources = {
cpu = 1000
memory = 512
}
| Name | Type | Default | Description |
|---|---|---|---|
| job_name | string | "emqx" | The name of the Nomad job. |
| namespace | string | "default" | The Nomad namespace to deploy into. |
| datacenters | list | ["*"] | The datacenters to deploy to. |
| image | string | "emqx/emqx:5" | The EMQX container image. Pin a tag in production. |
| mqtt_port | number | 1883 | Host port for MQTT over TCP. |
| ws_port | number | 8083 | Host port for MQTT over WebSocket. |
| dashboard_port | number | 18083 | Host port for the EMQX dashboard and REST API. |
| dashboard_password key | string | "public" | Initial dashboard admin password (user "admin", EMQX_DASHBOARD__DEFAULT_PASSWORD). CHANGE THIS. |
| uid | number | 1000 | UID EMQX runs as. The data volume is chown'd to this at startup. |
| data_volume | string | "emqx_data" | Named volume for EMQX data — retained messages, sessions, rules (/opt/emqx/data). |
| constraints | list | [] | Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true". |
| resources | object | {
cpu = 1000
memory = 512
} | The task resources. |
No variables match.
EMQX — a high-performance, scalable MQTT broker for IoT, with a web dashboard, MQTT over TCP and WebSocket, a rules engine, and authentication/ACLs.
Single host-networked Nomad service. A busybox prestart task chowns the data volume to EMQX's UID (it runs as uid 1000). A feature-rich alternative to the mosquitto pack.
nomad-pack registry add nomploy https://github.com/Nomploy/nomad-packs
nomad-pack run emqx --registry=nomploy
| Variable | Default | Description |
|---|---|---|
mqtt_port |
1883 |
MQTT over TCP. |
ws_port |
8083 |
MQTT over WebSocket. |
dashboard_port |
18083 |
Dashboard + REST API. |
dashboard_password |
public |
Initial admin password. Change it. |
uid |
1000 |
User EMQX runs as; data volume is chown'd to it. |
data_volume |
emqx_data |
/opt/emqx/data — retained messages, sessions, rules. |
image |
emqx/emqx:5 |
Container image. Pin a tag in production. |
resources |
{ cpu = 1000, memory = 512 } |
Task resources. |
The node name is pinned to emqx@127.0.0.1 so data survives restarts (same idea as the rabbitmq
pack). Clients may connect anonymously by default — enable auth/ACLs from the dashboard for
anything internet-facing. Pin the job to the node holding the volume with constraints.