Stop the war

Stand with Ukraine flag

Support Ukraine

Try it now Pricing
Community Edition
Community Edition Professional Edition Cloud Edge PE Edge IoT Gateway License Server Trendz Analytics Mobile Application PE Mobile Application MQTT Broker
Installation > On premise > Building from sources
Getting Started Documentation Devices Library Guides
Architecture API FAQ
On this page

Building from sources

This guide will help you to download and build ThingsBoard from sources. Instructions listed below are tested on Ubuntu 20.04 LTS and CentOS 7/8

Required tools

This section contains installation instructions for build tools.

Java

ThingsBoard is build using Java 11. You can use following instructions to install Java 11.

Maven

ThingsBoard build requires Maven 3.1.0+.

1
sudo apt-get install maven
1
sudo yum install maven

Please note that maven installation may set Java 7 as a default JVM on certain Linux machines. Use java installation instructions to fix this.

Source code

doc warn icon

NOTE: Building Docker image on Windows machine

To build Docker image certain scripts, configuration files and sources what will be a part of the Docker image must have LF line endings. So before cloning the repo set to input the Git core.autocrlf configuration option.

For example, to set core.autocrlf globally:

git config --global core.autocrlf input

You can clone source code of the project from the official github repo.

1
2
3
# checkout latest release branch
git clone -b release-3.6 [email protected]:thingsboard/thingsboard.git --depth 1
cd thingsboard

Build

Run the following command from the thingsboard folder to build the project:

1
mvn clean install -DskipTests

Build local docker images

doc warn icon

NOTE: Building Docker image on Windows machine

To build Docker image certain scripts, configuration files and sources what will be a part of the Docker image must have LF line endings. So before cloning the repo set to input the Git core.autocrlf configuration option.

For example, to set core.autocrlf globally:

git config --global core.autocrlf input

Make sure that Docker is installed.

1
mvn clean install -DskipTests -Ddockerfile.skip=false

Build artifacts

You can find debian, rpm and windows packages in the target folder:

1
application/target

Running tests

We are using docker and docker-compose to run all kind of integration and black-box tests.

Please, manage Docker as a non-root user to run tests properly.

Master and release branches is already tested, so you can skip tests and avoid installing docker as well.

Run all unit and integration tests:

1
mvn clean install

To run black-box tests, please refer black-box tests readme.

Estimated time is about 1 hour on AMD Ryzen 5 3600 (6-cores), 32GB DDR4, fancy SSD and shiny weather. Actual time may vary and depends on particular hardware performance.

Tips and tricks

Thingsboard is quite easy to build from sources on a brand-new clear environment.

Here are some tips and tricks to boost build experience:

  • clean maven cache
    1
    
    rm -rf ~/.m2/repository
    
  • clean gradle cache
    1
    
    rm -rf ~/.gradle/caches/
    
  • clean node modules
    1
    
    rm -rf ui-ngx/node_modules
    
  • build in parallel, format headers, build docker images
    1
    
    mvn -T 0.8C license:format clean install -DskipTests -Ddockerfile.skip=false
    

Build and runtime errors

  • If you see such errors when running locally-built Docker image, re-clone the repo with LF file ending and re-build the image. To fix this read Source code section.
1
Standard_init_linux.go:175 exec user process caused no such file