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.
Required tools
Section titled “Required tools”ThingsBoard is built using Java 17. See Install Java 17 on Ubuntu for installation instructions.
Verify the installation:
java -versionThingsBoard requires Maven 3.1.0 or newer.
sudo apt-get install mavensudo yum install mavenSource code
Section titled “Source code”Clone the ThingsBoard repository from GitHub:
# checkout latest release branchgit clone -b release-4.3 https://github.com/thingsboard/thingsboard.git --depth 1cd thingsboardBuild the project
Section titled “Build the project”From the project root directory, run:
mvn clean install -DskipTestsThis command builds the project, skips unit and integration tests, and produces installation artifacts.
Build local Docker images (optional)
Section titled “Build local Docker images (optional)”To build local Docker images for ThingsBoard services, ensure Docker is installed. Then run:
mvn clean install -DskipTests -Ddockerfile.skip=falseList the built images:
docker imagesBuild artifacts
Section titled “Build artifacts”After a successful build, installation packages are available in:
application/targetThis directory contains:
.debpackages for Debian/Ubuntu.rpmpackages for CentOS/RHEL- Windows installation packages
Running tests (optional)
Section titled “Running tests (optional)”This requires Docker and Docker Compose. Make sure Docker is configured to run as a non-root user.
Unit and integration tests
Section titled “Unit and integration tests”mvn clean installBlack-box tests
Section titled “Black-box tests”Black-box tests are located in the msa/black-box-tests directory. Follow the instructions in the README to execute them.
Tips and tricks
Section titled “Tips and tricks”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 headers, build Docker images:
mvn -T 0.8C license:format clean install -DskipTests -Ddockerfile.skip=falseCommon build and runtime errors
Section titled “Common build and runtime errors”Docker runtime error
Section titled “Docker runtime error”If you see the following error when running a locally built Docker image:
Standard_init_linux.go:175 exec user process caused no such fileThis 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.