Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors

Oracle Cloud OKE Microservices Setup

This guide walks you through deploying ThingsBoard in microservices mode on Oracle Container Engine for Kubernetes (OKE). Terraform provisions the network, the OKE cluster, OCI Database with PostgreSQL, and an OCI Vault for the credentials. Kafka runs in the cluster under the Strimzi operator and Cassandra (optional) under K8ssandra. External Secrets Operator copies the credentials from the Vault into Kubernetes, and all device and user traffic enters through NGINX Gateway Fabric behind a single OCI network load balancer.

Install kubectl, Helm, Terraform 1.5 or later, and the OCI CLI.

Configure the OCI CLI with an API signing key for your user. The command creates the DEFAULT profile in ~/.oci/config:

Terminal window
oci setup config

Alternatively, sign in through the browser with a session token. Then set auth = "SecurityToken" and config_file_profile = "thingsboard" in Step 2, and export the profile so that the OCI CLI and kubectl use it:

Terminal window
oci session authenticate --region YOUR_OCI_REGION --profile-name thingsboard
export OCI_CLI_PROFILE=thingsboard
export OCI_CLI_AUTH=security_token

Repeat both export commands in every new terminal. A session token expires after one hour, and this guide takes longer. Renew the token before it expires, for example right before terraform apply:

Terminal window
oci session refresh --profile thingsboard

Verify access:

Terminal window
oci iam region list --output table

Verify that you can pull the images from Docker Hub:

Terminal window
docker pull thingsboard/tb-node:4.4.1
docker pull thingsboard/tb-web-report:4.4.1
docker pull thingsboard/tb-web-ui:4.4.1
docker pull thingsboard/tb-js-executor:4.4.1
docker pull thingsboard/tb-http-transport:4.4.1
docker pull thingsboard/tb-mqtt-transport:4.4.1
docker pull thingsboard/tb-coap-transport:4.4.1
docker pull thingsboard/tb-lwm2m-transport:4.4.1
docker pull thingsboard/tb-snmp-transport:4.4.1
docker pull thingsboard/tb-integration-executor:4.4.1

Step 1. Clone ThingsBoard K8S Scripts Repository

Section titled “Step 1. Clone ThingsBoard K8S Scripts Repository”

Clone the repository containing the Kubernetes deployment scripts:

Terminal window
git clone -b release-4.4.1 https://github.com/thingsboard/thingsboard-pe-k8s.git --depth 1
cd thingsboard-pe-k8s/oci/microservices

Step 2. Provision the Infrastructure with Terraform

Section titled “Step 2. Provision the Infrastructure with Terraform”

The infrastructure folder contains the Terraform configuration. Edit infrastructure/terraform.tfvars. Key fields:

Field Default Description
region — OCI region identifier, for example eu-frankfurt-1
tenancy_ocid — OCID of your tenancy
compartment_ocid tenancy root Compartment for all resources
config_file_profile, auth DEFAULT, APIKey OCI CLI profile and authentication method
cluster_name thingsboard Prefix for every resource name
kubernetes_version — Exact OKE version, for example v1.36.4
api_allowed_cidrs ["0.0.0.0/0"] Addresses allowed to reach the Kubernetes API
tb_node_pool 3 × VM.Standard.E5.Flex, 2 OCPUs, 16 GB Nodes for ThingsBoard, Kafka, ZooKeeper, and Valkey
cassandra_enabled false Adds three Cassandra nodes; see Step 7
cassandra_backups_enabled true Adds an Object Storage bucket for Cassandra backups
service_user_email_domain — Required for Cassandra backups: the email domain of the service user that writes them
trendz_enabled false Adds a node for Trendz Analytics
postgres_instance_count 2 PostgreSQL nodes; a second node takes over on failure

List the Kubernetes versions OKE supports:

Terminal window
oci ce cluster-options get --cluster-option-id all --query 'data."kubernetes-versions"'

Create the infrastructure. It takes about 30 minutes:

Terminal window
cd infrastructure
terraform init
terraform apply
cd ..

