HiveMQ CE
Overview
HiveMQ Community Edition is an open-source, production-grade, single-node MQTT broker. It implements the full MQTT 3.1, 3.1.1 and 5.0 specifications. It provides reliable publish and subscribe messaging with quality-of-service delivery guarantees. This makes it a common backbone for IoT telemetry, device command and control, and event-driven communication between applications and services.
This SecureAnyCloud image installs HiveMQ Community Edition 2026.5 from the official release. It runs under systemd as an unprivileged hivemq user on the Java 21 runtime and answers MQTT on port 1883 on all interfaces.
The broker is headless. It has no web interface, because the HiveMQ Control Center is part of the commercial Enterprise edition. You operate it with any standard MQTT client, such as mosquitto_pub and mosquitto_sub, which ship in the image.
Secure by default: authentication required, no default credentials. HiveMQ Community Edition by itself ships with no authentication, so an out-of-the-box broker accepts anonymous connections. This image closes that gap. It bundles the official HiveMQ File RBAC Authentication Extension. On the very first boot of every VM, it generates a unique MQTT admin password and stores it as a salted PBKDF2 hash in the extension's credentials file. It records the login in /root/hivemq-credentials.txt (mode 0600, root only). As a result, the broker rejects anonymous connections and connections with wrong credentials, and no two instances share a credential.
What you get:
- HiveMQ Community Edition 2026.5 from the official release, run under systemd as the unprivileged
hivemquser (hivemq.service) on OpenJDK 21 - An MQTT endpoint on
0.0.0.0:1883that supports MQTT 3.1, 3.1.1 and 5.0 clients - The HiveMQ File RBAC Authentication Extension, configured with
password-typeHASHED so that passwords are stored as salted PBKDF2 hashes, never in plain text - A single admin MQTT user,
cimgadmin, with a per-instance password generated on first boot and documented in/root/hivemq-credentials.txt(0600) mosquitto-clients(mosquitto_pub/mosquitto_sub) preinstalled, so you can publish and subscribe from the broker VM immediately
Prerequisites
- An active Azure subscription, an SSH public key, and a VNet and subnet in the target region
- A subscription to the HiveMQ Community Edition listing on Azure Marketplace
- Network Security Group rules that allow TCP 22 (admin) and TCP 1883 (MQTT) from the client networks and devices that connect to the broker
Recommended virtual machine size: Standard_B2s (2 vCPU, 4 GB RAM) is ample for development and small production workloads. The broker runs with a 1500 MB JVM heap on this size. Scale to a larger size for high connection counts or message throughput.
Deploy from the Azure Portal
Search the Azure Marketplace for HiveMQ Community Edition, select the SecureAnyCloud publisher, and select Create.
Configure the Network Security Group to allow TCP 1883 (MQTT) from the device and application networks that connect, and TCP 22 for administration. Restrict 1883 to your own client subnets rather than the whole internet.
Deploy from the Azure CLI
RG="mqtt-prod"; LOCATION="eastus"; VM_NAME="hivemq1" IMAGE_URN="sac1647283583153:hivemq-ce-ubuntu-24-04:default:latest" SSH_KEY="$(cat ~/.ssh/id_rsa.pub)" az group create --name "$RG" --location "$LOCATION"
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:hivemq-ce-ubuntu-24-04:default:latest
az vm create \
--resource-group "$RG" --name "$VM_NAME" \
--image "$IMAGE_URN" \
--size Standard_B2s \
--admin-username azureuser \
--ssh-key-values "$SSH_KEY" \
--public-ip-sku Standard
az vm open-port --resource-group "$RG" --name "$VM_NAME" --port 1883 --priority 1001
az vm open-port --resource-group "$RG" --name "$VM_NAME" --port 22 --priority 1002First boot
On first boot, the image generates a unique MQTT admin password and hashes it with the File RBAC extension. It then renders the extension credentials file and starts hivemq. This completes within a minute or two while the JVM warms up.
SSH in as azureuser and read the details:
sudo cat /root/hivemq-credentials.txtThe file records the admin username (cimgadmin), the generated password and the MQTT URI for this VM. Store the password somewhere safe. It is unique to this instance and is the only credential that can connect to the broker.
Confirm the service is running
Confirm that hivemq.service is active, that the runtime is OpenJDK 21, and that ss shows the broker listening on :1883 on all interfaces.
systemctl is-active hivemq.service java -version ss -tlnp | grep ':1883 'Publish and subscribe with the per-instance credential
Read the admin password from the credentials file into a shell variable. Publish a retained message, then subscribe to receive it.
Both the publish and the subscribe present the cimgadmin username and the per-instance password. The broker delivers the message end to end.
PW=$(sudo grep '^HIVEMQ_ADMIN_PASSWORD=' /root/hivemq-credentials.txt | cut -d= -f2-) mosquitto_pub -h 127.0.0.1 -p 1883 -u cimgadmin -P "$PW" -t demo/hello -m 'hello from sac' -q 1 -r mosquitto_sub -h 127.0.0.1 -p 1883 -u cimgadmin -P "$PW" -t 'demo/#' -v -C 1 -W 8The subscriber prints demo/hello hello from SecureAnyCloud and exits. This confirms an authenticated publish and subscribe round trip.
Confirm anonymous and wrong credentials are rejected
The File RBAC extension enforces authentication. The broker refuses a connection with no credentials or with a wrong password. Each command below therefore exits with a non-zero status and prints the confirmation.
The screenshot shows the exact client messages: Connection Refused: bad user name or password for anonymous, and Connection Refused: not authorised for a wrong password.
mosquitto_pub -h 127.0.0.1 -p 1883 -t demo/x -m nope 2>/dev/null && echo 'UNEXPECTED: anonymous accepted' || echo 'anonymous connect refused by the broker (expected)' mosquitto_pub -h 127.0.0.1 -p 1883 -u cimgadmin -P wrong-password -t demo/x -m nope 2>/dev/null && echo 'UNEXPECTED: wrong password accepted' || echo 'wrong password refused by the broker (expected)'Review the secure-by-default configuration
No default or shared credentials ship in the image. The credentials file is 0600 root:root, and the admin password is unique to this VM. The File RBAC extension stores the password as a salted PBKDF2 hash (password-type HASHED), never in plain text.
sudo stat -c '%n %a %U:%G' /root/hivemq-credentials.txt
sudo grep -E '<password-type>' /opt/hivemq/current/extensions/hivemq-file-rbac-extension/conf/config.xml
sudo grep -c '<password>' /opt/hivemq/current/extensions/hivemq-file-rbac-extension/conf/credentials.xmlAdd your own MQTT users and topic permissions
You manage users and their topic permissions in the File RBAC credentials file, /opt/hivemq/current/extensions/hivemq-file-rbac-extension/conf/credentials.xml.
Passwords are stored as salted PBKDF2 hashes. Generate a hash for a new user's password with the extension's own generator. The -q flag prints only the hash string. In this example, replace <new-password> with a real password you choose.
sudo java -jar /opt/hivemq/current/extensions/hivemq-file-rbac-extension/hivemq-file-rbac-extension-4.6.15.jar -p '<new-password>' -qAdd a <user> entry (referencing a <role> you define) to the <users> section of credentials.xml. Paste the hash above into <password>.
The role's <permission> blocks scope which topics the user may publish or subscribe to. The following role grants publish and subscribe only under a per-device prefix:
<user> <name>device01</name> <password>PASTE_THE_HASH_HERE</password> <roles> <id>device</id> </roles> </user> <!-- add this role under the <roles> section --> <role> <id>device</id> <permissions> <permission> <topic>devices/device01/#</topic> <activity>ALL</activity> </permission> </permissions> </role>The File RBAC extension reloads credentials.xml automatically within 60 seconds, so changes take effect without restarting the broker.
For production, create a narrowly scoped role per device or application rather than reusing the superuser admin.
Connect an application or IoT device
Any standard MQTT client can connect using the broker IP, port 1883, and the username and password from the credentials file. The values below map directly onto /root/hivemq-credentials.txt.
This example uses the Eclipse Paho Python client. The same host, port, username and password apply to any MQTT 3.1.1 or 5.0 library.
import paho.mqtt.client as mqtt client = mqtt.Client(protocol=mqtt.MQTTv5) client.username_pw_set("cimgadmin", "the-password-from-the-credentials-file") client.connect("<hivemq-vm-ip>", 1883) client.publish("telemetry/sensor1", payload="23.4", qos=1) client.loop_forever()For production, create a dedicated per-application MQTT user (Step 8) rather than reusing the admin account.
Enable TLS on port 8883 (optional hardening)
By default, the image serves plain MQTT on port 1883, which is appropriate inside a trusted VNet.
To carry credentials and payloads over the public internet, add an encrypted tls-tcp-listener on the standard MQTTS port 8883 in /opt/hivemq/current/conf/config.xml. Reference a Java keystore that contains a certificate for your server's hostname. Restart the broker after you edit the config, and open TCP 8883 in the NSG.
Keeping TLS optional lets you run plain MQTT for local development and add MQTTS for exposed deployments.
Security recommendations
- Restrict the NSG. Allow TCP 1883 only from the device and application subnets that connect to the broker, and TCP 22 for administration only. Do not expose the MQTT port to the public internet without TLS.
- Use TLS for untrusted networks. Add an 8883
tls-tcp-listener(Step 10) for any traffic that leaves a trusted VNet, so that credentials and payloads are encrypted in transit. - Use scoped per-client users. Create a narrowly scoped File RBAC role and user per device or application (Step 8) rather than reusing the
superuseradmin. A compromised client then cannot read or write every topic. - Protect the credentials.
/root/hivemq-credentials.txtis0600 root:root, andcredentials.xmlstores only salted PBKDF2 hashes. Keep both root-owned. Back up yourcredentials.xml, which is the source of truth for who may connect. - Keep the OS patched. Unattended security upgrades remain enabled on the running VM.
Support and Licensing
HiveMQ Community Edition is an open-source project distributed under the Apache License 2.0. This SecureAnyCloud image bundles the unmodified official HiveMQ Community Edition release and the official HiveMQ File RBAC Authentication Extension.
SecureAnyCloud provides the packaging, the systemd hardening, the secure-by-default File RBAC configuration, the per-instance credential automation, the paired deploy guide, and 24/7 support with a guaranteed 24-hour response SLA.
SecureAnyCloud is not affiliated with or endorsed by HiveMQ GmbH. HiveMQ is a mark of its respective owner and is used here only to identify the software.
Deploy on Azure
Find HiveMQ Community Edition on Ubuntu 24.04 LTS on the Azure Marketplace, published by SecureAnyCloud. Deploy from the Portal or the Azure CLI as shown above.
Need Help?
Email sales@secureanycloud.com for deployment help, configuration questions or licensing enquiries.
Deploy on Azure
Launch HiveMQ Community Edition 2026.5 on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
HiveMQ Community Edition is an open-source MQTT broker built for the messaging patterns that Internet of Things and machine-to-machine systems depend on. It implements MQTT 3.1, 3.1.1 and 5.0 in full. That includes quality-of-service levels, retained messages, last will and testament, persistent sessions and shared subscriptions.
Upstream HiveMQ CE ships with no authentication at all, so it is an open broker that accepts anonymous clients. This image does not. It preinstalls the vendor's own File RBAC access control extension in hashed password mode and ships with no user file. It also wires the broker service so that it cannot start until first boot has generated a unique credential for your instance.
This is a headless product. The HiveMQ Control Center is an Enterprise edition feature, so there is no web interface. You administer the broker over SSH and its configuration files, and clients talk MQTT.
What you get:
- HiveMQ Community Edition 2026.5 from the official GitHub release (Apache License 2.0), sha256 verified at build time
- The OpenJDK 21 headless runtime. The broker runs as the unprivileged
hivemqsystem user under systemd - The MQTT listener on
0.0.0.0:1883 - The official HiveMQ File RBAC Auth Extension 4.6.15, sha256 verified, configured
password-type HASHED hivemq-firstboot.service, which generates a 24-character password for thecimgadminaccount, hashes it with PBKDF2 using the extension's own generator, and writes/root/hivemq-credentials.txt(mode 0600 root:root)mosquitto-clients, so you can publish and subscribe from the instance itself- 24/7 SecureAnyCloud support
Prerequisites
- An AWS account, an EC2 key pair and a VPC subnet
- A security group that allows inbound TCP 22 (SSH) and 1883 (MQTT) from your trusted CIDR
m5.large is a comfortable default. The broker is a JVM service sized for roughly one and a half gigabytes of heap.
Connecting to your instance
SSH in as the default login user for the operating system variant you launched. This listing currently ships one variant: Ubuntu 24.04 LTS, with the SSH login user ubuntu.
ssh ubuntu@<public-ip>Launch from AWS Marketplace
Subscribe to the SecureAnyCloud HiveMQ Community Edition listing and launch an instance. Pick m5.large and choose your VPC and subnet. Attach a security group that allows inbound TCP 22 and 1883 from your trusted CIDR.
SSH In
ssh ubuntu@<public-ip>Service Status and Listener
Confirm that the broker is running and that the MQTT listener is bound.
sudo systemctl is-active hivemqactivesudo ss -tlnp | grep 1883 | awk '{print $1, $4}'LISTEN 0.0.0.0:1883Confirm the Access Control Extension
The extension is what makes this broker closed rather than open. Confirm that it is installed and set to accept only hashed passwords.
ls /opt/hivemq/current/extensions/hivemq-file-rbac-extension/LICENSE conf hivemq-extension.xml hivemq-file-rbac-extension-4.6.15.jarsudo cat /opt/hivemq/current/extensions/hivemq-file-rbac-extension/conf/config.xmlRead Per-Instance Credentials
First boot generated this instance's broker password. Read the credentials file:
sudo cat /root/hivemq-credentials.txtNote HIVEMQ_ADMIN_USER (cimgadmin) and HIVEMQ_ADMIN_PASSWORD. These values are unique to this instance. Only the PBKDF2 hash is stored on disk, in the extension's user file.
Publish and Subscribe
Read the password into a shell variable rather than typing it, so that it never lands in your shell history. Then publish a retained message and read it back.
PW=$(sudo grep -m1 '^HIVEMQ_ADMIN_PASSWORD=' /root/hivemq-credentials.txt | cut -d= -f2-) mosquitto_pub -h 127.0.0.1 -p 1883 -u cimgadmin -P "$PW" -t sac/demo -m 'hello from sac' -q 1 -r mosquitto_sub -h 127.0.0.1 -p 1883 -u cimgadmin -P "$PW" -t sac/demo -C 1 -W 8 -q 1hello from sacThe -r flag retained the message on the broker. The subscriber therefore receives it immediately on connect rather than waiting for the next publish.
Confirm the Broker Is Closed By Default
This is the check worth doing yourself. The broker must refuse both an anonymous connection and a connection with a wrong password.
Each check is written as an assertion. It succeeds when the connection is refused, and it fails loudly if the broker ever accepts the connection.
if mosquitto_pub -h 127.0.0.1 -p 1883 -t sac/demo -m anon 2>/dev/null; then echo "UNEXPECTED: anonymous connect was ACCEPTED - the broker is open"; exit 1 else echo "anonymous connect refused (exit $?) - correct" fianonymous connect refused (exit 4) - correctif mosquitto_pub -h 127.0.0.1 -p 1883 -u cimgadmin -P wrong-pw -t sac/demo -m bad 2>/dev/null; then echo "UNEXPECTED: wrong password was ACCEPTED"; exit 1 else echo "wrong password refused (exit $?) - correct" fiwrong password refused (exit 5) - correctRun either command without the if wrapper to see the broker's own refusal on stderr. Those messages correspond to the exit codes:
Connection error: Connection Refused: bad user name or password.
# anonymous, exit 4 Connection error: Connection Refused: not authorised.
# wrong password, exit 5If either assertion ever reports UNEXPECTED, the access control extension is not loading. Check journalctl -u hivemq.
Connect Your Own Clients
From outside the instance, point your MQTT clients at <public-ip>:1883 with username cimgadmin and the generated password. Any MQTT 3.1, 3.1.1 or 5.0 client works: mosquitto_pub/mosquitto_sub, Eclipse Paho in Python, Java or JavaScript, or the MQTT client built into most IoT SDKs.
The broker supports quality of service 1 and 2 for at-least-once and exactly-once delivery. Retained messages give new subscribers the current value immediately. Last will and testament lets you detect ungraceful client disconnects.
Add More Users
The extension reads a user file that first boot created with a single account. To add more users, generate a hash with the extension's own generator and add an entry. Then reload.
sudo java -jar /opt/hivemq/current/extensions/hivemq-file-rbac-extension/hivemq-file-rbac-extension-4.6.15.jar -p '<password>' -qAdd the printed hash as a new <user> block in the extension's conf/credentials.xml. The extension re-reads that file on its own reload interval, so no restart is needed.
Give each application its own account rather than sharing cimgadmin.
Production Hardening Checklist
Before exposing the broker beyond a trusted network:
- Add a TLS listener. Port 1883 is plaintext. MQTT credentials are sent in the CONNECT packet, so they are exposed on an untrusted network. Add a
tls-tcp-listeneron 8883 in/opt/hivemq/current/conf/config.xmlwith your certificate and key, then close 1883 in the security group. - Restrict the security group. Limit 22 and 1883 (or 8883) to your device and administrator CIDRs rather than the world.
- One account per application. Add per-client users as in Step 9 and retire the shared
cimgadminaccount for production traffic. - Watch the logs.
journalctl -u hivemqand/opt/hivemq/current/log/show connection, authentication and extension activity. - Back up the configuration.
/opt/hivemq/current/conf/and the extension'sconf/hold the listener configuration and the user file. Snapshot the volume or copy them on a schedule. - Keep it patched. Unattended upgrades is enabled for OS packages. Review the HiveMQ release notes before replacing the broker under
/opt/hivemq.
Architecture
- Broker: hivemq.service runs bin/run.sh as the unprivileged hivemq user, on OpenJDK 21 headless
- Install root: /opt/hivemq/current, a symlink to the pinned hivemq-ce-2026.5 distribution
- Broker config: /opt/hivemq/current/conf/config.xml, the vendor MQTT sample with one tcp-listener on 0.0.0.0:1883
- Access control extension: /opt/hivemq/current/extensions/hivemq-file-rbac-extension/, the official File RBAC extension 4.6.15
- Extension config: .../conf/config.xml, with password-type HASHED. Failed authentication is refused, not passed through
- User file: .../conf/credentials.xml, written per instance at first boot and absent from the image
- Customer credentials: /root/hivemq-credentials.txt, mode 0600 root:root, with the broker address, user and password
- First-boot script: /usr/local/sbin/hivemq-firstboot.sh generates and hashes the per-instance password
- First-boot sentinel: /var/lib/sac/data/hivemq-firstboot.done is created when first boot completes
The broker unit carries ConditionPathExists on the user file. If that file is ever missing, the broker does not start rather than starting open.
Support
SecureAnyCloud provides 24/7 support for this image. Open a ticket at https://secureanycloud.com/support/ with your instance ID and a brief description of the issue. Common requests include adding a TLS listener, access control and per-client users, topic design, client connectivity across MQTT versions, and sizing for connection counts.
Deploy on AWS
Launch HiveMQ Community Edition with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com