Install with Docker
BetaTBMQ Lite is the single-node edition of TBMQ: one container and one data volume, with no Kafka, PostgreSQL or Valkey beside it. It keeps TBMQ’s MQTT 3.1, 3.1.1 and 5 handling, persistent sessions with durable offline queues, retained messages, all five authentication providers, the REST API and the web UI, and stores everything in an embedded database on the volume. It supports DEVICE clients only. To see how it differs from clustered TBMQ, read Lite compared with TBMQ.
Supported hosts
Section titled “Supported hosts”| Host | Architectures | Status |
|---|---|---|
| Linux with Docker Engine | linux/amd64, linux/arm64 |
Supported. One image serves both architectures. |
| Raspberry Pi OS, 64-bit | linux/arm64 |
Supported. A 32-bit OS cannot run the image. |
| Windows and macOS with Docker Desktop | linux/amd64, linux/arm64 |
Supported. Use a named volume, as in the commands below. |
The broker is sized for a container with 2 CPUs and 2 GB of memory, where it sustains 15,000 msg/s of QoS 1 throughput across 10,000 clients; it also starts in less memory. See Guarantees and limits for how it was measured.
Install
Section titled “Install”docker run -d --name tbmq-lite --restart unless-stopped \ -p 1883:1883 -p 8083:8083 -p 8084:8084 \ -v tbmq-lite:/data thingsboard/tbmq-lite:2.5.0-betaservices: tbmq-lite: image: thingsboard/tbmq-lite:2.5.0-beta container_name: tbmq-lite restart: unless-stopped ports: - "1883:1883" - "8083:8083" - "8084:8084" volumes: - tbmq-lite:/data
volumes: tbmq-lite: name: tbmq-liteStart it from the directory of docker-compose.yml:
docker compose up -d| Port | Purpose |
|---|---|
1883 |
MQTT over TCP |
8083 |
HTTP: the web UI, the REST API and the health endpoint |
8084 |
MQTT over WebSocket, used by the web UI’s WebSocket client page |
The TLS listeners (MQTTS on 8883, WSS on 8085) are off until you enable them, see
Configuration.
The data volume
Section titled “The data volume”Everything the broker keeps lives under /data: the store in /data/db and the checkpoints taken before an upgrade in
/data/backups. Both commands above mount the named volume tbmq-lite there, so the data survives when the container
is removed. Without -v, Docker keeps /data in an unnamed volume that a new container does not reuse: after an
upgrade or a recreate the broker starts empty.
The broker runs as the non-root user with uid and gid 799. A named volume needs no preparation. A bind mount must be a
directory that uid 799 can write, otherwise the broker cannot open its store:
sudo mkdir -p /srv/tbmq-litesudo chown 799:799 /srv/tbmq-litedocker run -d --name tbmq-lite --restart unless-stopped \ -p 1883:1883 -p 8083:8083 -p 8084:8084 \ -v /srv/tbmq-lite:/data thingsboard/tbmq-lite:2.5.0-betaFirst sign-in
Section titled “First sign-in”Open http://localhost:8083 (or the host’s address) and sign in as the system administrator:
| Field | Value |
|---|---|
| Username | sysadmin@thingsboard.org |
| Password | sysadmin |
The broker does not let this password in: it asks for a new one at once. The new password must meet the password
policy and may not be sysadmin. After you set it, you are signed in.
Set the password at install
Section titled “Set the password at install”To start with a password of your own, set TBMQ_ADMIN_PASSWORD on the first start, with your password in place of
choose-a-strong-password, and sign in with it instead of sysadmin:
docker run -d --name tbmq-lite --restart unless-stopped \ -p 1883:1883 -p 8083:8083 -p 8084:8084 \ -e TBMQ_ADMIN_PASSWORD='choose-a-strong-password' \ -v tbmq-lite:/data thingsboard/tbmq-lite:2.5.0-betaservices: tbmq-lite: image: thingsboard/tbmq-lite:2.5.0-beta container_name: tbmq-lite restart: unless-stopped ports: - "1883:1883" - "8083:8083" - "8084:8084" environment: TBMQ_ADMIN_PASSWORD: 'choose-a-strong-password' volumes: - tbmq-lite:/data
volumes: tbmq-lite: name: tbmq-liteWrite each $ in the password as $$, and each ' as ''. Compose reads $ as the start of a variable:
Str0ng$ecret would set the password Str0ng. Then start it for the first time:
docker compose up -d- It applies only when the broker creates the system administrator, that is, on the first start with an empty volume. Changing or removing the variable later does nothing; change the password in the UI from the account’s profile instead.
- It is used exactly as set, without trimming. It must be 6 to 72 characters long, at most 72 bytes in UTF-8, and not
sysadmin, otherwise the broker does not start and the log names the variable.
Administrators you add later on the Users page with the default password are also asked to change it at their first sign-in.
After signing in, continue with Getting started.
Logs, health and stopping
Section titled “Logs, health and stopping”The broker logs to standard output:
docker logs -f tbmq-liteThe first line shows what the start script read from the container’s limits and which JVM settings it chose, for example:
TBMQ Lite: memory 2048 MiB, CPUs 2 (cgroup v2), collector G1, max direct memory 204 MiB, jemalloc onHealth check
Section titled “Health check”The image has a Docker health check, so docker ps shows the container as healthy once the broker is up.
- Every 10 seconds it requests
/actuator/healthon the HTTP port inside the container and passes when the status isUP. - It follows
HTTP_BIND_PORT, andHTTP_BIND_ADDRESSwhen that names one address. It needs the default actuator base path. - With
SSL_ENABLED=true(HTTPS on the HTTP port) it only checks that the port accepts a connection. - To turn it off, run the container with
--no-healthcheck, or sethealthcheck: disable: truein Compose.
Stop and start
Section titled “Stop and start”Stop and start the broker with docker stop tbmq-lite and docker start tbmq-lite. Docker’s default stop timeout of
10 seconds covers the broker’s shutdown, which waits up to STANDALONE_SHUTDOWN_DRAIN_TIMEOUT_MS (4 seconds by
default) for the publishes in flight. If you raise that value, raise --stop-timeout with it.
Upgrade
Section titled “Upgrade”Upgrade by recreating the container with the new image and the same volume:
-
Back up the store.
Download a backup first, see Backup and restore.
-
Recreate the container.
Terminal window docker pull thingsboard/tbmq-lite:<new version>docker stop tbmq-litedocker rm tbmq-litedocker run -d --name tbmq-lite --restart unless-stopped \-p 1883:1883 -p 8083:8083 -p 8084:8084 \-v tbmq-lite:/data thingsboard/tbmq-lite:<new version>The
docker runline is the install command with the new tag. Run it with the options the broker was started with: the same-esettings and the same-vmounts. Without them the new container drops those settings, and a broker that kept its data in a bind mount starts on an emptytbmq-litevolume instead.With Compose, set the new tag in
docker-compose.ymland run this instead. Compose pulls the image and recreates the container on the same volume:Terminal window docker compose up -d -
Check the log.
On start the broker upgrades the store when the new version needs it. Before it changes anything, it takes a checkpoint named
pre-upgrade-<from>-<to>under/data/backupsand keeps the three newest.
A store written by a newer version is refused: going back to an older image is not supported, restore a backup taken with that version instead.
Uninstall
Section titled “Uninstall”docker rm -f tbmq-litedocker volume rm tbmq-liteWas this helpful?