Terraform creates:

  • A VCN with public subnets for the Kubernetes API and the load balancer, and private subnets for the worker nodes and the database.
  • An enhanced OKE cluster with Kubernetes secrets encrypted by a Vault key, and its node pools.
  • An OCI Database with PostgreSQL system. Its connection details are stored in the Vault as the postgres secret.
  • An OCI Vault and the IAM policy that lets External Secrets Operator read it through OKE Workload Identity.
  • A reserved public IP address for the gateway.
  • With Cassandra backups: an Object Storage bucket and a service user limited to it.

Add the cluster to your kubeconfig:

Terminal window
oci ce cluster create-kubeconfig \
--cluster-id $(terraform -chdir=infrastructure output -raw cluster_id) \
--region $(terraform -chdir=infrastructure output -raw region) \
--token-version 2.0.0 --kube-endpoint PUBLIC_ENDPOINT
kubectl get nodes

Install cert-manager, External Secrets Operator, Strimzi, and NGINX Gateway Fabric with the Gateway API resources. Add --with-cassandra to also install the K8ssandra operator if you set cassandra_enabled = true:

Terminal window
./k8s-install-operators.sh

After this command finishes you should see:

Operators installed successfully!

Step 5. Connect External Secrets to OCI Vault

Section titled “Step 5. Connect External Secrets to OCI Vault”

Create the secret store for the Vault:

Terminal window
export VAULT_ID=$(terraform -chdir=infrastructure output -raw vault_id)
export OCI_REGION=$(terraform -chdir=infrastructure output -raw region)
sed -e "s|YOUR_VAULT_OCID|${VAULT_ID}|" -e "s|YOUR_OCI_REGION|${OCI_REGION}|" \
external-secrets/cluster-secret-store.yml | kubectl apply -f -
kubectl get clustersecretstore oci-vault

The store should report STATUS Valid and READY True. Then sync the PostgreSQL connection into the postgres Kubernetes secret:

Terminal window
kubectl apply -f external-secrets/postgres.yml
kubectl -n thingsboard get externalsecret postgres

The STATUS column should show SecretSynced.

We assume you have already chosen your subscription plan or decided to purchase a perpetual license. If not, navigate to the pricing page.

Store the license key in the Vault and sync it into the tb-license Kubernetes secret:

Terminal window
export TB_LICENSE_KEY=PUT_YOUR_LICENSE_KEY_HERE
oci vault secret create-base64 \
--compartment-id $(terraform -chdir=infrastructure output -raw compartment_id) \
--vault-id $(terraform -chdir=infrastructure output -raw vault_id) \
--key-id $(terraform -chdir=infrastructure output -raw vault_key_id) \
--secret-name tb-license \
--secret-content-content "$(printf '%s' "$TB_LICENSE_KEY" | base64 | tr -d '\n')"
kubectl apply -f external-secrets/tb-license.yml

Using Cassandra is optional. We recommend it if you plan to insert more than 5K data points per second or want to optimize storage space. It requires cassandra_enabled = true in Step 2 and the --with-cassandra option in Step 4.

Deploy a three-node Cassandra datacenter, one node per Cassandra node pool, with daily backups to the bucket created by Terraform:

Terminal window
kubectl apply -f external-secrets/cassandra-backups.yml
sed -e "s|YOUR_BACKUP_BUCKET|$(terraform -chdir=infrastructure output -raw cassandra_backup_bucket)|" \
-e "s|YOUR_MEDUSA_HOST|$(terraform -chdir=infrastructure output -raw medusa_host)|" \
-e "s|YOUR_OCI_REGION|$(terraform -chdir=infrastructure output -raw region)|" \
cassandra/k8ssandra-cluster.yml | kubectl apply -f -
kubectl apply -f cassandra/medusa-backup-schedule.yml

Wait until the datacenter is ready. The first start takes about 15 minutes:

Terminal window
kubectl -n thingsboard wait cassandradatacenter/dc1 --for=condition=Ready --timeout=30m

Create the ThingsBoard keyspace:

Terminal window
CASS_USERNAME=$(kubectl -n thingsboard get secret cassandra-superuser -o jsonpath='{.data.username}' | base64 --decode)
CASS_PASSWORD=$(kubectl -n thingsboard get secret cassandra-superuser -o jsonpath='{.data.password}' | base64 --decode)
kubectl -n thingsboard exec cassandra-dc1-r1-sts-0 -c cassandra -- cqlsh -u "$CASS_USERNAME" -p "$CASS_PASSWORD" -e \
"CREATE KEYSPACE IF NOT EXISTS thingsboard WITH replication = {'class': 'NetworkTopologyStrategy', 'dc1': 3};"

