Installing ThingsBoard Trendz Analytics on Ubuntu


This guide describes how to install Trendz Analytics on Ubuntu Server 18.04 LTS.

Hardware requirements depend on amount of analyzed data and amount of devices connected to the system. To run Trendz Analytics on a single machine you will need at least 1Gb of free RAM.

In small and medium installations Trendz can be installed on the same server with ThingsBoard.

Step 1. Install Java 8 (OpenJDK)

ThingsBoard服务运行在Java 8上。请按照以下说明安装OpenJDK 8。

sudo apt update
sudo apt install openjdk-8-jdk

请不要忘记将操作系统配置为默认使用OpenJDK 8。


sudo update-alternatives --config java


java -version


openjdk version "1.8.0_xxx"
OpenJDK Runtime Environment (...)
OpenJDK 64-Bit Server VM (build ...)

Step 2. Trendz Analytics service installation

Download installation package.


Install Trendz Analytics as a service

sudo dpkg -i trendz-1.5.0.deb

Step 3. Obtain and configure license key

We assume you have already have Trendz license key. If not, please get your Free Trial license before you proceed. See How-to get pay-as-you-go subscription for more details.

Once you get the license secret, you should put it to the trendz configuration file. Open the file for editing using the following command:

sudo nano /etc/trendz/conf/trendz.conf

Add the following lines to the configuration file and put your license secret:

# License secret obtained from ThingsBoard License Portal (

Step 4. Configure connection with ThingsBoard Platform

You can connect Trendz Analytics to the ThingsBoard Community Edition or ThingsBoard Professional Edition.

Step 4.1 ThingsBoard Community Edition

Edit Trendz configuration file

sudo nano /etc/trendz/conf/trendz.conf

Add ThingsBoard REST API URL that would be used for communicating with ThingsBoard Platform

# ThingsBoard URL that will be used by Trendz
export TB_API_URL=http://localhost:8080
export TB_API_PE_ENABLED=false

Step 4.2 ThingsBoard Professional Edition


sudo nano /etc/trendz/conf/trendz.conf

Add ThingsBoard REST API URL that would be used for communicating with ThingsBoard Platform

# ThingsBoard URL that will be used by Trendz
export TB_API_URL=http://localhost:8080
export TB_API_PE_ENABLED=true

Step 5. Run installation script

Once Trendz service is installed, you can execute the following script:

sudo /usr/share/trendz/bin/install/

Step 6. Start Trendz service

Execute the following command to start Trendz Analytics:

sudo service trendz start

Once started, you will be able to open Web UI using the following link:


For first authentication you need to use Tenant Administrator credentials from your ThingsBoard

Trendz uses ThingsBoard as an authentication service. During first sign in ThingsBoard service should be also available to validate credentials.

Step 7. HTTPS configuration

You may want to configure HTTPS access using HAProxy. This is possible in case you are hosting Trendz in the cloud and have a valid DNS name assigned to your instance.

Step 7.1. Trendz and ThingsBoard hosted on same server

Use this section if HAProxy/Let’s Encrypt already installed in the server and HTTPS enabled for ThingsBoard.

Open HAProxy configuration file

sudo nano /etc/haproxy/haproxy.cfg

Locate frontend https_in section, add new access list that will match traffic by domain name and redirect this traffic to Trendz backend:

acl trendz_http hdr(host) -i
use_backend tb-trendz if trendz_http

In the same file register Trendz backend:

backend tb-trendz
  balance leastconn
  option tcp-check
  option log-health-checks
  server tbTrendz1 check inter 5s
  http-request set-header X-Forwarded-Port %[dst_port]

Generate SSL certificates for new domain:

sudo certbot-certonly --domain --email

Refresh HAProxy configuration:

sudo haproxy-refresh

That’s it, HTTPS for Trendz UI configured and now you can access it via:

Step 7.2. Fresh installation on new server

Please follow this guide to install HAProxy and generate valid SSL certificate using Let’s Encrypt.


Trendz logs are stored in the following directory:


You can issue the following command in order to check if there are any errors on the backend side:

cat /var/log/trendz/trendz.log | grep ERROR