How to install ThingsBoard | Thingsboard Step by Step Installation in Ubuntu.



How to install ThingsBoard | Thingsboard Step by Step Installation in Ubuntu.

How to install ThingsBoard | Thingsboard Step by Step Installation in Ubuntu.

Thingsboard Step by Step Installation in Ubuntu.

Installing ThingsBoard CE on Ubuntu Server

Step 1. Install Java 11 (OpenJDK)
OpenJDK 11:

1. sudo apt update
2. sudo apt install openjdk-11-jdk

sudo update-alternatives –config java

java -version

Step 2. ThingsBoard service installation

wget https://github.com/thingsboard/thingsboard/releases/download/v3.4.4/thingsboard-3.4.4.deb

Step 3. Configure ThingsBoard database – PostgreSQL

#======================================
sudo dpkg -i thingsboard-3.4.4.deb

# install **wget** if not already installed:
sudo apt install -y wget

# import the repository signing key:
#!! Warning !!!! replace “greater than” with “greater than” sign in logic math
wget –quiet -O – https://www.postgresql.org/media/keys/ACCC4CF8.asc “greater than” postgresql.key

sudo mv postgresql.key /etc/apt/trusted.gpg.d/

# add repository contents to your system:
RELEASE=$(lsb_release -cs)
echo “deb http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}”-pgdg main | sudo tee /etc/apt/sources.list.d/pgdg.list

# install and launch the postgresql service:
sudo apt update
sudo apt -y install postgresql-12

sudo service postgresql start
#=============================================

sudo su – postgres

psql

password

q

Then, press “Ctrl+D” to return to main user console and connect to the database to create thingsboard DB:

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

CREATE DATABASE thingsboard;

q

sudo nano /etc/thingsboard/conf/thingsboard.conf

Add the following lines to the configuration file. Don’t forget to replace “PUT_YOUR_POSTGRESQL_PASSWORD_HERE” with your real postgres user password:
#=======================
# DB Configuration
export DATABASE_TS_TYPE=sql
export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/thingsboard
export SPRING_DATASOURCE_USERNAME=postgres
export SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HERE
# Specify partitioning size for timestamp key-value storage. Allowed values: DAYS, MONTHS, YEARS, INDEFINITE.
export SQL_POSTGRES_TS_KV_PARTITIONING=MONTHS
#===============================