Run your build
The Docker install runs the thingsboard/tbmq images, so after a local image build it runs your build.
See Docker (Linux, macOS).
This guide covers downloading and building TBMQ from source. Instructions are tested on Ubuntu 22.04 LTS and 24.04 LTS.
The build produces installation packages for Linux and Windows and, optionally, local Docker images. The first build downloads all dependencies and can take 15 minutes or more; later builds reuse them.
Required tools
Build outputs
This section describes the build tools required to compile TBMQ from source.
TBMQ is built using Java 25. Install OpenJDK 25:
sudo apt updatesudo apt install openjdk-25-jdk-headlessConfigure your operating system to use OpenJDK 25 by default. Set the default version with the following command:
sudo update-alternatives --config javaVerify the installation:
java -versionopenjdk version "25.0.xx"OpenJDK Runtime Environment (...)OpenJDK 64-Bit Server VM (build ...)TBMQ requires Maven 3.6.3 or later:
sudo apt install mavenInstalling Maven also installs your distribution’s default Java runtime. Check that Maven runs on Java 25:
mvn -versionThe output must include Java version: 25. If it shows another version, follow the Java instructions above to
restore Java 25 as the default.
Install Git to clone the source code:
sudo apt install gitDocker is needed only to build local Docker images and to run the tests. Install Docker, then make sure your user can run Docker without root — the build talks to Docker as the user who runs Maven.
Clone the repository from the official GitHub repo:
git clone -b release-2.4.2 https://github.com/thingsboard/tbmq.gitcd tbmqFrom the tbmq directory, build the project:
mvn clean install -DskipTestsTo also build the Docker images, run the build with the Docker plugin enabled:
mvn clean install -DskipTests -Ddockerfile.skip=falseThe build creates the following images, each also tagged latest:
thingsboard/tbmq:2.4.2thingsboard/tbmq-node:2.4.2thingsboard/tbmq-integration-executor:2.4.2Debian, RPM, and Windows packages are located in the target folder:
cd application/target| File | Package |
|---|---|
thingsboard-mqtt-broker.deb |
Debian and Ubuntu package |
thingsboard-mqtt-broker.rpm |
RPM package |
thingsboard-mqtt-broker-windows.zip |
Windows package |
Integration tests start their dependencies in Docker containers through Testcontainers, so they need Docker with access for your user.
Run all unit and integration tests:
mvn clean installCommon fixes for build issues:
Clean Maven cache:
rm -rf ~/.m2/repositoryClean Gradle cache:
rm -rf ~/.gradle/caches/Clean node modules:
rm -rf ui-ngx/node_modulesBuild in parallel, format license headers, and build Docker images:
mvn -T 0.8C license:format clean install -DskipTests -Ddockerfile.skip=falseThe Docker install runs the thingsboard/tbmq images, so after a local image build it runs your build.
See Docker (Linux, macOS).
Every broker parameter, its environment variable, and its default. See the configuration reference.
Set up client credentials, then publish and subscribe with an MQTT client. See Getting started.
How the broker nodes, Kafka, Valkey, and PostgreSQL fit together. See Architecture.
Was this helpful?