Skip to content
Stand with Ukraine flag

Installing ThingsBoard Edge using Docker (Windows)

This guide provides step-by-step instructions for running ThingsBoard Edge on Windows using Docker.

To run ThingsBoard Edge, you need an active ThingsBoard Professional Edition account that supports Edge functionality.

You can use ThingsBoard Cloud or install a local ThingsBoard PE server.

The hardware requirements for ThingsBoard Edge depend on the number of connected devices and platform interaction intensity.

WorkloadRAMDescription
Light1 GBFewer than 100 devices, minimal dashboard/device management usage
Heavy4 GB100+ devices or intense platform interactions

Install Docker Desktop for Windows before continuing.

To create a new Edge instance on your ThingsBoard Server:

  1. Sign in to your ThingsBoard PE instance and go to Edge Management → Instances. Click Add (+) in the top-right corner and select Add new edge.
  2. Enter a name for the Edge, like My New Edge.

    If needed, update the Cloud endpoint. If Edge runs in a Docker container, do not use localhost — use the IP address of the machine where ThingsBoard PE is hosted (e.g., http://10.7.2.143:8080). If you use ThingsBoard Cloud, keep the default. Click Add.
  3. Your new Edge instance is created and appears at the top of the list.

Guided installation using ThingsBoard Server instructions

Section titled “Guided installation using ThingsBoard Server instructions”

Once an Edge instance is created, the server generates pre-configured installation instructions containing the Edge credentials (Edge Key, Edge Secret, etc.). To access them:

  1. Click the Edge entity to open its details.
  2. Click Install & Connection Instructions.
  3. Select the installation method and follow the instructions to install Edge and connect it to the server.

If you are unable to use the guided instructions above, follow the steps below to install and configure Edge manually.

In the Edge instance details panel, click Copy Edge Key and Copy Edge Secret. Store these values securely — you need them in the next step.

On Windows, ThingsBoard Edge requires pre-created named Docker volumes. Open PowerShell or Command Prompt and run:

Terminal window
docker volume create mytb-edge-data
docker volume create mytb-edge-logs
docker volume create mytb-edge-data-db

Step 3. Create the docker-compose.yml file

Section titled “Step 3. Create the docker-compose.yml file”

Create a docker-compose.yml file and add the following content:

docker-compose.yml
services:
mytbedge:
restart: always
image: "thingsboard/tb-edge-pe:4.3.1.1EDGEPE"
ports:
- "8080:8080"
- "1883:1883"
- "5683-5688:5683-5688/udp"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/tb-edge
EDGE_LICENSE_INSTANCE_DATA_FILE: /data/instance-edge-license.data
CLOUD_ROUTING_KEY: PUT_YOUR_EDGE_KEY_HERE # e.g. 19ea7ee8-5e6d-e642-4f32-05440a529015
CLOUD_ROUTING_SECRET: PUT_YOUR_EDGE_SECRET_HERE # e.g. bztvkvfqsye7omv9uxlp
CLOUD_RPC_HOST: PUT_YOUR_CLOUD_IP # e.g. 192.168.1.1 or thingsboard.cloud
CLOUD_RPC_SSL_ENABLED: 'false' # set it to 'true' if you are connecting edge to thingsboard.cloud
volumes:
- mytb-edge-data:/data
- mytb-edge-logs:/var/log/tb-edge
postgres:
restart: always
image: "postgres:16"
ports:
- "5432"
environment:
POSTGRES_DB: tb-edge
POSTGRES_PASSWORD: postgres
volumes:
- mytb-edge-data-db:/var/lib/postgresql/data
volumes:
mytb-edge-data:
external: true
mytb-edge-logs:
external: true
mytb-edge-data-db:
external: true

Configuration parameters:

ParameterDescription
restart: alwaysThingsBoard Edge automatically restarts on system reboot or failure
8080:8080Maps local port 8080 to the container’s HTTP port
1883:1883Maps local port 1883 to the container’s MQTT port
5683-5688:5683-5688/udpMaps local UDP ports 5683–5688 to the container’s CoAP and LwM2M ports
thingsboard/tb-edge-pe:4.3.1.1EDGEPEThingsBoard Edge Docker image
CLOUD_ROUTING_KEYYour Edge key
CLOUD_ROUTING_SECRETYour Edge secret
CLOUD_RPC_HOSTIP address or hostname of the ThingsBoard Server
EDGE_LICENSE_INSTANCE_DATA_FILEPath where the Edge PE license data file is stored — uses the same license as ThingsBoard PE
CLOUD_RPC_SSL_ENABLEDSet to true to enable SSL for the Edge–server connection — required when connecting to ThingsBoard Cloud
external: trueVolumes must be created manually before starting the container (see Step 2)

In the directory containing the docker-compose.yml file, run:

Terminal window
docker compose up -d && docker compose logs -f mytbedge

Once the service is running, open the Edge UI at http://localhost:8080.

Log in using your tenant credentials from ThingsBoard Server or ThingsBoard Cloud.

To detach from the session terminal without stopping the container, press Ctrl+p then Ctrl+q.

To view ThingsBoard Edge logs:

Terminal window
docker compose logs -f mytbedge

To stop the container:

Terminal window
docker compose stop mytbedge

To start the container:

Terminal window
docker compose start mytbedge

To stop and remove all containers and networks:

Terminal window
docker compose down

To recreate and start all containers:

Terminal window
docker compose up -d

If you observe errors related to DNS resolution, for example:

127.0.1.1:53: cannot unmarshal DNS message

Configure your system to use Google Public DNS. For details, see the Windows instructions.