Connect your first client
Set up client credentials, then publish and subscribe with an MQTT client. See Getting started.
This guide covers setting up TBMQ in cluster mode using Minikube.
The scripts deploy two TBMQ nodes, an Integration Executor, PostgreSQL, Kafka, and Valkey into the
thingsboard-mqtt-broker namespace. The TBMQ service is exposed on these node ports of the Minikube IP:
Minikube cluster
Node ports on the Minikube IP
LISTENER_SSL_ENABLED)
Minikube and kubectl installed, and a running Minikube cluster:
minikube startGit installed.
git clone -b release-2.4.2 https://github.com/thingsboard/tbmq.gitcd tbmq/k8s/minikubeRun every command in this guide from this tbmq/k8s/minikube directory.
Run the installation script:
./k8s-install-tbmq.shThe script creates the thingsboard-mqtt-broker namespace, starts PostgreSQL, Kafka, and Valkey, and installs the
database. The output includes Installation finished successfully!.
Deploy TBMQ.
./k8s-deploy-tbmq.shThe TBMQ nodes start one after another, so the deployment can take a few minutes. All pods are ready when every row
of kubectl get pods shows 1/1 in the READY column.
Open the UI.
Get the Minikube IP:
minikube ipOpen http://{minikube-ip}:30001 in your browser (e.g., http://192.168.49.2:30001). You should see the TBMQ
login page. MQTT clients connect to the same IP on port 30002.
Sign in as System Administrator.
Use the default System Administrator credentials:
sysadmin@thingsboard.orgsysadminChange the default password.
On first login, you are prompted to change the default password and re-login with the new credentials.
The scripts create these pods: tbmq-0 and tbmq-1 (TBMQ nodes), tbmq-integration-executor-0, postgres-…,
tbmq-kafka-0, and tbmq-valkey-….
kubectl logs -f tbmq-0kubectl get podskubectl get serviceskubectl get deploymentskubectl get statefulsetsSee the kubectl Quick Reference for more details.
./k8s-delete-tbmq.shPostgreSQL, Kafka, and Valkey keep running, and the data stays. ./k8s-deploy-tbmq.sh brings the TBMQ nodes and the
Integration Executor back.
./k8s-delete-all.shFor full version history and supported upgrade paths, see the upgrade instructions page. If the documentation does not cover your specific upgrade path, contact us for guidance.
What each upgrade needs before you run the upgrade — select a version for its full notes:
| Upgrade to | Before running the upgrade |
|---|---|
| 2.4.2 | Nothing. Check SCRAM-only authentication and Kafka integrations |
| 2.4.1 | Nothing. If you set MQTT_TOPIC_MAX_SEGMENTS_COUNT, raise it by 1 |
| 2.4.0 | Nothing. If you scrape metrics, update queries for the renamed Prometheus metrics |
| 2.3.0 | Delete the TBMQ pods first. Plan the third-party component migration |
| 2.2.0 | Delete the TBMQ pods first. Check the authentication settings in database-setup.yml |
| 2.1.0 | Delete the TBMQ pods first. Upgrade the third-party services |
Backing up your PostgreSQL database before upgrading is highly recommended but optional. For guidance, follow the backup and restore instructions.
This is a standard upgrade from v2.4.1. No third-party component changes are required, and the upgrade only records the new schema version — no table is created or altered and no data is migrated.
Then proceed with the upgrade.
No third-party component changes are required, and the upgrade only records the new schema version — no table is created or altered and no data is migrated.
Then proceed with the upgrade.
No third-party component changes are required, and the upgrade only records the new schema version — no table is created or altered and no data is migrated.
Then proceed with the upgrade.
Review the third-party component updates for full details.
Then proceed with the upgrade.
The upgrade script reads from database-setup.yml. Variables from tb-broker.yml are
not applied during the upgrade — only the values in
database-setup.yml are used. Ensure this file reflects your active configuration.
Supported variables in database-setup.yml
SECURITY_MQTT_BASIC_ENABLED (true|false)SECURITY_MQTT_SSL_ENABLED (true|false)SECURITY_MQTT_SSL_SKIP_VALIDITY_CHECK_FOR_CLIENT_CERT (true|false) — usually falseOnce the file is verified, proceed with the upgrade.
Add Integration Executor microservice
This release adds support for external integrations via the new Integration Executor microservice.
Pull the updates from the release branch by following the Run upgrade steps up to (but not including) the upgrade script. The new config files will be included automatically.
Update third-party services
This release updates third-party dependency versions (pull request):
| Service | Previous version | Updated version |
|---|---|---|
| Redis | 7.0 | 7.2.5 |
| PostgreSQL | 15.x | 16.x |
| Kafka | 3.5.1 | 3.7.0 |
After addressing third-party service versions, proceed with the upgrade.
Switch to the new release branch.
git fetch origin release-2.4.2git checkout -m release-2.4.2git checkout -m switches to the release branch and keeps your own edits to files such as tbmq.yml and
tbmq-configmap.yml. Make sure the TBMQ images in tbmq.yml, tbmq-ie.yml, and database-setup.yml use the
target version (e.g., 2.4.2).
Run the upgrade.
./k8s-upgrade-tbmq.sh./k8s-deploy-tbmq.shk8s-upgrade-tbmq.sh upgrades the database but does not touch the TBMQ pods — they keep running the previous image
until k8s-deploy-tbmq.sh applies the updated manifests. Kubernetes then replaces the TBMQ pods one at a time, each
after the previous one is ready.
Set up client credentials, then publish and subscribe with an MQTT client. See Getting started.
Choose the authentication provider that fits your clients. See Security overview.
Change broker settings through environment variables in tbmq.yml.
See How to change configuration.
Track sessions, throughput, and resource usage as traffic grows. See Monitoring.
Was this helpful?