Skip to content
Stand with Ukraine flag

Installing ThingsBoard PE on Ubuntu Server

This guide covers installing ThingsBoard Professional Edition (PE) on Ubuntu Server. By the end, you will have a fully functional ThingsBoard instance up and running.

  • Ubuntu 22.04 LTS or 24.04 LTS

Ensure your server meets the minimum requirements:

Use caseCPURAMStorageRecommended services
Development / PoC1 core4 GB20 GBThingsBoard, PostgreSQL
Production (small)2 cores8 GB50 GB SSDThingsBoard, PostgreSQL, Kafka
Production (recommended)4+ cores16+ GB100+ GB SSDThingsBoard, PostgreSQL, Kafka, Cassandra

ThingsBoard requires Java 17 or higher. We recommend installing OpenJDK 21:

Terminal window
sudo apt update && sudo apt install -y openjdk-21-jdk-headless

Set Java 21 as the default version. Use the non-interactive command:

Terminal window
sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-$(dpkg --print-architecture)/bin/java

Or, if you have multiple Java versions installed and want to choose interactively:

Terminal window
sudo update-alternatives --config java

Verify the installation:

Terminal window
java -version

Install required font libraries needed by the reporting component:

Terminal window
sudo apt update && sudo apt install -y libharfbuzz0b fontconfig fonts-dejavu-core

Download and install the ThingsBoard PE 4.3.1.1PE package.

Terminal window
wget https://dist.thingsboard.io/thingsboard-4.3.1.1pe.deb
sudo dpkg -i thingsboard-4.3.1.1pe.deb

Verify the installation:

Terminal window
dpkg -l thingsboard

We assume you have already chosen your subscription plan or decided to purchase a perpetual license. If not, navigate to the pricing page to select the best license option for your case. See How to get a pay-as-you-go subscription or How to get a perpetual license for details.

Export your license secret as an environment variable, replacing YOUR_LICENSE_SECRET with the actual value:

Terminal window
TB_LICENSE_SECRET=YOUR_LICENSE_SECRET

Then apply it to the configuration file:

Terminal window
sudo sed -i "s/# export TB_LICENSE_SECRET=.*/export TB_LICENSE_SECRET=$TB_LICENSE_SECRET/" /etc/thingsboard/conf/thingsboard.conf

ThingsBoard supports two database configurations:

  • PostgreSQL only — stores all data (entities and time-series) in PostgreSQL. Recommended for most deployments handling up to 5,000 messages per second. Simple to operate with minimal infrastructure requirements.
  • Hybrid (PostgreSQL + Cassandra) — stores entities in PostgreSQL and time-series data in Cassandra. Designed for high-throughput deployments exceeding 5,000 messages per second or with millions of devices. Requires significant additional resources: at least 8 GB RAM, a dedicated multi-core CPU, and fast SSD storage for the Cassandra node.

Install PostgreSQL 18:

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-18
sudo systemctl start postgresql

Export your PostgreSQL password as an environment variable — this value will be used in the following steps:

Terminal window
TB_DB_PASSWORD=YOUR_PASSWORD

Set the password for the postgres user and create the ThingsBoard database:

Terminal window
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$TB_DB_PASSWORD';"
Terminal window
sudo -u postgres psql -c "CREATE DATABASE thingsboard;"

Add the database configuration to the ThingsBoard configuration file:

Terminal window
sudo tee -a /etc/thingsboard/conf/thingsboard.conf > /dev/null << EOF
# 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=$TB_DB_PASSWORD
EOF

ThingsBoard uses a message queue to route messages between its internal services. Select the option that matches your infrastructure:

  • In Memory (default) — built-in queue, no extra setup required. Suitable for development and PoC. Not recommended for production or multi-node deployments.
  • Kafka — high-throughput, durable queue. Run it yourself or use a managed service such as AWS MSK.
  • Confluent Cloud — fully managed Kafka service. Use this if you want Kafka without managing the infrastructure yourself.

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

By default, ThingsBoard has no explicit memory limit — the JVM can consume all available RAM, which may cause the OS to kill the process under memory pressure. Set the heap size to half of your total RAM. The values below are approximate and suited for a single-node setup with In Memory queue and PostgreSQL database:

