Remote Integrations
Any ThingsBoard integration can run remotely, as a separate service outside the ThingsBoard Edge process. The service runs on the same machine as the Edge or on another machine that can reach the Edge over the network. This guide sets up a remote HTTP integration as an example.
Prerequisites
Section titled “Prerequisites”- A ThingsBoard server with tenant administrator access. The templates are created there.
- A ThingsBoard Edge instance connected to the server.
- A machine for the remote integration service with Docker, or with Ubuntu or CentOS/RHEL for the package install. Port 8082, the default port of the remote HTTP integration, must be open there.
curlto simulate a device.
Configure the ThingsBoard server
Section titled “Configure the ThingsBoard server”Step 1. Create the uplink converter
Section titled “Step 1. Create the uplink converter”The uplink converter decodes incoming device data into ThingsBoard telemetry and attributes.
-
On the server, go to Edge management > Templates and open the Converter tab. Click Add data converter and select Create new converter.
-
Set Converter type to Uplink, select HTTP as the Integration type, and enter the name
HTTP remote uplink converter. -
In Main decoding configuration, select JS, paste the following script, and click Add:
// decode payload to JSONvar data = decodeToJson(payload);var deviceName = data.deviceName;var result = {deviceName: deviceName,deviceType: 'default',attributes: {model: data.model,},telemetry: {temperature: data.temperature}};function decodeToString(payload) {return String.fromCharCode.apply(String, payload);}function decodeToJson(payload) {var str = decodeToString(payload);return JSON.parse(str);}return result;
Step 2. Create the remote integration template
Section titled “Step 2. Create the remote integration template”-
On the server, go to Edge management > Templates, open the Integration tab, and click Add integration.
-
On the Basic settings step, select HTTP as the Integration type and enter the name
HTTP Demo Remote. Click Next. -
On the Uplink data converter step, select Select existing, choose
HTTP remote uplink converter, and click Next. You can also create the converter here with Create new. -
On the Downlink data converter step, keep Skip selected and click Skip.
-
On the Connection step, set Base URL to
${{remoteHttpIntegrationUrl}}and turn on Execute remotely. ThingsBoard shows the generated Integration key and Integration secret. Click Add.
The ${{remoteHttpIntegrationUrl}} placeholder is replaced with the value of the Edge server attribute of the same name when the integration is sent to the Edge. See Configuration placeholders.
Step 3. Save the integration credentials
Section titled “Step 3. Save the integration credentials”The remote service identifies itself with the Integration key and Integration secret of the template.
- On the Integration tab of Edge management > Templates, open the integration you created.
- Expand Execute remotely and copy the Integration key and the Integration secret with the copy buttons next to them.
Step 4. Assign the integration to the Edge
Section titled “Step 4. Assign the integration to the Edge”Add the remoteHttpIntegrationUrl attribute first. It holds the address of the machine where the remote HTTP integration service will run. Without it, the assignment dialog warns Edge has missing attribute(s) and the Edge receives the literal placeholder.
-
On the server, go to Edge management > Edges and click the Edge.
-
On the Attributes tab, with the Server attributes scope selected, click +.
-
In the Add attribute dialog, enter
remoteHttpIntegrationUrlas the key andhttp://IP:8082as the value, whereIPis the address of the remote integration machine. Click Add. -
On the Details tab, click Manage integrations, then Assign to edge (+). Select
HTTP Demo Remoteand click Assign. -
Log in to the Edge and go to Integrations > Integrations. Open HTTP Demo Remote. Base URL shows the attribute value instead of the placeholder.
Install the remote integration service
Section titled “Install the remote integration service”The service connects to the Edge through the integration RPC port, 9090 by default (INTEGRATIONS_RPC_PORT in tb-edge.yml), and uses the Integration key and Integration secret from Step 3. Pick the install method and then the integration type.
Make sure Docker CE is installed.
Pull the image:
docker pull thingsboard/tb-http-integration:4.4.0.2Create a log volume:
mkdir -p ~/.tb-pe-http-integration-logs && sudo chown -R 799:799 ~/.tb-pe-http-integration-logsRun the integration:
docker run -it \-p 8082:8082 \-v ~/.tb-pe-http-integration-logs:/var/log/tb-http-integration \-e "RPC_HOST=mytbedge" \-e "RPC_PORT=9090" \-e "INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY" \-e "INTEGRATION_SECRET=YOUR_SECRET" \--name my-tb-pe-http-integration \--network edge_docker_default \--restart always \thingsboard/tb-http-integration:4.4.0.2Useful commands:
docker attach my-tb-pe-http-integration # view logsdocker stop my-tb-pe-http-integrationdocker start my-tb-pe-http-integrationPull the image:
docker pull thingsboard/tb-mqtt-integration:4.4.0.2Create a log volume:
mkdir -p ~/.tb-pe-mqtt-integration-logs && sudo chown -R 799:799 ~/.tb-pe-mqtt-integration-logsRun the integration:
docker run -it \-v ~/.tb-pe-mqtt-integration-logs:/var/log/tb-mqtt-integration \-e "RPC_HOST=mytbedge" \-e "RPC_PORT=9090" \-e "INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY" \-e "INTEGRATION_SECRET=YOUR_SECRET" \--name my-tb-pe-mqtt-integration \--network edge_docker_default \--restart always \thingsboard/tb-mqtt-integration:4.4.0.2Useful commands:
docker attach my-tb-pe-mqtt-integrationdocker stop my-tb-pe-mqtt-integrationdocker start my-tb-pe-mqtt-integrationPull the image:
docker pull thingsboard/tb-opc-ua-integration:4.4.0.2Create a log volume:
mkdir -p ~/.tb-pe-opc-ua-integration-logs && sudo chown -R 799:799 ~/.tb-pe-opc-ua-integration-logsRun the integration:
docker run -it \-v ~/.tb-pe-opc-ua-integration-logs:/var/log/tb-opc-ua-integration \-e "RPC_HOST=mytbedge" \-e "RPC_PORT=9090" \-e "INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY" \-e "INTEGRATION_SECRET=YOUR_SECRET" \--name my-tb-pe-opc-ua-integration \--network edge_docker_default \--restart always \thingsboard/tb-opc-ua-integration:4.4.0.2Useful commands:
docker attach my-tb-pe-opc-ua-integrationdocker stop my-tb-pe-opc-ua-integrationdocker start my-tb-pe-opc-ua-integrationPull the image:
docker pull thingsboard/tb-tcp-udp-integration:4.4.0.2Create a log volume:
mkdir -p ~/.tb-pe-tcp-udp-integration-logs && sudo chown -R 799:799 ~/.tb-pe-tcp-udp-integration-logsRun the integration (adjust -p for TCP or UDP):
# TCP (port 10560):docker run -it -p 10560:10560 \-v ~/.tb-pe-tcp-udp-integration-logs:/var/log/tb-tcp-udp-integration \-e "RPC_HOST=mytbedge" \-e "RPC_PORT=9090" \-e "INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY" \-e "INTEGRATION_SECRET=YOUR_SECRET" \--name my-tb-pe-tcp-udp-integration \--network NETWORK_NAME \--restart always \thingsboard/tb-tcp-udp-integration:4.4.0.2
# UDP (port 11560):docker run -it -p 11560:11560/udp \-v ~/.tb-pe-tcp-udp-integration-logs:/var/log/tb-tcp-udp-integration \-e "RPC_HOST=mytbedge" \-e "RPC_PORT=9090" \-e "INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY" \-e "INTEGRATION_SECRET=YOUR_SECRET" \--name my-tb-pe-tcp-udp-integration \--network NETWORK_NAME \--restart always \thingsboard/tb-tcp-udp-integration:4.4.0.2Use docker network ls to find NETWORK_NAME.
Useful commands:
docker attach my-tb-pe-tcp-udp-integrationdocker stop my-tb-pe-tcp-udp-integrationdocker start my-tb-pe-tcp-udp-integrationPull the image:
docker pull thingsboard/tb-coap-integration:4.4.0.2Create a log volume:
mkdir -p ~/.tb-pe-coap-integration-logs && sudo chown -R 799:799 ~/.tb-pe-coap-integration-logsRun the integration:
docker run -it -p 5683:5683/udp \-v ~/.tb-pe-coap-integration-logs:/var/log/tb-coap-integration \-e "RPC_HOST=mytbedge" \-e "RPC_PORT=9090" \-e "INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY" \-e "INTEGRATION_SECRET=YOUR_SECRET" \--name my-tb-pe-coap-integration \--network edge_docker_default \--restart always \thingsboard/tb-coap-integration:4.4.0.2Useful commands:
docker attach my-tb-pe-coap-integrationdocker stop my-tb-pe-coap-integrationdocker start my-tb-pe-coap-integrationCommon Docker parameters:
| Parameter | Description |
|---|---|
mytbedge |
Hostname of the ThingsBoard Edge service |
9090 |
Integration RPC port (INTEGRATIONS_RPC_PORT in tb-edge.yml) |
YOUR_ROUTING_KEY |
Integration key from Step 3 |
YOUR_SECRET |
Integration secret from Step 3 |
edge_docker_default |
Docker network where the Edge container runs. Check with docker network ls |
--restart always |
Automatically restarts on system reboot or failure |
To detach without stopping the container, press Ctrl+p then Ctrl+q.
First, install Java 25 (OpenJDK):
sudo apt updatesudo apt install openjdk-25-jdkThen select your integration package:
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4.0.2/tb-http-integration-4.4.0.2.debsudo dpkg -i tb-http-integration-4.4.0.2.debEdit the configuration:
sudo nano /etc/tb-http-integration/conf/tb-http-integration.confUncomment and set the connection parameters:
export RPC_HOST=127.0.0.1 # IP address of your Edge instanceexport RPC_PORT=9090export INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEYexport INTEGRATION_SECRET=YOUR_SECRETStart the service:
sudo service tb-http-integration startLogs: /var/log/tb-http-integration/
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4.0.2/tb-mqtt-integration-4.4.0.2.debsudo dpkg -i tb-mqtt-integration-4.4.0.2.debEdit the configuration:
sudo nano /etc/tb-mqtt-integration/conf/tb-mqtt-integration.confUncomment and set the connection parameters:
export RPC_HOST=127.0.0.1export RPC_PORT=9090export INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEYexport INTEGRATION_SECRET=YOUR_SECRETStart the service:
sudo service tb-mqtt-integration startLogs: /var/log/tb-mqtt-integration/
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4.0.2/tb-opc-ua-integration-4.4.0.2.debsudo dpkg -i tb-opc-ua-integration-4.4.0.2.debEdit the configuration:
sudo nano /etc/tb-opc-ua-integration/conf/tb-opc-ua-integration.confUncomment and set the connection parameters:
export RPC_HOST=127.0.0.1export RPC_PORT=9090export INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEYexport INTEGRATION_SECRET=YOUR_SECRETStart the service:
sudo service tb-opc-ua-integration startLogs: /var/log/tb-opc-ua-integration/
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4.0.2/tb-tcp-udp-integration-4.4.0.2.debsudo dpkg -i tb-tcp-udp-integration-4.4.0.2.debEdit the configuration:
sudo nano /etc/tb-tcp-udp-integration/conf/tb-tcp-udp-integration.confUncomment and set the connection parameters:
export RPC_HOST=127.0.0.1export RPC_PORT=9090export INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEYexport INTEGRATION_SECRET=YOUR_SECRETStart the service:
sudo service tb-tcp-udp-integration startLogs: /var/log/tb-tcp-udp-integration/
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4.0.2/tb-coap-integration-4.4.0.2.debsudo dpkg -i tb-coap-integration-4.4.0.2.debEdit the configuration:
sudo nano /etc/tb-coap-integration/conf/tb-coap-integration.confUncomment and set the connection parameters:
export RPC_HOST=127.0.0.1export RPC_PORT=9090export INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEYexport INTEGRATION_SECRET=YOUR_SECRETStart the service:
sudo service tb-coap-integration startLogs: /var/log/tb-coap-integration/
First, install Java 25 (OpenJDK):
sudo yum install java-25-openjdkThen select your integration package:
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4.0.2/tb-http-integration-4.4.0.2.rpmsudo rpm -Uvh tb-http-integration-4.4.0.2.rpmEdit the configuration:
sudo nano /etc/tb-http-integration/conf/tb-http-integration.confUncomment and set the connection parameters:
export RPC_HOST=127.0.0.1export RPC_PORT=9090export INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEYexport INTEGRATION_SECRET=YOUR_SECRETStart the service:
sudo service tb-http-integration startLogs: /var/log/tb-http-integration/
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4.0.2/tb-mqtt-integration-4.4.0.2.rpmsudo rpm -Uvh tb-mqtt-integration-4.4.0.2.rpmEdit the configuration:
sudo nano /etc/tb-mqtt-integration/conf/tb-mqtt-integration.confUncomment and set the connection parameters:
export RPC_HOST=127.0.0.1export RPC_PORT=9090export INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEYexport INTEGRATION_SECRET=YOUR_SECRETStart the service:
sudo service tb-mqtt-integration startLogs: /var/log/tb-mqtt-integration/
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4.0.2/tb-opc-ua-integration-4.4.0.2.rpmsudo rpm -Uvh tb-opc-ua-integration-4.4.0.2.rpmEdit the configuration:
sudo nano /etc/tb-opc-ua-integration/conf/tb-opc-ua-integration.confUncomment and set the connection parameters:
export RPC_HOST=127.0.0.1export RPC_PORT=9090export INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEYexport INTEGRATION_SECRET=YOUR_SECRETStart the service:
sudo service tb-opc-ua-integration startLogs: /var/log/tb-opc-ua-integration/
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4.0.2/tb-tcp-udp-integration-4.4.0.2.rpmsudo rpm -Uvh tb-tcp-udp-integration-4.4.0.2.rpmEdit the configuration:
sudo nano /etc/tb-tcp-udp-integration/conf/tb-tcp-udp-integration.confUncomment and set the connection parameters:
export RPC_HOST=127.0.0.1export RPC_PORT=9090export INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEYexport INTEGRATION_SECRET=YOUR_SECRETStart the service:
sudo service tb-tcp-udp-integration startLogs: /var/log/tb-tcp-udp-integration/
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4.0.2/tb-coap-integration-4.4.0.2.rpmsudo rpm -Uvh tb-coap-integration-4.4.0.2.rpmEdit the configuration:
sudo nano /etc/tb-coap-integration/conf/tb-coap-integration.confUncomment and set the connection parameters:
export RPC_HOST=127.0.0.1export RPC_PORT=9090export INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEYexport INTEGRATION_SECRET=YOUR_SECRETStart the service:
sudo service tb-coap-integration startLogs: /var/log/tb-coap-integration/
Send an uplink message
Section titled “Send an uplink message”-
On the Edge, go to Integrations > Integrations, open HTTP Demo Remote, and copy the HTTP endpoint URL. It has the form
http://IP:8082/api/v1/integrations/http/<Integration key>and points to the remote integration machine, so that machine must be reachable from your client and port 8082 must not be blocked by a firewall. -
Send a test message. Replace
$YOUR_HTTP_ENDPOINT_URLwith the copied URL:Terminal window curl -v -X POST \-d '{"deviceName":"SN-001","temperature":33,"model":"test"}' \$YOUR_HTTP_ENDPOINT_URL \-H "Content-Type:application/json" -
On the Edge, open the Events tab of the integration. An Uplink event with status OK appears.
-
The device SN-001 is created automatically. Go to Devices & assets > Devices on the Edge, open it, and select the Latest telemetry tab. The
temperaturekey shows33.
Remote integration configuration
Section titled “Remote integration configuration”The integration itself is configured in the ThingsBoard UI, in the template. On the remote service you only set the connection parameters above. For the settings of each integration type, see:
- HTTP Integration
- MQTT Integration
- OPC-UA Integration
- TCP Integration
- UDP Integration
- CoAP Integration
Troubleshooting
Section titled “Troubleshooting”Check the log files of the service:
- Docker:
~/.tb-pe-{type}-integration-logs/ - Ubuntu / CentOS:
/var/log/tb-{type}-integration/
Look for INFO messages that show the latest integration configuration received from the Edge. If there are none, check RPC_HOST, RPC_PORT, the key, and the secret.
Was this helpful?