Edit tb-node-db-configmap.yml and set DATABASE_TS_TYPE to cassandra.

Step 8. CPU and Memory Resources Allocation

Section titled “Step 8. CPU and Memory Resources Allocation”

The scripts have preconfigured values of resources for each service. You can change them in .yml files under the resources section.

Preconfigured resources per pod:

Service Pods CPU request / limit Memory request / limit
TB Node 1 1000m / 1000m 1000Mi / 3000Mi
TB Integration Executor 1 1000m / 1000m 1000Mi / 2000Mi
TB Web UI 2 100m / 100m 100Mi / 100Mi
TB Web Report 1 100m / 100m 500Mi / 500Mi
JS Executor 5 100m / 100m 100Mi / 400Mi
Each transport (HTTP, MQTT, CoAP, LwM2M, SNMP) 2 500m / 1000m 500Mi / 2000Mi
Valkey 1 100m / 500m 400Mi / 400Mi
Kafka 3 200m / 2000m 1500Mi / 1500Mi
ZooKeeper 3 100m / 300m 500Mi / 1000Mi
NGINX Gateway 2 50m / 1000m 200Mi / 1000Mi
Cassandra (optional) 3 500m / 2000m 6Gi / 6Gi
Trendz (optional) 1 2000m / 2000m 4000Mi / 4000Mi
Trendz Python Executor (optional) 1 1000m / 1000m 4000Mi / 4000Mi

Execute the following command to start ZooKeeper, Valkey, and a three-broker Kafka cluster, create the thingsboard database, and run the initial setup of the database:

Terminal window
./k8s-install-tb.sh

After this command finishes you should see:

Installation finished successfully!

Deploy ThingsBoard services:

Terminal window
./k8s-deploy-resources.sh

After a few minutes, call kubectl get pods. If everything went fine, you should see:

  • 5x tb-js-executor
  • 1x tb-node (scale to more nodes if you have additional license instances)
  • 1x tb-integration-executor
  • 2x tb-web-ui
  • 1x tb-web-report
  • 1x tb-valkey
  • 3x tb-kafka
  • 3x zookeeper

Every pod should be in the READY state. The namespace also runs the Strimzi operator and, with Cassandra, the K8ssandra operators and the Cassandra pods.

Deploy the transport microservices you need. Omit protocols you don’t use to save resources:

Terminal window
# HTTP Transport (optional)
kubectl apply -f transports/tb-http-transport.yml
# MQTT Transport (optional)
kubectl apply -f transports/tb-mqtt-transport.yml
# CoAP Transport (optional)
kubectl apply -f transports/tb-coap-transport.yml
# LwM2M Transport (optional)
kubectl apply -f transports/tb-lwm2m-transport.yml
# SNMP Transport (optional)
kubectl apply -f transports/tb-snmp-transport.yml

A single gateway serves every protocol on the reserved IP address from Step 2. Create its load balancer settings first, because the reserved address is only read when the load balancer is created:

Terminal window
export INGRESS_IP=$(terraform -chdir=infrastructure output -raw ingress_ip_address)
sed "s|YOUR_INGRESS_IP|${INGRESS_IP}|" gateway/nginx-proxy.yml | kubectl apply -f -
kubectl apply -f gateway/gateway.yml
kubectl -n thingsboard get gateway tb-gateway

After a few minutes the gateway reports PROGRAMMED True with the reserved IP address in the ADDRESS column.

You have 2 options:

  • HTTP — recommended for development. Works with the IP address only.
  • HTTPS — recommended for production. Requires a domain name and uses a free Let’s Encrypt certificate.
Terminal window
kubectl apply -f gateway/routes/http.yml

Use http:// followed by the reserved IP address to access the web UI, and connect devices via HTTP API.

Administrator account creation on first access is covered next, in Step 12. Create Your Administrator Account.

Terminal window
kubectl apply -f gateway/routes/mqtt.yml

The gateway forwards TCP traffic on ports 1883 and 8883 to the MQTT transport.

