Installing ThingsBoard Edge using Docker (Windows)
This guide provides step-by-step instructions for running ThingsBoard Edge on Windows using Docker.
Prerequisites
Section titled “Prerequisites”To run ThingsBoard Edge, you need an active ThingsBoard account that supports Edge functionality.
You can use ThingsBoard Cloud or install a local ThingsBoard server.
Hardware requirements
Section titled “Hardware requirements”The hardware requirements for ThingsBoard Edge depend on the number of connected devices and platform interaction intensity.
| Workload | RAM | Description |
|---|---|---|
| Light | 1 GB | Fewer than 100 devices, minimal dashboard/device management usage |
| Heavy | 4 GB | 100+ devices or intense platform interactions |
Docker installation
Section titled “Docker installation”Install Docker Desktop for Windows before continuing.
Deploy a new Edge instance
Section titled “Deploy a new Edge instance”To create a new Edge instance on your ThingsBoard Server:
- Log in to your ThingsBoard server and go to Edge management > Edges. Click Add edge and select Add new edge.
Enter a name for the Edge, like My New Edge.
If needed, update the Cloud endpoint (the field is shown only for Edges with legacy v1 licensing). If Edge runs in a Docker container, do not uselocalhost— use the IP address of the machine where ThingsBoard is hosted (e.g.,http://10.7.2.143:8080). If you use ThingsBoard Cloud, keep the default. Click Add.- Your new Edge instance appears at the top of the list, and the Edge created dialog opens with ready-to-use installation instructions (unless Do not show again was turned on earlier).
Guided installation using ThingsBoard Server instructions
Section titled “Guided installation using ThingsBoard Server instructions”The instructions generated by the server already contain the credentials of this Edge (Edge key and Edge secret), so this is the fastest way to install it. If you closed the dialog, open the instructions again:
- Click the Edge to open its details.
- On the Details tab, click Install & Connect Instructions.
- Select the Docker, Ubuntu, or CentOS/RHEL tab and follow the instructions to install Edge and connect it to the server. The dialog opens on the Agent tab, which is for remote installation with a Remote Agent.
Manual installation and configuration
Section titled “Manual installation and configuration”If you are unable to use the guided instructions above, follow the steps below to install and configure Edge manually.
Step 1. Copy Edge credentials
Section titled “Step 1. Copy Edge credentials”On the server, open the Edge and click Copy Edge key and Copy Edge secret on its Details tab. Store these values securely. You need them in the next step.
Step 2. Create Docker volumes
Section titled “Step 2. Create Docker volumes”On Windows, ThingsBoard Edge requires pre-created named Docker volumes. Open PowerShell or Command Prompt and run:
docker volume create mytb-edge-datadocker volume create mytb-edge-logsdocker volume create mytb-edge-data-dbStep 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:
services: mytbedge: restart: always image: "thingsboard/tb-edge:4.4.0.2EDGE" 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/datavolumes: mytb-edge-data: external: true mytb-edge-logs: external: true mytb-edge-data-db: external: trueConfiguration parameters:
| Parameter | Description |
|---|---|
restart: always | ThingsBoard Edge automatically restarts on system reboot or failure |
8080:8080 | Maps local port 8080 to the container’s HTTP port |
1883:1883 | Maps local port 1883 to the container’s MQTT port |
5683-5688:5683-5688/udp | Maps local UDP ports 5683–5688 to the container’s CoAP and LwM2M ports |
thingsboard/tb-edge:4.4.0.2EDGE | ThingsBoard Edge Docker image |
CLOUD_ROUTING_KEY | Your Edge key |
CLOUD_ROUTING_SECRET | Your Edge secret |
CLOUD_RPC_HOST | IP address or hostname of the ThingsBoard Server |
EDGE_LICENSE_INSTANCE_DATA_FILE | File where Edge stores its auto-generated instance data. Keep it on the /data volume so it survives container restarts and upgrades |
CLOUD_RPC_SSL_ENABLED | Set to true to enable SSL for the Edge–server connection — required when connecting to ThingsBoard Cloud |
external: true | Volumes must be created manually before starting the container (see Step 2) |
Step 4. Complete the installation
Section titled “Step 4. Complete the installation”In the directory containing the docker-compose.yml file, run:
docker compose up -ddocker compose logs -f mytbedgeOnce the service is running, open the Edge UI at http://localhost:8080 (or http://localhost:18080 if you changed the ports).
Log in using your tenant credentials from ThingsBoard Server or ThingsBoard Cloud. To check the connection, go to Edge > Status in the Edge UI. The status is Connected.
Step 5. Inspect logs, stop, and start
Section titled “Step 5. Inspect logs, stop, and start”Press Ctrl+C to stop following the logs. The container keeps running.
To view ThingsBoard Edge logs:
docker compose logs -f mytbedgeTo stop the container:
docker compose stop mytbedgeTo start the container:
docker compose start mytbedgeTo stop and remove all containers and networks:
docker compose downTo recreate and start all containers:
docker compose up -dTroubleshooting
Section titled “Troubleshooting”DNS issues
Section titled “DNS issues”If you observe errors related to DNS resolution, for example:
127.0.1.1:53: cannot unmarshal DNS messageConfigure your system to use Google Public DNS. For details, see the Windows instructions.
Was this helpful?