Skip to content

Building ThingsBoard from Sources

This guide walks you through downloading and building ThingsBoard from source code. Instructions are tested on Ubuntu 24.04 LTS and CentOS 8/9.

ThingsBoard is built using Java 17. See Install Java 17 on Ubuntu for installation instructions.

Verify the installation:

Terminal window
java -version

ThingsBoard requires Maven 3.1.0 or newer.

Terminal window
sudo apt-get install maven

Clone the ThingsBoard repository from GitHub:

Terminal window
# checkout latest release branch
git clone -b release-4.3 https://github.com/thingsboard/thingsboard.git --depth 1
cd thingsboard

From the project root directory, run:

Terminal window
mvn clean install -DskipTests

This command builds the project, skips unit and integration tests, and produces installation artifacts.

To build local Docker images for ThingsBoard services, ensure Docker is installed. Then run:

Terminal window
mvn clean install -DskipTests -Ddockerfile.skip=false

List the built images:

Terminal window
docker images

After a successful build, installation packages are available in:

Terminal window
application/target

This directory contains:

  • .deb packages for Debian/Ubuntu
  • .rpm packages for CentOS/RHEL
  • Windows installation packages

This requires Docker and Docker Compose. Make sure Docker is configured to run as a non-root user.

Terminal window
mvn clean install

Black-box tests are located in the msa/black-box-tests directory. Follow the instructions in the README to execute them.

Clean Maven cache:

Terminal window
rm -rf ~/.m2/repository

Clean Gradle cache:

Terminal window
rm -rf ~/.gradle/caches/

Clean node modules:

Terminal window
rm -rf ui-ngx/node_modules

Build in parallel, format headers, build Docker images:

Terminal window
mvn -T 0.8C license:format clean install -DskipTests -Ddockerfile.skip=false

If you see the following error when running a locally built Docker image:

Terminal window
Standard_init_linux.go:175 exec user process caused no such file

This usually indicates incorrect line endings.

Solution: reconfigure Git to use LF line endings, re-clone the repository, and rebuild the Docker images. See the Source code section above for details.