Run the broker in your own cloud (BYOC)
With Bring Your Own Cloud (BYOC) you run a ConnectMQ MQTT broker node inside your own cloud account (AWS, Azure, Google Cloud or any container host), while ConnectMQ keeps managing authentication, access control, quotas and usage reporting. Your message traffic stays on infrastructure you control.
How BYOC works
Your devices / apps Your cloud account ConnectMQ
sensors, PLCs, MQTT / TLS ┌──────────────────────────┐ HTTPS ┌──────────────────┐
back ends, browsers ───────────► │ connectmqcom/broker │ ────────► │ Central API │
◄─────────── │ (container) │ ◄──────── │ auth, ACL, │
└──────────────────────────┘ │ quotas, billing │
messages never leave here └──────────────────┘- On start-up the broker logs in to
https://brokerapi.connectmq.comwith its Broker ID and Broker Secret Key. - When a client connects, the broker asks the Central API to check the username and password and to return the organization's ACLs and quotas.
- Publishes and subscriptions are handled locally. Payloads are not sent to ConnectMQ; only control-plane calls (broker login, client authentication, heartbeats, usage reports) are.
Your users, credentials, ACL policies and plan stay in the ConnectMQ console exactly as on the managed service.
Features
- MQTT 3.1.1 and 5.0 over TCP, TLS, WebSocket and secure WebSocket.
- MQTT 5 shared subscriptions, isolated per tenant.
- Per-tenant topic isolation, quotas, rate limiting, flood protection and IP blacklisting.
- Sparkplug B and ISA-95 / Unified Namespace detection, with automatic Sparkplug B to ISA-95 conversion.
- Multi-arch image:
linux/amd64andlinux/arm64(AWS Graviton, Azure Ampere, Google Axion/Tau T2A). - Runs as a non-root user (UID 1654).
Image: connectmqcom/broker on Docker Hub, also ghcr.io/connectmq/broker. Source of these instructions: connectmq/connectmq-broker-docker.
Before you start
| You need | Where to get it |
|---|---|
| Broker ID | Your ConnectMQ BYOC subscription, or ConnectMQ support |
| Broker Secret Key | Issued together with the Broker ID. Keep it in a secret store. |
Outbound HTTPS (443) to brokerapi.connectmq.com | Allow it in your firewall, NAT and egress rules |
| Inbound ports for MQTT clients | See Ports |
| (optional) a DNS name and TLS certificate | For example mqtt.example.com, from Let's Encrypt, ACM, Key Vault or Certificate Manager |
BYOC is arranged per customer: contact sales for a Broker ID and pricing.
One container per Broker ID
A broker node keeps sessions, retained messages and subscriptions in memory. Run exactly one container per Broker ID, and request another Broker ID for each additional node. Configure deployments so the old container stops before the new one starts.
Ports
| Container port | Protocol | Notes |
|---|---|---|
1883 | MQTT over TCP | Plain text. Expose only on private networks or behind a TLS-terminating load balancer. |
8883 | MQTT over TLS | Active only when a certificate is mounted. |
8083 | MQTT over WebSocket | Path /mqtt (or /). |
8084 | MQTT over secure WebSocket | Active only when a certificate is mounted. |
Serve TLS in the container (mount a certificate) or at a layer-4 load balancer (forward 8883 → 1883 and 8084 → 8083). The load-balancer option lets your cloud renew certificates automatically.
Keep the client's source IP
Use layer-4 (TCP/TLS) load balancers that preserve the client IP. Quotas, flood protection and IP bans work on the client's IP: if every client arrives with the load balancer's IP, one misbehaving client can get everyone banned. HTTP/L7 load balancers (ALB, Application Gateway, Cloud Run, HTTP(S) LB) do not carry raw MQTT and are not supported.
Environment variables
| Variable | Default | Description |
|---|---|---|
BROKER_ID | required | Broker ID issued by ConnectMQ |
BROKER_SECRET_KEY | required | Broker secret issued by ConnectMQ |
CENTRAL_API_URL | https://brokerapi.connectmq.com | Change only if ConnectMQ tells you to |
PUBLIC_BROKER_ENABLED | true | Allows anonymous clients under the public quota. Set false for BYOC. |
MQTT_PORT / MQTTS_PORT | 1883 / 8883 | TCP and TLS ports inside the container |
MQTT_WS_PORT / MQTT_WSS_PORT | 8083 / 8084 | WebSocket and secure WebSocket ports |
SSL_CERTIFICATE_PATH | /app/certs/broker.pem | PEM (certificate chain + private key) or PFX |
SSL_CERTIFICATE_PASSWORD | (empty) | Password for a PFX file |
Volumes
| Path | Contents |
|---|---|
/app/logs | Hourly rolling logs per scope (broker, public, each tenant), kept 14 days, plus the persistent IP blacklist. Optional; logs also go to stdout. |
/app/certs | Your TLS certificate (mount read-only). |
/app/broker.json | (optional) Full configuration override: quotas, overload protection, flood protection, payload logging. |
Sizing
| Workload | vCPU | Memory |
|---|---|---|
| Up to ~1,000 connections, low traffic | 0.5 | 1 GB |
| Up to ~10,000 connections | 2 | 4 GB |
| Larger | 4+ | 8 GB+ (contact ConnectMQ) |