This guide describes how to install ThingsBoard on Ubuntu 18.04 LTS / Ubuntu 20.04 LTS. Hardware requirements depend on the database chosen and the number of devices connected to the system. To run ThingsBoard and PostgreSQL on a single machine, you will need at least 1 GB of RAM. To run ThingsBoard and Cassandra on a single machine, you will need at least 8 GB of RAM.
Here we will focus, as with the Docker Compose method, on installation on a Postgres database.
Install Java (OpenJDK)
Thingsboard needs Java to work, here are the commands to install Java
sudo apt update
sudo apt install openjdk-11-jdk
Don't forget to configure your operating system to use OpenJDK 11 by default. You can configure the default version using the following command:
sudo update-alternatives --config java
Check that java is working correctly
java-version
Installing the Thingsboard service
Download the installation package.
Download the following deb file, with the WGET command for example
wget https://github.com/thingsboard/thingsboard/releases/download/v3.4.1/thingsboard-3.4.1.deb
Install Thingsboard as a service.
sudo dpkg -i thingsboard-3.4.1.deb
Installing Postgres
Remember that we are describing the installation of Thingsboard with a Postgres database here.
sudo apt install -y wget
sudo apt install gnupg
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
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
sudo apt update
sudo apt -y install postgresql-12
sudo service postgresql start
Configuring Thingsboard
It's time to configure Thingsboard by editing the "thingsboard.conf" configuration file
sudo nano /etc/thingsboard/conf/thingsboard.conf
Save the file , specifying your database password.
Configuring Thingsboard's Queuing System
ThingsBoard is capable of using various queuing systems to store messages and communication between ThingsBoard services.
There are several queue services you can check out here
In this tutorial, we will use the queue service Kafka with a Postgres database
ZooKeeper installation
sudo apt-get install zookeeper
Installing Kafka
tar xzf kafka_2.13-2.6.0.tgz
sudo mv kafka_2.13-2.6.0 /usr/local/kafka
Configure the ZooKeeper Systemd Unit file
Create the Zookeeper systemd file:
sudo nano /etc/systemd/system/zookeeper.service
Add the following content
Configure the Kafka Systemd Unit file
Create a systemd unit file for Kafka:
sudo nano /etc/systemd/system/kafka.service
Add the content below. Make sure to replace "PUT_YOUR_JAVA_PATH" with your real JAVA_HOME path according to the Java installed on your system, defaults like "/usr/lib/jvm/java-11-openjdk-xxx":
Start ZooKeeper and Kafka:
sudo systemctl start zookeeper
sudo systemctl start kafka
Edit the ThingsBoard configuration file.
sudo nano /etc/thingsboard/conf/thingsboard.conf
Add the following line to the configuration file. Don't forget to replace "localhost:9092" with your real Kafka servers:
export TB_QUEUE_TYPE=kafka
export TB_KAFKA_SERVERS=localhost:9092
Launch the ThingsBoard service
Run the following command to start ThingsBoard:
sudo service thingsboard start
Once started, you will be able to open the web UI using the following link:
http://localhost:8080/
The following default credentials are available if you specified -loadDemo when running the installation script (which is the case here):
System administrator: sysadmin@thingsboard.org / sysadmin
Administrator: tenant@thingsboard.org / tenant
User customer: customer@thingsboard.org / customer
You can always change passwords for each account in the account profile page.
Please allow up to 90 seconds for the web user interface to start. This only applies to slow machines with 1-2 CPUs or 1-2 GB of RAM.
Post install configuration and optimization
Your Thingsboard server is ready to go, however for post installation tweaks, such as using HTTPS via proxy or to configure Thingsboard for use with a small amount of memory, you can follow the official instructions.
Do you need a machine to create a server?
We provide ruggedized mini PCs which, thanks to their characteristics, can be suitable for this type of use.
View the products listed on our shop by clicking below:
Our pre-sales team is available to answer your questions and guide you through your projects.
You can contact us directly, we can define a tailor-made solution and equipment with you thanks to our network of partners.
Contact form
sales@sparwan.com
02 51 99 13 03