Skip to content
Stand with Ukraine flag

Installing ThingsBoard CE on Raspberry Pi

This guide walks you through installing ThingsBoard Community Edition on a Raspberry Pi.

  • Raspberry Pi with at least 4 GB of RAM
  • Raspberry Pi OS (64-bit recommended)
Terminal window
sudo apt update
sudo apt install -y openjdk-17-jdk

Set Java 17 as the default version:

Terminal window
sudo update-alternatives --config java

Verify the installation:

Terminal window
java -version

Download the installation package:

Terminal window
wget https://github.com/thingsboard/thingsboard/releases/download/v4.3.1.1/thingsboard-4.3.1.1.deb

Install ThingsBoard as a service:

Terminal window
sudo dpkg -i thingsboard-4.3.1.1.deb

Install PostgreSQL 16:

Terminal window
sudo apt install -y postgresql-common
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
sudo apt update
sudo apt -y install postgresql-16
sudo service postgresql start

Set a password for the postgres user:

Terminal window
sudo -u postgres psql -c "\password"

Enter and confirm the password when prompted. Connect to PostgreSQL and create the ThingsBoard database:

Terminal window
psql -U postgres -d postgres -h 127.0.0.1 -W
CREATE DATABASE thingsboard;

Press Ctrl+D twice to exit.

Configure ThingsBoard to use PostgreSQL. Edit the configuration file:

Terminal window
sudo nano /etc/thingsboard/conf/thingsboard.conf

Add the following lines. Replace PUT_YOUR_POSTGRESQL_PASSWORD_HERE with your actual postgres password:

Terminal window
# 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

ThingsBoard uses a message broker for internal communication between services. Choose one of the options below:

  • In Memory — built-in, default. Suitable for development and PoC environments. Not recommended for production or cluster deployments.
  • Confluent Cloud — fully managed streaming platform based on Kafka. Useful for cloud-agnostic deployments.

In Memory queue is built-in and enabled by default. No configuration needed.

Raspberry Pi devices typically have limited RAM. Edit the ThingsBoard configuration file:

Terminal window
sudo nano /etc/thingsboard/conf/thingsboard.conf

Add or update the following environment variable. Set the value to half of your total RAM (e.g. 2G for a 4 GB Raspberry Pi):

Terminal window
export JAVA_OPTS="$JAVA_OPTS -Xms2G -Xmx2G"
Terminal window
sudo /usr/share/thingsboard/bin/install/install.sh --loadDemo
Terminal window
sudo service thingsboard start

Once started, open http://localhost:8080 in your browser. You should see the ThingsBoard login page. Use the following default credentials:

You can change passwords for each account in the account profile page.

See Getting Started for your next steps after login.

The upgrade procedure for Raspberry Pi is identical to the Ubuntu instructions.

See the Upgrade Instructions for detailed steps.

ThingsBoard logs are stored in /var/log/thingsboard. Check for errors with:

Terminal window
cat /var/log/thingsboard/thingsboard.log | grep ERROR