- Prerequisites
- Running
- Choose ThingsBoard queue service
- Initialize database schema & system assets
- Start the platform & tail logs
- Inspect logs & control container lifecycle
- Upgrading
- Troubleshooting
- Next steps
This guide will help you to install and start ThingsBoard using Docker on Linux or MacOS.
Prerequisites
Install Docker:
Running
Running this image requires a server with at least 4GB of RAM (8GB is recommended) and minimum load (few messages per second).
Choose ThingsBoard queue service
ThingsBoard platform currently supports two type of messaging brokers for storing the messages and communication between ThingsBoard services: In-memory and Kafka-based brokers.
-
In Memory queue implementation is built-in and default. It is useful for development(PoC) environments and is not suitable for production deployments or any sort of cluster deployments.
-
Kafka is recommended for production deployments. This queue is used on the most of ThingsBoard production environments now. It is useful for both on-prem and private cloud deployments. It is also useful if you like to stay independent from your cloud provider. However, some providers also have managed services for Kafka. See AWS MSK for example.
-
Confluent Cloud is a fully managed streaming platform based on Kafka. Useful for a cloud agnostic deployments.
See corresponding architecture page and rule engine page for more details.
ThingsBoard includes In Memory Queue service and use it by default without extra settings. Create docker compose file for ThingsBoard queue service:
Add the following lines to the yml file: |
Apache Kafka is an open-source stream-processing software platform. Create docker compose file for ThingsBoard queue service:
Add the following lines to the yml file. |
Confluent Cloud ConfigurationTo access Confluent Cloud you should first create an account, then create a Kafka cluster and get your API Key. Create docker compose file for ThingsBoard queue service:
Add the following line to the yml file. Don’t forget to replace “CLUSTER_API_KEY”, “CLUSTER_API_SECRET” and “localhost:9092” with your real Confluent Cloud bootstrap servers: You can update default Rule Engine queues configuration using UI. More about ThingsBoard Rule Engine queues see in documentation. |
Where:
8080:8080
- connect local port 8080 to exposed internal HTTP port 80801883:1883
- connect local port 1883 to exposed internal MQTT port 18838883:8883
- connect local port 8883 to exposed internal MQTT over SSL port 88837070:7070
- connect local port 7070 to exposed internal Edge RPC port 70705683-5688:5683-5688/udp
- connect local UDP ports 5683-5688 to exposed internal COAP and LwM2M portstb-postgres-data
- name of the docker volume that stores the PostgreSQL’s datathingsboard-ce
- friendly local name of the ThingsBoard containerrestart: always
- automatically start ThingsBoard in case of system reboot and restart in case of failure.image: "thingsboard/tb-node:4.0.1.1"
- ThingsBoard docker image and version.
Initialize database schema & system assets
Before you start ThingsBoard, initialize the database schema and load built-in assets by running:
1
docker compose run --rm -e INSTALL_TB=true -e LOAD_DEMO=true thingsboard-ce
Environment variables:
INSTALL_TB=true
- Installs the core database schema and system resources (widgets, images, rule chains, etc.).LOAD_DEMO=true
- Loads sample tenant account, dashboards and devices for evaluation and testing.
Start the platform & tail logs
Bring up all containers in detached mode, then follow the ThingsBoard logs:
1
docker compose up -d && docker compose logs -f thingsboard-ce
After executing this command you can open http://{your-host-ip}:8080
in you browser (for ex. http://localhost:8080
). You should see ThingsBoard login page.
Use the following default credentials:
- System Administrator: [email protected] / sysadmin
- Tenant Administrator: [email protected] / tenant
- Customer User: [email protected] / customer
You can always change passwords for each account in account profile page.
You can safely detach from the log stream (e.g. Ctrl+C); containers will continue running.
Inspect logs & control container lifecycle
If something goes wrong, you can stream the ThingsBoard container logs in real time:
1
docker compose logs -f thingsboard-ce
Bring down every container defined in your Compose file:
1
docker compose down
Launch all services in detached mode:
1
docker compose up -d
Upgrading
When a new CE release is available, follow these steps to update your installation without losing data:
-
Change the version of the
thingsboard/tb-node
in thedocker-compose.yml
file to the new version (e.g. 4.0.1) -
Execute the following commands:
1
2
3
4
docker pull thingsboard/tb-node:4.0.1
docker compose stop thingsboard-ce
docker compose run --rm -e UPGRADE_TB=true thingsboard-ce
docker compose up -d
Troubleshooting
DNS issues
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. See corresponding Linux and Mac OS instructions.
Next steps
-
Getting started guides - These guides provide quick overview of main ThingsBoard features. Designed to be completed in 15-30 minutes.
-
Connect your device - Learn how to connect devices based on your connectivity technology or solution.
-
Data visualization - These guides contain instructions on how to configure complex ThingsBoard dashboards.
-
Data processing & actions - Learn how to use ThingsBoard Rule Engine.
-
IoT Data analytics - Learn how to use rule engine to perform basic analytics tasks.
-
Hardware samples - Learn how to connect various hardware platforms to ThingsBoard.
-
Advanced features - Learn about advanced ThingsBoard features.
-
Contribution and Development - Learn about contribution and development in ThingsBoard.