Skip to content
Stand with Ukraine flag

Installing ThingsBoard Edge on CentOS/RHEL

This guide provides step-by-step instructions for installing ThingsBoard Edge on RHEL/CentOS 8 and RHEL/CentOS 9.

To run ThingsBoard Edge, you need an active ThingsBoard Community Edition account that supports Edge functionality.

You can install a local ThingsBoard CE server. The local server is accessible at http://localhost:8080.

The hardware requirements for ThingsBoard Edge depend on the number of connected devices and platform interaction intensity.

WorkloadRAMDescription
Light1 GBFewer than 100 devices, minimal dashboard/device management usage
Heavy4 GB100+ devices or intense platform interactions

To create a new Edge instance on your ThingsBoard Server:

  1. Sign in to your ThingsBoard instance and go to Edge Management → Instances. Click Add (+) in the top-right corner and select Add new edge.
  2. Enter a name for the Edge, like My New Edge.

    Click Add.
  3. Your new Edge instance is created and appears at the top of the list.

Guided installation using ThingsBoard Server instructions

Section titled “Guided installation using ThingsBoard Server instructions”

Once an Edge instance is created, the server generates pre-configured installation instructions containing the Edge credentials (Edge Key, Edge Secret, etc.). To access them:

  1. Click the Edge entity to open its details.
  2. Click Install & Connection Instructions.
  3. Select the installation method and follow the instructions to install Edge and connect it to the server.

If you are unable to use the guided instructions above, follow the steps below to install and configure Edge manually.

Install the required tools:

Terminal window
sudo yum install -y nano wget && sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Step 1. Configure the ThingsBoard Edge database

Section titled “Step 1. Configure the ThingsBoard Edge database”

ThingsBoard Edge supports SQL and hybrid database approaches.

PostgreSQL is recommended for development and production environments with moderate load (fewer than 5,000 messages/sec). Many cloud providers offer managed PostgreSQL services, making it a cost-effective option for most deployments.

Update your system:

Terminal window
sudo dnf update

Install the PostgreSQL repository RPM for your OS version:

Terminal window
sudo dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Install PostgreSQL and initialize the database. The PostgreSQL service will start automatically on system boot:

Terminal window
sudo dnf -qy module disable postgresql && \
sudo dnf -y install postgresql16 postgresql16-server postgresql16-contrib && \
sudo /usr/pgsql-16/bin/postgresql-16-setup initdb && \
sudo systemctl enable --now postgresql-16

Set the password for the main PostgreSQL user:

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

Enter and confirm the password when prompted.

Configure MD5 authentication for local connections, then restart PostgreSQL and create the tb_edge database:

Terminal window
sudo sed -i 's/^host\s\+all\s\+all\s\+127\.0\.0\.1\/32\s\+ident/host all all 127.0.0.1\/32 md5/' /var/lib/pgsql/16/data/pg_hba.conf
sudo systemctl restart postgresql-16.service && psql -U postgres -d postgres -h 127.0.0.1 -W -c "CREATE DATABASE tb_edge;"

ThingsBoard Edge can use different messaging systems for storing messages and enabling communication between its services.

The In Memory queue is the built-in default implementation. It is suitable for development or proof-of-concept environments, but is not recommended for production or clustered deployments due to limited scalability.

No additional configuration is required.

Step 3. Download and install ThingsBoard Edge

Section titled “Step 3. Download and install ThingsBoard Edge”
Terminal window
wget https://github.com/thingsboard/thingsboard-edge/releases/download/v4.3.1.1/tb-edge-4.3.1.1.rpm
sudo rpm -Uvh tb-edge-4.3.1.1.rpm

ThingsBoard Edge requires Java 17. To install OpenJDK 17:

Terminal window
sudo dnf install java-17-openjdk-headless

Configure your operating system to use OpenJDK 17 by default:

Terminal window
sudo update-alternatives --config java

Verify the installation:

Terminal window
java -version

The expected output:

openjdk version "17.x.xx"
OpenJDK Runtime Environment (...)
OpenJDK 64-Bit Server VM (build ...)

In the Edge instance details panel, click Copy Edge Key and Copy Edge Secret. Store these values — you need them in the next step.

Edit the ThingsBoard Edge configuration file to set your Edge credentials and cloud connection parameters.

Terminal window
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf
export CLOUD_ROUTING_KEY=PUT_YOUR_EDGE_KEY_HERE
export CLOUD_ROUTING_SECRET=PUT_YOUR_EDGE_SECRET_HERE
export CLOUD_RPC_HOST=PUT_YOUR_RPC_HOST
export CLOUD_RPC_PORT=7070
export CLOUD_RPC_SSL_ENABLED=false
export HTTP_BIND_PORT=18080
export MQTT_BIND_PORT=11883
export COAP_BIND_PORT=15683
export LWM2M_ENABLED=false
export SNMP_ENABLED=false
EOL'

Configuration parameters:

ParameterDescription
CLOUD_ROUTING_KEYYour Edge key (copied above)
CLOUD_ROUTING_SECRETYour Edge secret (copied above)
CLOUD_RPC_HOSTHostname or IP address of the ThingsBoard Server
CLOUD_RPC_PORTgRPC port used for Edge–server communication (default: 7070)
CLOUD_RPC_SSL_ENABLEDSet to true to enable SSL — required when connecting to ThingsBoard Cloud
HTTP_BIND_PORTLocal HTTP port for the Edge UI (18080 avoids conflict with ThingsBoard Server on 8080)
MQTT_BIND_PORTLocal MQTT port (11883 avoids conflict with ThingsBoard Server on 1883)
COAP_BIND_PORTLocal CoAP port (15683 avoids conflict with ThingsBoard Server on 5683)

Once ThingsBoard Edge is installed and configured, execute the installation script:

Terminal window
sudo /usr/share/tb-edge/bin/install/install.sh

Start the ThingsBoard Edge service:

Terminal window
sudo service tb-edge start

Once the service is running, open the Edge UI at http://localhost:8080.

Log in using the same default credentials listed in the Prerequisites section. You can change them in the Edge UI after logging in.

ThingsBoard Edge logs are stored in:

Terminal window
/var/log/tb-edge

To check for errors:

Terminal window
cat /var/log/tb-edge/tb-edge.log | grep ERROR

To stop the ThingsBoard Edge service:

Terminal window
sudo service tb-edge stop

To restart the ThingsBoard Edge service:

Terminal window
sudo service tb-edge restart

To check the status of the ThingsBoard Edge service:

Terminal window
sudo service tb-edge status