Run TDengine 3 in Docker and model devices with super tables, tags, and time-series queries.
TDengine is a time-series database designed for IoT and telemetry. Its super-table model groups many device tables under one schema, which keeps queries simple without sacrificing per-device storage. This lab creates a super table, two devices, and a few queries.
docker compose up -d
docker compose cp examples/01_schema.sql tdengine:/tmp/01_schema.sql
docker compose cp examples/02_queries.sql tdengine:/tmp/02_queries.sql
docker compose exec tdengine taos -f /tmp/01_schema.sql
docker compose exec tdengine taos -f /tmp/02_queries.sql| Field | Value |
|---|---|
| Native port | 6030 |
| REST port | 6041 |
| User | root |
| Password | taosdata |
| CLI | docker compose exec tdengine taos |
| REST | http://localhost:6041/rest/sql |
| File | What it shows |
|---|---|
docker-compose.yml |
Engine, ports, and persistent volume. |
.github/workflows/compose-check.yml |
Validates the Compose file on every push. |
examples/01_schema.sql |
Database, super table, and two device tables. |
examples/02_queries.sql |
Aggregate the super table and inspect device tags. |
- Add a third device and query the last 10 readings across all devices.
- Use
INTERVAL(1m)to bucket readings and compute the average current. - Query the REST endpoint with
curland theroot:taosdatacredentials. - Create a stream that writes a downsampled table.
- The default
rootpassword istaosdata. Change it before exposing the ports. - TDengine 3 uses super tables and tags instead of a traditional relational schema for devices.
- The REST endpoint accepts SQL in the request body with Basic authentication.
- Data persists in the
tdengine-datavolume.
This lab publishes its ports on 127.0.0.1 only. To use it from another country, do not open the database port to the internet. Pick one:
- VPS + private tunnel: run the lab on a small Ubuntu VPS, keep the port closed, and connect through WireGuard or
ssh -L. - Managed service: use a managed free tier for this engine and point the same examples at its connection string.
- HTTP UI only: if the engine has a web UI, put it behind Caddy with TLS and basic auth.
The shared checklist, provider map, and commands are in REMOTE-ACCESS.md.
docker compose down -v-v also removes the named volume, so the next start is a clean slate.
Part of the database-labs collection: 26 database engines, one index.
MIT (c) 2026 Arya Fatthurahman. See LICENSE.