Skip to content
NEW AI Solution Creator — get a working IoT prototype in 10 minutes
Stand with Ukraine flag

How to change configuration

ThingsBoard Edge is configured via environment variables. Set them in the configuration file and restart the service — no YAML editing or config file merging is required when upgrading.

The full list of Edge-specific cloud.* environment variables is in Configuration reference. For transport, database, queue, and caching variables, see the other pages in this Reference section.

Set environment variables in the Edge configuration file:

Terminal window
sudo nano /etc/tb-edge/conf/tb-edge.conf

Add or edit variables using export syntax:

Terminal window
export CLOUD_RPC_HOST=my-thingsboard-server.example.com
export CLOUD_ROUTING_KEY=your-edge-key
export CLOUD_ROUTING_SECRET=your-edge-secret

Restart the service to apply changes:

Terminal window
sudo systemctl restart tb-edge

Set environment variables in your Docker Compose file under the tb-edge service:

services:
tb-edge:
image: thingsboard/tb-edge:latest
environment:
CLOUD_RPC_HOST: my-thingsboard-server.example.com
CLOUD_ROUTING_KEY: your-edge-key
CLOUD_ROUTING_SECRET: your-edge-secret
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/tb_edge

Restart the container to apply changes:

Terminal window
docker compose down && docker compose up -d

Set environment variables in the Edge Deployment or StatefulSet:

env:
- name: CLOUD_RPC_HOST
value: "my-thingsboard-server.example.com"
- name: CLOUD_ROUTING_KEY
valueFrom:
secretKeyRef:
name: tb-edge-credentials
key: routingKey
- name: CLOUD_ROUTING_SECRET
valueFrom:
secretKeyRef:
name: tb-edge-credentials
key: routingSecret