Edge
ThingsBoard Documentation
Cloud Professional Edition Community Edition Edge IoT Gateway License Server Trendz Analytics
Try it now Pricing
Installation > Docker (Windows)
Getting Started Documentation
Architecture

On this page

Installing ThingsBoard Edge using Docker (Windows)

This guide will help you to install and start ThingsBoard Edge using Docker on Windows. The container image used in this guide has embedded PostgreSQL 11 to simplify setup.

Prerequisites

ThingsBoard Cloud server

To start using ThingsBoard Edge you need to have ThingsBoard CE/PE server that supports edge functionality up and running.

The easiest way is to use Live Demo server.
The alternative option is to install ThingsBoard Community Edition server that supports edge functionality on-premise. Please visit Install CE to install 3.3 version or higher of server that supports edge functionality.

The easiest way is to use ThingsBoard Cloud server.
The alternative option is to install ThingsBoard Professional Edition server that supports edge functionality on-premise. Please visit Install PE to install 3.3 version or higher of server that supports edge functionality.

Edge provision on cloud

Additionally, you will need to provision ThingsBoard Edge on cloud server. Please visit this guide Provision edge on CE server or Provision edge on PE server respectively.

Once ThingsBoard Edge provisioned on cloud server please follow installation steps below.

Edge hardware requirements

Hardware requirements depend on an amount of devices connected to the edge and GUI usage locally.

To run ThingsBoard Edge without heavily usage of GUI (local dashboards, device management etc.) and relatively small amount of devices (under 100) on a single machine you will need at least 1GB of RAM.

To run ThingsBoard Edge with heavily usage of GUI (local dashboards, device management etc.) and with 100+ devices on a single machine we recommend having at least 4GB of RAM.

Step 1. Pull ThingsBoard Edge Images

Make sure your have logged in to docker hub using command line.

1
docker pull thingsboard/tb-edge-monolith:3.3.0EDGE

Step 2. Running ThingsBoard Edge

Here you can find ThingsBoard Edge single instance docker image with PostgreSQL database:

Windows users should use docker managed volume for ThingsBoard Edge DataBase. Create docker volume (for ex. mytb-edge-data) before executing docker run command: Open “Docker Quickstart Terminal”. Execute the following command to create docker volume:

1
2
$ docker volume create mytb-edge-data
$ docker volume create mytb-edge-logs

Create docker compose file for ThingsBoard Edge service:

1
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
version: '2.2'

services:
  mytbedge:
    restart: always
    image: "thingsboard/tb-edge-monolith:3.3.0EDGE"
    ports:
      - "8080:8080"
      - "1883:1883"
      - "5683-5688:5683-5688/udp"
    environment:
      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.250 or demo.thingsboard.io
    volumes:
      - mytb-edge-data:/data
      - mytb-edge-logs:/var/log/tb-edge
volumes:
  mytb-edge-data:
    external: true
  mytb-edge-logs:
    external: true

Where:

  • 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
  • mytb-edge-data:/data - mounts the host’s dir mytb-edge-data to ThingsBoard Edge DataBase data directory
  • mytb-edge-logs:/var/log/tb-edge - mounts the host’s dir mytb-edge-logs to ThingsBoard Edge logs directory
  • thingsboard/tb-edge-monolith:3.3.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 CE/PE version is running:

  • DO NOT use ‘localhost’ - ‘localhost’ is the ip address of the edge service in the docker container.
  • Use thingsboard.cloud in case you are connecting edge to ThingsBoard Cloud.
  • Use X.X.X.X IP address in case edge is connecting to the cloud instance in the same network or in the docker.
  • Or use demo.thingsboard.io if you are connecting edge to ThingsBoard Live Demo for evaluation.

If ThingsBoard Edge is going to be running on the same machine where ThingsBoard Professional Edition/Community Edition server is running you’ll need to update docker compose port mapping.

Please update next lines of docker compose:
ports:
- “18080:8080”
- “11883:1883”
- “15683:5683/udp”

Please make sure ports above are not used by any other application.

NOTE: For running docker compose commands you have to be in a directory with docker-compose.yml file.

Execute the following command to up this docker compose directly:

1
2
docker-compose pull
docker-compose up

In order to get access to necessary resources from external IP/Host on Windows machine, please execute the following commands:

1
2
3
4
set PATH=%PATH%;"C:\Program Files\Oracle\VirtualBox"
VBoxManage controlvm "default" natpf1 "tcp-port8080,tcp,,8080,,8080"  
VBoxManage controlvm "default" natpf1 "tcp-port1883,tcp,,1883,,1883"
VBoxManage controlvm "default" natpf1 "tcp-port5683,tcp,,5683,,5683"

Where:

  • C:\Program Files\Oracle\VirtualBox - path to your VirtualBox installation directory

Step 3. Open ThingsBoard Edge UI

Once started, you will be able to open ThingsBoard Edge UI using the following link http://localhost:8080.

If during installation process you have changed edge HTTP_BIND_PORT please use that port instead for Edge UI URL:

http://localhost:HTTP_BIND_PORT

Please use your tenant credentials from local cloud instance, ThingsBoard Cloud or ThingsBoard Live Demo to log in to the ThingsBoard Edge.

Step 4. Detaching, stop and start commands

You can detach from session terminal with Ctrl-p Ctrl-q - the container will keep running in the background.

In case of any issues you can examine service logs for errors. For example to see ThingsBoard Edge node logs execute the following command:

1
docker-compose logs -f mytbedge

To stop the container:

1
docker-compose stop

To start the container:

1
docker-compose start

Troubleshootings

NOTE If you observe errors related to DNS issues, for example

1
127.0.1.1:53: cannot unmarshal DNS message

You may configure your system to use Google public DNS servers

Next Steps

Congratulations! You have successfully provisioned, installed and connected ThingsBoard Edge to ThingsBoard server.

You can continue with Getting started guide to get the basic knowledge of ThingsBoard Edge or you can jump directly to more advanced topics: