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 Community Edition account that supports Edge functionality.
You can install a local ThingsBoard CE server. The local server is accessible at http://localhost:8080.
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:
- Sign in to your ThingsBoard instance and go to Edge Management → Instances. Click Add (+) in the top-right corner and select Add new edge.
Enter a name for the Edge, like My New Edge.
Click Add.- 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:
- Click the Edge entity to open its details.
- Click Install & Connection Instructions.
- Select the installation method and follow the instructions to install Edge and connect it to the server.
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”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.
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.3.1.1" ports: - "8080:8080" - "1883:1883" - "5683-5688:5683-5688/udp" environment: SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/tb-edge 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 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.3.1.1 | 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 |
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 -d && docker compose logs -f mytbedgeOnce the service is running, open the Edge UI at http://localhost:8080.
Log in using the same default credentials listed in the Prerequisites section. You can change them in the Edge UI after logging in.
Step 5. Inspect logs, stop, and start
Section titled “Step 5. Inspect logs, stop, and start”To detach from the session terminal without stopping the container, press Ctrl+p then Ctrl+q.
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.