Skip to content
Stand with Ukraine flag

Installing ThingsBoard CE on CentOS/RHEL

This guide covers installing ThingsBoard Community Edition (CE) on CentOS/RHEL Server. By the end, you will have a fully functional ThingsBoard instance up and running.

RHEL 8/9/10, CentOS 8/9, or derivatives (AlmaLinux, Rocky Linux, Oracle Linux, etc.)

Ensure your server meets the minimum requirements:

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

Install required tools. Choose your OS version:

Terminal window
sudo dnf install -y wget
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

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

Terminal window
sudo dnf install -y java-21-openjdk-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/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

Download and install the ThingsBoard CE 4.3.1.1 package.

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

Verify the installation:

Terminal window
rpm -qa | grep thingsboard

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 the PostgreSQL repository 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 and start PostgreSQL 18:

Terminal window
sudo dnf -qy module disable postgresql
sudo dnf -y install postgresql18 postgresql18-server postgresql18-contrib
sudo /usr/pgsql-18/bin/postgresql-18-setup initdb
sudo systemctl enable --now postgresql-18

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)

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.

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 CentOS/RHEL 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.