Skip to content
Stand with Ukraine flag

Minikube

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

  • TBMQ × 2
  • Integration Executor
  • PostgreSQL
  • Kafka
  • Valkey

Node ports on the Minikube IP

  • 30001 HTTP TBMQ UI and REST API
  • 30002 MQTT MQTT clients
  • 30003 MQTTS MQTT clients that connect over TLS, once you enable the TBMQ SSL listener (LISTENER_SSL_ENABLED)
  • 30004 MQTT over WebSockets MQTT clients that connect over WebSockets
  • Minikube and kubectl installed, and a running Minikube cluster:

    Terminal window
    minikube start
  • Git installed.

Terminal window
git clone -b release-2.4.2 https://github.com/thingsboard/tbmq.git
cd tbmq/k8s/minikube

Run every command in this guide from this tbmq/k8s/minikube directory.

Run the installation script:

Terminal window
./k8s-install-tbmq.sh

The script creates the thingsboard-mqtt-broker namespace, starts PostgreSQL, Kafka, and Valkey, and installs the database. The output includes Installation finished successfully!.

  1. Deploy TBMQ.

    Terminal window
    ./k8s-deploy-tbmq.sh

    The 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.

  2. Open the UI.

    Get the Minikube IP:

    Terminal window
    minikube ip

    Open 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.

  3. Sign in as System Administrator.

    Use the default System Administrator credentials:

    Username
    sysadmin@thingsboard.org
    Password
    sysadmin
  4. Change 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-….

View TBMQ node logs
kubectl logs -f tbmq-0
View the state of the pods, services, deployments, and statefulsets
kubectl get pods
kubectl get services
kubectl get deployments
kubectl get statefulsets

See the kubectl Quick Reference for more details.

Delete the TBMQ nodes and the Integration Executor
./k8s-delete-tbmq.sh

PostgreSQL, Kafka, and Valkey keep running, and the data stays. ./k8s-deploy-tbmq.sh brings the TBMQ nodes and the Integration Executor back.

Delete all resources, including the databases (deletes all data)
./k8s-delete-all.sh
  1. Check the version-specific notes below for any preparation your target version requires.
  2. Back up your database (optional but recommended).
  3. Run the upgrade commands.

For 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.

This is a standard upgrade from v2.4.0.

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.

This is a standard upgrade from v2.3.0.

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.

This release migrates all third-party components from Bitnami images to official open-source alternatives.

Review the third-party component updates for full details.

Then proceed with the upgrade.

This release migrates MQTT authentication from YAML/env configuration into the database.

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 false

Once the file is verified, proceed with the upgrade.

This release adds the Integration Executor microservice and updates third-party service versions.

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.

  1. Switch to the new release branch.

    Terminal window
    git fetch origin release-2.4.2
    git checkout -m release-2.4.2

    git 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).

  2. Run the upgrade.

    Terminal window
    ./k8s-upgrade-tbmq.sh
    ./k8s-deploy-tbmq.sh

    k8s-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.

Connect your first client

Set up client credentials, then publish and subscribe with an MQTT client. See Getting started.

Secure the broker

Choose the authentication provider that fits your clients. See Security overview.

Watch the broker

Track sessions, throughput, and resource usage as traffic grows. See Monitoring.