Skip to content
Stand with Ukraine flag

Installing ThingsBoard Edge using Docker (Linux, macOS)

This guide provides step-by-step instructions for running ThingsBoard Edge on Linux or macOS using Docker.

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.

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 CE and Docker Compose before continuing.

To create a new Edge instance on your ThingsBoard Server:

  1. Sign in to your ThingsBoard 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.

    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.

Step 2. Create the docker-compose.yml file

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

ThingsBoard Edge supports different queue implementations. Choose the one that fits your deployment:

  • In Memory: Built-in default. Suitable for development and PoC environments. Not recommended for production.
  • Kafka: Recommended for production deployments.
  • Hybrid: Combines PostgreSQL and Cassandra with Kafka. Recommended for 1M+ devices or high data ingestion rates (5000+ msg/sec).

Create the docker-compose.yml file based on your chosen queue:

docker-compose.yml
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:
- tb-edge-data:/data
- tb-edge-logs:/var/log/tb-edge
postgres:
restart: always
image: "postgres:16"
ports:
- "5432"
environment:
POSTGRES_DB: tb-edge
POSTGRES_PASSWORD: postgres
volumes:
- tb-edge-postgres-data:/var/lib/postgresql/data
volumes:
tb-edge-data:
name: tb-edge-data
tb-edge-logs:
name: tb-edge-logs
tb-edge-postgres-data:
name: tb-edge-postgres-data

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:4.3.1.1ThingsBoard Edge Docker image
CLOUD_ROUTING_KEYYour Edge key
CLOUD_ROUTING_SECRETYour Edge secret
CLOUD_RPC_HOSTIP address or hostname of the ThingsBoard Server

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 the same default credentials listed in the Prerequisites section. You can change them in the Edge UI after logging in.

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, volumes, and networks:

Terminal window
docker compose down -v

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 Linux and macOS instructions.