Terminal window
sudo tee -a /etc/thingsboard/conf/thingsboard.conf > /dev/null << 'EOF'
# Maximum heap size — set to half of available RAM.
# Example: 2G for a 4 GB server, 4G for an 8 GB server, 8G for a 16 GB server.
export JAVA_OPTS="$JAVA_OPTS -Xms4G -Xmx4G -Xss512k -XX:+AlwaysPreTouch"
EOF

We recommend adjusting these parameters depending on your server resources. It should be set to at least 2G (gigabytes), and increased accordingly if there is additional RAM space available. Usually, you need to set it to 1/2 of your total RAM if you do not run any other memory-intensive processes (e.g. Cassandra), or to 1/3 otherwise.

Run the installation script to initialize the database schema and load default system data. Choose the option that matches your goal:

  • With demo data — also loads a sample tenant account, pre-built dashboards, and demo devices. Useful for exploring the platform before deploying to production.
  • Clean install — initializes the database with system data only (rule chains, widget bundles, system dashboards).
Terminal window
sudo /usr/share/thingsboard/bin/install/install.sh --loadDemo

Start the ThingsBoard service:

Terminal window
sudo systemctl start thingsboard

Monitor the startup. The line confirming the platform is ready will be highlighted:

Terminal window
tail -f /var/log/thingsboard/thingsboard.log | grep --line-buffered --color=always -E 'Started ThingsboardServerApplication|$'

Open the following ports in your firewall:

PortProtocolDescription
8080TCPWeb UI and REST API. Not required if using a load balancer.
1883TCPMQTT
8883TCPMQTT over SSL
5683UDPCoAP
5684UDPCoAP over DTLS
5685UDPLwM2M CoAP
5686UDPLwM2M CoAP over DTLS
5687UDPLwM2M (Bootstrap)
5688UDPLwM2M over DTLS (Bootstrap)
161UDPSNMP
7070TCPEdge RPC (gRPC)
9090TCPRemote Integration Executor (gRPC)

Open http://localhost:8080 in your browser (or http://<your-server-ip>:8080 if accessing remotely). You should see the ThingsBoard login page. Use the following default credentials:

RoleEmailPasswordWith demo dataClean install
System Administrator[email protected]sysadmin
Tenant Administrator[email protected]tenant
Customer User[email protected]customer

See Getting Started for your next steps after login.

Step 9. Install ThingsBoard WebReport component

Section titled “Step 9. Install ThingsBoard WebReport component”

The WebReport service generates PDF and PNG reports from dashboards. Choose one of the installation methods below:

Install Docker: see Docker for Ubuntu.

Create the Docker Compose file ~/thingsboard/tb-web-report.yml:

Terminal window
mkdir -p ~/thingsboard
Terminal window
sudo tee ~/thingsboard/tb-web-report.yml > /dev/null << 'EOF'
services:
tb-web-report:
container_name: tb-web-report
restart: always
image: "thingsboard/tb-pe-web-report:4.3.1.1PE"
ports:
- "8383:8383"
environment:
HTTP_BIND_ADDRESS: "0.0.0.0"
HTTP_BIND_PORT: "8383"
LOGGER_LEVEL: "info"
LOG_FOLDER: "logs"
LOGGER_FILENAME: "tb-web-report-%DATE%.log"
DOCKER_MODE: "true"
DEFAULT_PAGE_NAVIGATION_TIMEOUT: "120000"
DASHBOARD_IDLE_WAIT_TIME: "3000"
USE_NEW_PAGE_FOR_REPORT: "true"
EOF

Start the WebReport service:

Terminal window
docker compose -f ~/thingsboard/tb-web-report.yml up -d

Check the container logs:

Terminal window
docker logs -f tb-web-report

You may want to configure HTTPS access using HAProxy. This is possible if you are hosting ThingsBoard in the cloud and have a valid DNS name assigned to your instance.

See Configure HAProxy on Ubuntu for instructions on installing HAProxy and generating a valid SSL certificate using Let’s Encrypt.

See the Upgrade Instructions for detailed steps.

Check the service status:

Terminal window
sudo systemctl status thingsboard

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

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

Monitor logs in real time:

Terminal window
tail -f /var/log/thingsboard/thingsboard.log

Or via journalctl:

Terminal window
sudo journalctl -u thingsboard.service -f --no-pager

For more troubleshooting tips, see the Troubleshooting guide.