ThingsBoard Documentation

Documentation for using ThingsBoard IoT Platform.
ThingsBoard Professional Edition with White-labeling and Platform Integrations Learn More

Installing ThingsBoard on Windows


IoT PaaS Demo


We recommend to use ThingsBoard Live Demo for the seamless experience and the newest features from the latest source code!

Save time on the installation and configuration with several pre-provisioned devices, dashboards available in the cloud and pre-integrated email server to create new customer accounts and users.

This guide describes how to install ThingsBoard on a Windows machine. Instructions below are provided for Windows 10/8.1/8/7 32-bit/64-bit.

Hardware requirements

To run ThingsBoard and third-party components on a single machine you will need at least 2Gb of RAM (4Gb recommended).

Third-party components installation

Java

ThingsBoard service is running on Java 8. If you don’t have Java installed, please download and install Java 8 using this link.

[Optional] External database installation

ThingsBoard is able to use SQL or NoSQL(Cassandra) database layer. By default, ThingsBoard uses embedded HSQLDB instance which is very convenient for evaluation or development purposes.

If this is your first experience with ThingsBoard we recommend to skip this step and use the embedded database.
Alternatively, you can configure your platform to use either scalable Cassandra DB cluster or various SQL databases. If you prefer to use an SQL database, we recommend PostgreSQL.

SQL Database: PostgreSQL

NOTE: This is an optional step. It is required only for production usage. You can use embedded HSQLDB for platform evaluation or development

Download the installation file here and follow the installation instructions.

Once PostgreSQL is installed you may want to create the new user or set the password for the main user.

When it’s done, connect to the database and create thingsboard DB:

psql -U postgres -d postgres -h 127.0.0.1 -W

CREATE DATABASE thingsboard;
\q
NoSQL Database: Cassandra

NOTE: This is an optional step. It is required only for production usage. You can use embedded HSQLDB for platform evaluation or development

Instructions listed below will help you to install Cassandra.

image

image

image

image

image

image

image

image

ThingsBoard service installation

[Optional] Configure ThingsBoard to use external database

NOTE: This is an optional step. It is required only for production usage. You can use embedded HSQLDB for platform evaluation or development

Edit ThingsBoard configuration file:

C:\thingsboard\conf\thingsboard.yml

Comment ‘# HSQLDB DAO Configuration’ block.

# HSQLDB DAO Configuration
#spring:
#  data:
#    jpa:
#      repositories:
#        enabled: "true"
#  jpa:
#    hibernate:
#      ddl-auto: "validate"
#    database-platform: "org.hibernate.dialect.HSQLDialect"
#  datasource:
#    driverClassName: "${SPRING_DRIVER_CLASS_NAME:org.hsqldb.jdbc.JDBCDriver}"
#    url: "${SPRING_DATASOURCE_URL:jdbc:hsqldb:file:${SQL_DATA_FOLDER:/tmp}/thingsboardDb;sql.enforce_size=false}"
#    username: "${SPRING_DATASOURCE_USERNAME:sa}"
#    password: "${SPRING_DATASOURCE_PASSWORD:}"

For PostgreSQL:

Uncomment ‘# PostgreSQL DAO Configuration’ block. Be sure to update the postgres databases username and password in the bottom two lines of the block (here, as shown, they are both “postgres”).

# PostgreSQL DAO Configuration
spring:
  data:
    jpa:
      repositories:
        enabled: "true"
  jpa:
    hibernate:
      ddl-auto: "validate"
    database-platform: "org.hibernate.dialect.PostgreSQLDialect"
  datasource:
    driverClassName: "${SPRING_DRIVER_CLASS_NAME:org.postgresql.Driver}"
    url: "${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/thingsboard}"
    username: "${SPRING_DATASOURCE_USERNAME:postgres}"
    password: "${SPRING_DATASOURCE_PASSWORD:postgres}"

For Cassandra DB:

Locate and set database type configuration parameter to ‘cassandra’.

database:
  type: "${DATABASE_TYPE:cassandra}" # cassandra OR sql

Memory update for slow machines (1GB of RAM)

We recommend to use embedded HSQLDB or PostgreSQL DB in this setup. We don’t recommend to use Cassandra on machines with less then 4GB of RAM.

Go to your environment variables and set JAVA_OPTS variable:

JAVA_OPTS=-Xms256M -Xmx256M
Start ThingsBoard service

Now let’s start the ThingsBoard service! Open the command prompt as an Administrator and execute the following command:

net start thingsboard

Expected output:

The ThingsBoard Server Application service is starting.
The ThingsBoard Server Application service was started successfully.

In order to restart the ThingsBoard service you can execute following commands:

net stop thingsboard
net start thingsboard

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

http://localhost:8080/

NOTE: Please allow up to 90 seconds for the Web UI to start

Troubleshooting

The log files are located in logs folder (“C:\thingsboard\logs” in our case).

The thingsboard.log file should contain following line:

YYYY-MM-DD HH:mm:ss,sss [main] INFO  o.t.s.ThingsboardServerApplication - Started ThingsboardServerApplication in x.xxx seconds (JVM running for x.xxx)

In case of any unclear errors, use general troubleshooting guide or contact us.

Windows firewall settings

In order to have external access to ThingsBoard Web UI and device connectivity (HTTP, MQTT, CoAP) you need to create a new inbound rule with Windows Firewall with Advanced Security.

image

image

image

image

image

image

image

image