To enable MQTT over TLS on port 8883, complete the HTTPS option of Step 11.1 first. Then uncomment the sections marked “Uncomment the following lines to enable MQTTS” in transports/tb-mqtt-transport.yml and apply it again:

Terminal window
kubectl apply -f transports/tb-mqtt-transport.yml

The MQTT transport then uses the certificate issued for your domain. See MQTT over TLS for the client configuration.

11.3 Configure CoAP and LwM2M Access (Optional)

Section titled “11.3 Configure CoAP and LwM2M Access (Optional)”
Terminal window
kubectl apply -f gateway/routes/coap.yml
kubectl apply -f gateway/routes/lwm2m.yml

The gateway forwards UDP traffic on these ports:

Port Protocol
5683 CoAP non-secure
5684 CoAP secure DTLS
5685 LwM2M non-secure
5686 LwM2M secure DTLS
5687 LwM2M bootstrap non-secure
5688 LwM2M bootstrap secure DTLS

For CoAP over DTLS, follow the CoAP over DTLS guide. For LwM2M over DTLS, follow the LwM2M over DTLS guide.

Terminal window
kubectl apply -f gateway/routes/edge.yml

The gateway forwards TCP traffic on port 7070 to ThingsBoard. Use the reserved IP address as CLOUD_RPC_HOST in Edge connection parameters.

11.5 Configure Remote Integrations Access (Optional)

Section titled “11.5 Configure Remote Integrations Access (Optional)”
Terminal window
kubectl apply -f gateway/routes/integrations.yml

The gateway forwards TCP traffic on port 9090 to ThingsBoard. Use the reserved IP address, or your domain, as RPC_HOST in the remote integration configuration.

Step 12. Create Your Administrator Account

Section titled “Step 12. Create Your Administrator Account”

After launching ThingsBoard, open the web UI at the load balancer address. ThingsBoard prompts you to create your System Administrator account — the account that manages the platform itself (tenants, system settings, platform-wide resources).

  1. Enter Email, Password, and Confirm password.
  2. 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.
  3. Click Create account. You are signed in as the system administrator.

Your ThingsBoard instance is now installed and running.

Check that the gateway and its routes are accepted:

Terminal window
kubectl -n thingsboard get gateway tb-gateway
kubectl -n thingsboard get httproute,tcproute,udproute

Open the web interface at the reserved IP address, or at your domain if you configured HTTPS. Devices connect to the same address on the ports from Step 11.

Trendz runs on its own node, which requires trendz_enabled = true in Step 2.

Pull the Trendz images from Docker Hub:

Terminal window
docker pull thingsboard/trendz:1.16.1.3
docker pull thingsboard/trendz-python-executor:1.16.1.3

Sync the Trendz database credentials from the Vault and create the database in the existing PostgreSQL system:

Terminal window
kubectl apply -f external-secrets/trendz.yml
kubectl apply -f trendz/trendz-create-db.yml

Check logs:

Terminal window
kubectl logs job/trendz-create-db -n thingsboard
Terminal window
./k8s-deploy-trendz.sh

Expose Trendz on the same listener as the web UI from Step 11:

Terminal window
kubectl apply -f gateway/routes/trendz.yml

To examine ThingsBoard node logs:

Terminal window
kubectl logs -f tb-node-0

Other useful commands:

  • kubectl get pods — see the state of all pods
  • kubectl get externalsecret — see whether the secrets are synced from the Vault
  • kubectl get kafka tb — see the state of the Kafka cluster
  • kubectl describe gateway tb-gateway — see the state of the gateway and its listeners

See the kubectl Cheat Sheet for more details.

Delete all ThingsBoard pods:

Terminal window
./k8s-delete-resources.sh

Delete all ThingsBoard resources, including the data volumes and the load balancer:

Terminal window
./k8s-delete-all.sh

If you enabled Cassandra backups, empty the backup bucket. OCI doesn’t delete a bucket that still holds objects:

Terminal window
oci os object bulk-delete --bucket-name $(terraform -chdir=infrastructure output -raw cassandra_backup_bucket) --force

Delete the infrastructure:

Terminal window
cd infrastructure
terraform destroy

With ThingsBoard running, these concept guides help you build your first solution: