# Self-host ThingsBoard

> An IoT platform to collect, store and visualise device data, in one container with its own PostgreSQL.

- Page: https://levelrail.com/templates/thingsboard/
- JSON: https://levelrail.com/templates/thingsboard.json
- Category: Applications
- Licence: Apache-2.0 (Permissive license)
- Source: https://github.com/thingsboard/thingsboard
- Upstream docs: https://thingsboard.io/docs/

## Requirements
- Memory: about 4 GiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 4.2.1.1

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| thingsboard | thingsboard/tb-postgres | 4.2.1.1 | 8080, 1883 | data -> /data; logs -> /var/log/thingsboard |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| thingsboard | TB_QUEUE_TYPE | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy thingsboard --name my-thingsboard
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/thingsboard/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## First run
1. Sign in as tenant@thingsboard.org with password tenant and change it at once. The first start takes several minutes.

## Questions

### Can I deploy ThingsBoard on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id thingsboard for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image thingsboard/tb-postgres:4.2.1.1 is what you deploy there.

Self-host ThingsBoard, ThingsBoard docker compose file, deploy ThingsBoard on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
