Installing ThingsBoard on Raspberry Pi
This guide walks you through installing ThingsBoard on a Raspberry Pi, from a clean environment to a fully running instance. By the end, you will have a licensed, activated ThingsBoard instance — free, no credit card required — with a system administrator account and, optionally, a demo tenant.
Prerequisites
Section titled “Prerequisites”- Raspberry Pi with at least 4 GB of RAM
- Raspberry Pi OS (64-bit) based on Debian 13 “Trixie” — earlier releases do not provide the OpenJDK 25 packages
- A user account with
sudoprivileges - Outbound internet access to download packages and to reach the ThingsBoard License Portal during activation
Step 1. Install Java (OpenJDK)
Section titled “Step 1. Install Java (OpenJDK)”ThingsBoard runs on the Java Virtual Machine and requires Java 25. Install OpenJDK 25:
sudo apt updatesudo apt install -y openjdk-25-jdk-headlessSet OpenJDK 25 as the default Java version:
sudo update-alternatives --config javaVerify the installation:
java -versionThe reported version must be 25.
Step 2. Install ThingsBoard Package
Section titled “Step 2. Install ThingsBoard Package”Download the installation package:
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4/thingsboard-4.4.debInstall ThingsBoard as a service:
sudo dpkg -i thingsboard-4.4.debStep 3. Configure Database
Section titled “Step 3. Configure Database”Install PostgreSQL 16:
sudo apt install -y postgresql-commonsudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.shsudo apt updatesudo apt -y install postgresql-16sudo service postgresql startSet a password for the postgres user:
sudo -u postgres psql -c "\password"Enter and confirm the password when prompted. Connect to PostgreSQL and create the ThingsBoard database:
psql -U postgres -d postgres -h 127.0.0.1 -WCREATE DATABASE thingsboard;Press Ctrl+D twice to exit.
Configure ThingsBoard to use PostgreSQL. Edit the configuration file:
sudo nano /etc/thingsboard/conf/thingsboard.confAdd the following lines. Replace PUT_YOUR_POSTGRESQL_PASSWORD_HERE with your actual postgres password:
# DB Configurationexport DATABASE_TS_TYPE=sqlexport SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/thingsboardexport SPRING_DATASOURCE_USERNAME=postgresexport SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HEREStep 4. Choose Queue Service
Section titled “Step 4. Choose Queue Service”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.
To use Confluent Cloud, first create an account, then create a Kafka cluster and obtain your API Key.
Edit the ThingsBoard configuration file:
sudo nano /etc/thingsboard/conf/thingsboard.confAdd the following lines. Replace CLUSTER_API_KEY, CLUSTER_API_SECRET, and localhost:9092 with your Confluent Cloud values:
export TB_QUEUE_TYPE=kafkaexport TB_QUEUE_KAFKA_USE_CONFLUENT_CLOUD=trueexport TB_KAFKA_SERVERS=localhost:9092export TB_QUEUE_KAFKA_REPLICATION_FACTOR=3export TB_QUEUE_KAFKA_CONFLUENT_SASL_JAAS_CONFIG='org.apache.kafka.common.security.plain.PlainLoginModule required username="CLUSTER_API_KEY" password="CLUSTER_API_SECRET";'export TB_QUEUE_CORE_POLL_INTERVAL_MS=1000export TB_QUEUE_CORE_PARTITIONS=2export TB_QUEUE_RULE_ENGINE_POLL_INTERVAL_MS=1000export TB_QUEUE_TRANSPORT_REQUEST_POLL_INTERVAL_MS=1000export TB_QUEUE_TRANSPORT_RESPONSE_POLL_INTERVAL_MS=1000export TB_QUEUE_TRANSPORT_NOTIFICATIONS_POLL_INTERVAL_MS=1000export TB_QUEUE_VC_INTERVAL_MS=1000export TB_QUEUE_VC_PARTITIONS=1You can adjust the default Rule Engine queue configuration later from the UI. See Rule Engine Queues for details.
Step 5. Memory Configuration
Section titled “Step 5. Memory Configuration”Raspberry Pi devices typically have limited RAM. Edit the ThingsBoard configuration file:
sudo nano /etc/thingsboard/conf/thingsboard.confAdd or update the following environment variable. Set the value to half of your total RAM (e.g. 2G for a 4 GB Raspberry Pi):
export JAVA_OPTS="$JAVA_OPTS -Xms2G -Xmx2G"Step 6. Run Installation Script
Section titled “Step 6. Run Installation Script”Run the installation script to initialize the database schema:
sudo /usr/share/thingsboard/bin/install/install.shStep 7. Start ThingsBoard
Section titled “Step 7. Start ThingsBoard”Start the ThingsBoard service:
sudo service thingsboard startConfigure Firewall
Section titled “Configure Firewall”Open the required ports in your firewall so devices and users can reach the platform — expand the list below for the full set of ports and protocols.
Full port list
| Port | Protocol | Description |
|---|---|---|
8080 | TCP | Web UI and REST API. Not required if using a load balancer. |
1883 | TCP | MQTT |
8883 | TCP | MQTT over SSL |
5683 | UDP | CoAP |
5684 | UDP | CoAP over DTLS |
5685 | UDP | LwM2M CoAP |
5686 | UDP | LwM2M CoAP over DTLS |
5687 | UDP | LwM2M (Bootstrap) |
5688 | UDP | LwM2M over DTLS (Bootstrap) |
161 | UDP | SNMP |
7070 | TCP | Edge RPC (gRPC) |
9090 | TCP | Remote Integration Executor (gRPC) |
Access ThingsBoard Web UI
Section titled “Access ThingsBoard Web UI”Open ThingsBoard in a web browser:
http://localhost:8080On first launch you are greeted with the activation screen:
Welcome to ThingsBoard 4.4.0Get your free license and start buildingContinue with the next step to license and activate your instance.
Step 8. License and Activate Your Instance
Section titled “Step 8. License and Activate Your Instance”Opening ThingsBoard in your browser for the first time shows an activation welcome screen.
- Click Open the License Portal, then create an account or sign in.
- Choose a free license: Commercial (up to 100 devices, one server) or Non-commercial (up to 1,000 devices, any number of servers).
- Check the confirmation box to agree to the Terms of Use, Privacy Policy, and ThingsBoard License (BUSL 1.1), then click Accept and activate to issue the license and activate your instance.
- Click Continue setup on your instance to proceed to account creation. Your license key stays available on this screen and in your License Portal account.
- Click Already have a license?, paste your license key, and click Activate.
- Your instance is now activated. The license is saved on this server and in your License Portal account.
Step 9. Create Your Administrator Account
Section titled “Step 9. Create Your Administrator Account”Once activated, ThingsBoard prompts you to create your System Administrator account — the account that manages the platform itself (tenants, system settings, platform-wide resources).
- Enter Email, Password, and Confirm password.
- The Set up a demo tenant option is selected by default: it creates a ready-made tenant with dashboards, devices, and rule chains for exploring the platform before building your own solution. Clear it if you want to start with an empty platform.
- Click Create account. You are signed in as the system administrator.
Your ThingsBoard instance is now installed and running.
[Optional] Install ThingsBoard WebReport Component
Section titled “[Optional] Install ThingsBoard WebReport Component”The WebReport service renders dashboards into PDF and PNG reports. Install it if you need scheduled or on-demand dashboard reports. Choose one of the installation methods below:
Install Docker:
curl -fsSL https://get.docker.com -o get-docker.shsudo sh get-docker.shCreate the Docker Compose file:
nano tb-web-report.ymlAdd the following content:
version: '3.0'services: tb-web-report: container_name: tb-web-report restart: always image: "thingsboard/tb-web-report:4.4.0" ports: - "8383:8383" env_file: - ./tb-web-report.envCreate the environment file:
nano tb-web-report.envAdd the following content:
HTTP_BIND_ADDRESS=0.0.0.0HTTP_BIND_PORT=8383LOGGER_LEVEL=infoLOG_FOLDER=logsLOGGER_FILENAME=tb-web-report-%DATE%.logDOCKER_MODE=trueDEFAULT_PAGE_NAVIGATION_TIMEOUT=120000DASHBOARD_IDLE_WAIT_TIME=3000USE_NEW_PAGE_FOR_REPORT=trueStart the WebReport service:
docker compose -f tb-web-report.yml up -dCheck the container logs:
docker logs -f tb-web-reportDownload the WebReport installation package:
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4/tb-web-report-4.4.debInstall the required libraries:
sudo apt install -yq libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \ libexpat1 libfontconfig1 libgcc1 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \ libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \ libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ ca-certificates fonts-liberation libnss3 lsb-release xdg-utils unzip wget libgbm-devInstall the Roboto fonts:
sudo apt install -y fonts-robotoInstall and start the WebReport service:
sudo dpkg -i tb-web-report-4.4.debsudo service tb-web-report startTroubleshooting
Section titled “Troubleshooting”Check the service status:
sudo service thingsboard statusThingsBoard logs are stored in /var/log/thingsboard. Check for errors:
cat /var/log/thingsboard/thingsboard.log | grep ERRORMonitor logs in real time:
tail -f /var/log/thingsboard/thingsboard.logFor more troubleshooting tips, see the Troubleshooting guide.
Next Steps
Section titled “Next Steps”With ThingsBoard running, these concept guides help you build your first solution:
- Getting Started — a guided walkthrough of the platform after installation.
- Multi-Tenancy & Hierarchy — how tenants, customers, and users are organized.
- Digital Twin Model — how devices and assets are modeled in the platform.
- Data Processing — how the Rule Engine transforms and routes incoming data.
- Alarms & Notifications — how to detect conditions and notify users.
- Data Visualization — how to build dashboards and widgets.
Was this helpful?