Rules of Compatibility Between ThingsBoard Edge and ThingsBoard Server Versions:
A ThingsBoard Edge version X.Y.Z is compatible with the same ThingsBoard Server version X.Y.Z and any later versions.
A ThingsBoard Edge version X.Y.Z is NOT compatible with ThingsBoard Server versions preceding X.Y.Z.
Example: ThingsBoard Edge version 3.3.4.1 is compatible with ThingsBoard Server version 3.3.4.1 and subsequent versions (3.4.0, 3.4.1, …). However, ThingsBoard Edge version 3.4.0 is NOT compatible with ThingsBoard Server version 3.3.4.1 or any prior versions (3.3.4, 3.3.3, …). In such scenarios, ThingsBoard Server 3.3.4.1 or a preceding version must first be upgraded to ThingsBoard Server 3.4.0 or a later version.
Please ensure that the ThingsBoard Server is updated to the latest version before proceeding.
This guide will help you to install and start ThingsBoard Edge using Docker on Linux or Mac OS.
Prerequisites
To start running ThingsBoard Community Edition Edge, you will need an active ThingsBoard Community Edition account that supports Edge functionality.
Sign up for a Live Demo account, which is the easiest way to get started. Throughout the rest of this tutorial, this URL will be referred to as SERVER_URL
Log in using your Live Demo tenant credentials.
You can install the ThingsBoard Community Edition local server. For this, please refer to the ThingsBoard installation guide.
The local server can be accessed via http://localhost:8080. Throughout this tutorial, we will refer to this URL as SERVER_URL. Log in with:
The hardware requirements for ThingsBoard Edge are determined by the number of connected devices and the intensity of interactions with the platform interface.
To ensure optimal performance, we recommend the following:
At least 1GB of RAM (Light workload): It is suitable for minimal interactions with the platform interface, such as dashboards and device management, and fewer than 100 connected devices.
At least 4GB of RAM (Heavy workload): This configuration is suitable for intense platform interactions and 100+ devices connected to a single machine.
Deploying a New Edge Instance
To create a new Edge:
Sign in to your ThingsBoard CE instance and navigate to the Edge Management > Instances section. Click the ”+” icon in the top right corner and select the “Add new edge” option.
Enter a name for the Edge you are creating. For example, “My New Edge”. Click the “Add” button to confirm the addition of the Edge instance.
Your new Edge is created and will appear at the top of the list, as entries are sorted by creation time by default.
Sign in to your ThingsBoard CE instance and navigate to the Edge Management > Instances section. Click the ”+” icon in the top right corner and select the “Add new edge” option.
Enter a name for the Edge you are creating. For example, “My New Edge”. Click the “Add” button to confirm the addition of the Edge instance.
Your new Edge is created and will appear at the top of the list, as entries are sorted by creation time by default.
Docker installation
ThingsBoard supports Docker Compose V2 (Docker Desktop or Compose plugin) starting from 3.4.2 release.
We strongly recommend upgrading to and using Docker Compose V2, as Docker no longer supports docker-compose as a standalone setup.
Guided Installation Using ThingsBoard Server Pre-configured Instructions
Once the Edge instance has been created, the installation instructions will be available for use.
Each Edge has preset configurations that contain important credentials, such as Edge Secret, Edge Key, etc. To access these configurations:
Click on the Edge entity to open its details.
Click the “Install & Connection Instructions” button.
Follow the instructions to install Edge and connect it to the server.
Click on the Edge entity to open its details.
Click the “Install & Connection Instructions” button.
Follow the instructions to install Edge and connect it to the server.
Manual Installation and Configuration
If for any reason you are unable to use the prepared ThingsBoard Server Instructions above, please follow the steps below.
These steps will guide you through installing and configuring the Edge by yourself.
Click on Copy Edge Key and Copy Edge Secret in the edge details section.
This will copy your edge credentials to your clipboard.
Be sure to store them in a secure location, as these values will be needed in the following steps.
Step 2. Choose Queue and/or Database Services
ThingsBoard Edge is able to use different messaging systems/brokers for storing the messages and communication between ThingsBoard services. How to choose the right queue implementation?
In Memory queue implementation is built-in and default. It is useful for development(PoC) environments and is not suitable for production deployments or any sort of cluster deployments.
Kafka is recommended for production deployments. This queue is used on the most of ThingsBoard production environments now.
Hybrid implementation combines PostgreSQL and Cassandra databases with Kafka queue service. It is recommended if you plan to manage 1M+ devices in production or handle high data ingestion rate (more than 5000 msg/sec).
Create a docker compose file for the ThingsBoard Edge service:
restart: always - automatically start ThingsBoard Edge in case of system reboot and restart in case of failure;
8080:8080 - connect local port 8080 to exposed internal HTTP port 8080;
1883:1883 - connect local port 1883 to exposed internal MQTT port 1883;
5683-5688:5683-5688/udp - connect local UDP ports 5683-5688 to exposed internal COAP and LwM2M ports;
thingsboard/tb-edge:3.9.0EDGE - docker image;
CLOUD_ROUTING_KEY - your edge key;
CLOUD_ROUTING_SECRET - your edge secret;
CLOUD_RPC_HOST - ip address of the machine with the ThingsBoard platform;
Please set CLOUD_RPC_HOST with an IP address of the machine where ThingsBoard version is running:
DO NOT use ‘localhost’ - ‘localhost’ is the ip address of the edge service in the docker container.
Use demo.thingsboard.io if you are connecting edge to ThingsBoard Live Demo for evaluation.
Use X.X.X.X IP address in case edge is connecting to the cloud instance in the same network or in the docker.
If ThingsBoard Edge is set to run on the same machine where the ThingsBoard server is operating, you need to update port configuration to prevent port collision between the ThingsBoard server and ThingsBoard Edge.
Ensure that the ports 18080, 11883, 15683-15688 are not used by any other application.
Then, update the port configuration in the docker-compose.yml file:
sed -i ‘s/8080:8080/18080:8080/; s/1883:1883/11883:1883/; s/5683-5688:5683-5688\/udp/15683-15688:5683-5688\/udp/’ docker-compose.yml
Set the terminal in the directory which contains the docker-compose.yml file and execute the following commands to up this docker compose directly:
1
docker compose up -d && docker compose logs -f mytbedge
Apache Kafka is an open source stream processing software platform.
Create the docker compose file and populate it with configuration lines:
restart: always - automatically start ThingsBoard Edge in case of system reboot and restart in case of failure;
8080:8080 - connect local port 8080 to exposed internal HTTP port 8080;
1883:1883 - connect local port 1883 to exposed internal MQTT port 1883;
5683-5688:5683-5688/udp - connect local UDP ports 5683-5688 to exposed internal COAP and LwM2M ports;
thingsboard/tb-edge:3.9.0EDGE - docker image;
CLOUD_ROUTING_KEY - your edge key;
CLOUD_ROUTING_SECRET - your edge secret;
CLOUD_RPC_HOST - ip address of the machine with the ThingsBoard platform;
Please set CLOUD_RPC_HOST with an IP address of the machine where ThingsBoard version is running:
DO NOT use ‘localhost’ - ‘localhost’ is the ip address of the edge service in the docker container.
Use demo.thingsboard.io if you are connecting edge to ThingsBoard Live Demo for evaluation.
Use X.X.X.X IP address in case edge is connecting to the cloud instance in the same network or in the docker.
If ThingsBoard Edge is set to run on the same machine where the ThingsBoard server is operating, you need to update port configuration to prevent port collision between the ThingsBoard server and ThingsBoard Edge.
Ensure that the ports 18080, 11883, 15683-15688 are not used by any other application.
Then, update the port configuration in the docker-compose.yml file:
sed -i ‘s/8080:8080/18080:8080/; s/1883:1883/11883:1883/; s/5683-5688:5683-5688\/udp/15683-15688:5683-5688\/udp/’ docker-compose.yml
Set the terminal in the directory which contains the docker-compose.yml file and execute the following commands to up this docker compose directly:
1
docker compose up -d && docker compose logs -f mytbedge
Apache Cassandra is an open source NoSQL database designed to manage massive amounts of data.
Apache Kafka is an open source stream processing software platform.
Create the docker compose file and populate it with configuration lines:
restart: always - automatically start ThingsBoard Edge in case of system reboot and restart in case of failure;
8080:8080 - connect local port 8080 to exposed internal HTTP port 8080;
1883:1883 - connect local port 1883 to exposed internal MQTT port 1883;
5683-5688:5683-5688/udp - connect local UDP ports 5683-5688 to exposed internal COAP and LwM2M ports;
thingsboard/tb-edge:3.9.0EDGE - docker image;
CLOUD_ROUTING_KEY - your edge key;
CLOUD_ROUTING_SECRET - your edge secret;
CLOUD_RPC_HOST - ip address of the machine with the ThingsBoard platform;
Please set CLOUD_RPC_HOST with an IP address of the machine where ThingsBoard version is running:
DO NOT use ‘localhost’ - ‘localhost’ is the ip address of the edge service in the docker container.
Use demo.thingsboard.io if you are connecting edge to ThingsBoard Live Demo for evaluation.
Use X.X.X.X IP address in case edge is connecting to the cloud instance in the same network or in the docker.
If ThingsBoard Edge is set to run on the same machine where the ThingsBoard server is operating, you need to update port configuration to prevent port collision between the ThingsBoard server and ThingsBoard Edge.
Ensure that the ports 18080, 11883, 15683-15688 are not used by any other application.
Then, update the port configuration in the docker-compose.yml file:
sed -i ‘s/8080:8080/18080:8080/; s/1883:1883/11883:1883/; s/5683-5688:5683-5688\/udp/15683-15688:5683-5688\/udp/’ docker-compose.yml
Set the terminal in the directory which contains the docker-compose.yml file and execute the following commands to up this docker compose directly:
1
docker compose up -d && docker compose logs -f mytbedge