Cluster setup using OpenShift
This guide walks you through setting up ThingsBoard in cluster mode using OpenShift with a microservices architecture. Licensing is free and requires no credit card. Docker container images are available on Docker Hub.
For a simpler single-node installation, see Docker (Linux, macOS).
Prerequisites
Section titled “Prerequisites”ThingsBoard microservices run on a Kubernetes cluster. To deploy an OpenShift cluster locally you need Docker CE and OpenShift Origin. Follow these instructions to install all required software.
You’ll also need outbound internet access to pull Docker images and to reach the ThingsBoard License Portal during activation.
Log in to OpenShift Cluster
Section titled “Log in to OpenShift Cluster”By default, you can log in as the developer user:
oc login -u developer -p developerCreate Project
Section titled “Create Project”On first start-up, create the thingsboard project:
oc new-project thingsboardPull ThingsBoard Images
Section titled “Pull ThingsBoard Images”Verify that you can pull the images from Docker Hub:
docker pull thingsboard/tb-node:4.4.0docker pull thingsboard/tb-web-report:4.4.0docker pull thingsboard/tb-web-ui:4.4.0docker pull thingsboard/tb-js-executor:4.4.0docker pull thingsboard/tb-http-transport:4.4.0docker pull thingsboard/tb-mqtt-transport:4.4.0docker pull thingsboard/tb-coap-transport:4.4.0docker pull thingsboard/tb-lwm2m-transport:4.4.0docker pull thingsboard/tb-snmp-transport:4.4.0Step 1. Clone ThingsBoard Kubernetes Scripts
Section titled “Step 1. Clone ThingsBoard Kubernetes Scripts”git clone -b release-4.4.0 https://github.com/thingsboard/thingsboard-pe-k8s.git --depth 1cd thingsboard-pe-k8s/openshiftStep 2. Configure Database
Section titled “Step 2. Configure Database”Edit the .env file to set the database type:
nano .envSet the DATABASE variable to one of:
| Value | Description |
|---|---|
postgres |
Use PostgreSQL for all data |
hybrid |
Use PostgreSQL for entities and Cassandra for time-series data |
Step 3. Configure Trendz Analytics (Optional)
Section titled “Step 3. Configure Trendz Analytics (Optional)”You may optionally install Trendz Analytics.
Pull Trendz Images
Section titled “Pull Trendz Images”docker pull thingsboard/trendz:1.16.0docker pull thingsboard/trendz-python-executor:1.16.0Create Trendz Database
Section titled “Create Trendz Database”Edit trendz/trendz-secret.yml and replace YOUR_RDS_ENDPOINT_URL and YOUR_RDS_PASSWORD, then apply:
kubectl apply -f ./trendz/trendz-secret.ymlkubectl apply -f ./trendz/trendz-create-db.ymlCheck the logs:
kubectl logs job/trendz-create-db -n thingsboardDeploy Trendz
Section titled “Deploy Trendz”./k8s-deploy-trendz.shYou should see Trendz installed successfully! in the console output.
Step 4. Install and Start ThingsBoard
Section titled “Step 4. Install and Start ThingsBoard”-
Run the installation script:
Terminal window ./k8s-install-tb.sh -
Deploy third-party resources:
Terminal window ./k8s-deploy-thirdparty.shType yes when prompted if you are running ThingsBoard in
high-availabilitydeployment type for the first time or don’t have a configured Redis cluster. -
Deploy ThingsBoard resources:
Terminal window ./k8s-deploy-resources.sh
Access ThingsBoard Web UI
Section titled “Access ThingsBoard Web UI”To find your ThingsBoard application URL, log in as the developer user (default password: developer), open the thingsboard project, then navigate to Application ⇾ Routes. The root route should look like https://tb-route-node-root-thingsboard.127.0.0.1.nip.io/.
Open that URL in your browser. On 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 5. License and Activate Your Instance
Section titled “Step 5. 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 6. Create Your Administrator Account
Section titled “Step 6. 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.
Inspect Logs and Manage Resources
Section titled “Inspect Logs and Manage Resources”List running ThingsBoard node pods:
oc get pods -l app=tb-nodeStream logs of a specific pod:
oc logs -f TB_NODE_POD_NAMEReplace TB_NODE_POD_NAME with the pod name from the list above.
Other useful commands:
| Command | Description |
|---|---|
oc get pods |
List all pods |
oc get services |
List all services |
oc get deployments |
List all deployments |
See the oc Cheat Sheet for more commands.
Troubleshooting
Section titled “Troubleshooting”For log-inspection commands, see Inspect Logs and Manage Resources above.
For more troubleshooting tips, see the Troubleshooting guide.
Cluster Deletion
Section titled “Cluster Deletion”Delete ThingsBoard microservices:
./k8s-delete-resources.shDelete third-party services:
./k8s-delete-thirdparty.shDelete all resources including database:
./k8s-delete-all.shNext 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?