Installing ThingsBoard Edge on Raspberry Pi
This guide provides step-by-step instructions for installing ThingsBoard Edge on Raspberry Pi.
Prerequisites
Section titled “Prerequisites”To run ThingsBoard Edge, you need an active ThingsBoard account that supports Edge functionality.
You can use ThingsBoard Cloud or install a local ThingsBoard server.
Hardware requirements
Section titled “Hardware requirements”The hardware requirements for ThingsBoard Edge depend on the number of connected devices and platform interaction intensity.
| Workload | RAM | Description |
|---|---|---|
| Light | 1 GB | Fewer than 100 devices, minimal dashboard/device management usage |
| Heavy | 4 GB | 100+ devices or intense platform interactions |
Deploy a new Edge instance
Section titled “Deploy a new Edge instance”To create a new Edge instance on your ThingsBoard Server:
- Log in to your ThingsBoard server and go to Edge management > Edges. Click Add edge and select Add new edge.
Enter a name for the Edge, like My New Edge.
If needed, update the Cloud endpoint (the field is shown only for Edges with legacy v1 licensing). If Edge runs in a Docker container, do not uselocalhost— use the IP address of the machine where ThingsBoard is hosted (e.g.,http://10.7.2.143:8080). If you use ThingsBoard Cloud, keep the default. Click Add.- Your new Edge instance appears at the top of the list, and the Edge created dialog opens with ready-to-use installation instructions (unless Do not show again was turned on earlier).
Guided installation using ThingsBoard Server instructions
Section titled “Guided installation using ThingsBoard Server instructions”The instructions generated by the server already contain the credentials of this Edge (Edge key and Edge secret), so this is the fastest way to install it. If you closed the dialog, open the instructions again:
- Click the Edge to open its details.
- On the Details tab, click Install & Connect Instructions.
- Select the Docker, Ubuntu, or CentOS/RHEL tab and follow the instructions to install Edge and connect it to the server. The dialog opens on the Agent tab, which is for remote installation with a Remote Agent.
Manual installation and configuration
Section titled “Manual installation and configuration”If you are unable to use the guided instructions above, follow the steps below to install and configure Edge manually.
Step 1. Install Java (OpenJDK)
Section titled “Step 1. Install Java (OpenJDK)”ThingsBoard Edge requires Java 25. To install OpenJDK 25:
OpenJDK 25 is available on Raspberry Pi OS based on Debian 13 (Trixie) and later.
sudo apt update && sudo apt install openjdk-25-jdk-headlessConfigure your operating system to use OpenJDK 25 by default:
sudo update-alternatives --config javaVerify the installation:
java -versionThe expected output:
openjdk version "25.x.xx"OpenJDK Runtime Environment (...)OpenJDK 64-Bit Server VM (...)Step 2. Download and install ThingsBoard Edge
Section titled “Step 2. Download and install ThingsBoard Edge”wget https://github.com/thingsboard/thingsboard-edge/releases/download/v4.4.0.2/tb-edge-4.4.0.2.debsudo dpkg -i tb-edge-4.4.0.2.debStep 3. Configure the ThingsBoard Edge database
Section titled “Step 3. Configure the ThingsBoard Edge database”ThingsBoard Edge uses PostgreSQL as its local database.
Install PostgreSQL:
# Automated repository configuration:sudo apt install -y postgresql-commonsudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
# Install and start PostgreSQL:sudo apt updatesudo apt -y install postgresqlsudo service postgresql startSet the password for the main PostgreSQL user:
sudo -u postgres psql -c "\password"Enter and confirm the password when prompted.
Create a new PostgreSQL database named tb_edge:
echo "CREATE DATABASE tb_edge;" | psql -U postgres -d postgres -h 127.0.0.1 -WAdd the database connection settings to the ThingsBoard Edge configuration file:
sudo bash -c 'cat >> /etc/tb-edge/conf/tb-edge.conf <<EOLexport DATABASE_TS_TYPE=sqlexport SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/tb_edgeexport SPRING_DATASOURCE_USERNAME=postgresexport SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HEREexport SQL_POSTGRES_TS_KV_PARTITIONING=MONTHSEOL'Replace PUT_YOUR_POSTGRESQL_PASSWORD_HERE with your actual PostgreSQL password.
SQL_POSTGRES_TS_KV_PARTITIONING sets the partitioning interval for time-series storage. Allowed values: DAYS, MONTHS, YEARS, INDEFINITE.
Step 4. Configure ThingsBoard Edge
Section titled “Step 4. Configure ThingsBoard Edge”On the server, open the Edge and click Copy Edge key and Copy Edge secret on its Details tab. Store these values securely. You need them below.
Edit the ThingsBoard Edge configuration file to set your Edge credentials and cloud connection parameters.
Use this configuration to connect to ThingsBoard Cloud hosted in North America.
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.confexport CLOUD_ROUTING_KEY=PUT_YOUR_EDGE_KEY_HEREexport CLOUD_ROUTING_SECRET=PUT_YOUR_EDGE_SECRET_HEREexport CLOUD_RPC_HOST=thingsboard.cloudexport CLOUD_RPC_PORT=7070export CLOUD_RPC_SSL_ENABLED=trueEOL'Use this configuration to connect to ThingsBoard Cloud hosted in Europe.
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.confexport CLOUD_ROUTING_KEY=PUT_YOUR_EDGE_KEY_HEREexport CLOUD_ROUTING_SECRET=PUT_YOUR_EDGE_SECRET_HEREexport CLOUD_RPC_HOST=eu.thingsboard.cloudexport CLOUD_RPC_PORT=7070export CLOUD_RPC_SSL_ENABLED=trueEOL'Use this configuration to connect to a self-hosted ThingsBoard server on your local network.
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.confexport CLOUD_ROUTING_KEY=PUT_YOUR_EDGE_KEY_HEREexport CLOUD_ROUTING_SECRET=PUT_YOUR_EDGE_SECRET_HEREexport CLOUD_RPC_HOST=PUT_YOUR_RPC_HOSTexport CLOUD_RPC_PORT=7070export CLOUD_RPC_SSL_ENABLED=falseEOL'If Edge runs on the same machine as ThingsBoard Server, also move the Edge ports so they don’t conflict with the server’s:
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.confexport HTTP_BIND_PORT=18080export MQTT_BIND_PORT=11883export COAP_BIND_PORT=15683export LWM2M_ENABLED=falseexport SNMP_ENABLED=falseexport INTEGRATIONS_RPC_PORT=19090EOL'Configuration parameters:
| Parameter | Description |
|---|---|
CLOUD_ROUTING_KEY | Your Edge key (copied above) |
CLOUD_ROUTING_SECRET | Your Edge secret (copied above) |
CLOUD_RPC_HOST | Hostname or IP address of the ThingsBoard Server |
CLOUD_RPC_PORT | gRPC port used for Edge–server communication (default: 7070) |
CLOUD_RPC_SSL_ENABLED | Set to true to enable SSL — required when connecting to ThingsBoard Cloud |
INTEGRATIONS_RPC_PORT | Port on which Edge accepts connections from remote integrations (default: 9090). Change it only if Edge runs on the same machine as ThingsBoard Server |
Step 5. [Optional] Tune JVM memory for low-memory devices
Section titled “Step 5. [Optional] Tune JVM memory for low-memory devices”On devices with limited RAM, you can constrain the JVM heap size to prevent out-of-memory issues:
echo 'export JAVA_OPTS="$JAVA_OPTS -Xms512M -Xmx1G"' | sudo tee -a /etc/tb-edge/conf/tb-edge.conf| Parameter | Description |
|---|---|
-Xms512M |
Initial JVM heap size — 512 MB |
-Xmx1G |
Maximum JVM heap size — 1 GB |
Adjust these values based on available RAM. A good rule of thumb: set -Xmx to half the total RAM if ThingsBoard Edge is the only memory-intensive process, or one-third if other services are also running.
Step 6. Complete the installation
Section titled “Step 6. Complete the installation”Once ThingsBoard Edge is installed and configured, execute the installation script:
sudo /usr/share/tb-edge/bin/install/install.shStart the ThingsBoard Edge service:
sudo service tb-edge startOnce the service is running, open the Edge UI at http://localhost:8080 (port 18080 if you moved the Edge ports), or replace localhost with your Raspberry Pi’s local IP address if accessing from another device on the network.
Log in using your tenant credentials from ThingsBoard Server or ThingsBoard Cloud. To check the connection, go to Edge > Status in the Edge UI. The status is Connected.
Troubleshooting
Section titled “Troubleshooting”ThingsBoard Edge logs are stored in:
/var/log/tb-edgeTo check for errors:
cat /var/log/tb-edge/tb-edge.log | grep ERRORService management
Section titled “Service management”To stop the ThingsBoard Edge service:
sudo service tb-edge stopTo restart the ThingsBoard Edge service:
sudo service tb-edge restartTo check the status of the ThingsBoard Edge service:
sudo service tb-edge statusWas this helpful?