TBMQ Lite (beta): a self-contained MQTT broker with zero external dependencies
776 Try for free Menu

TBMQ live demo

Try TBMQ in your browser

A free account on our public broker. Open the TBMQ UI and connect your MQTT clients. No credit card required.

Rather run it yourself? Install on your own servers

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load the site search from Google. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics).

Remember the campaign or partner link you arrived from, so we know which campaign or partner brought you when you sign up or contact us (partner program). We do not use it to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

TBMQ Lite Beta: A Self-Contained MQTT Broker

On this page

TBMQ Lite is now in public beta. It is TBMQ for a single node: a self-contained MQTT broker with an embedded store, so there is no Kafka, PostgreSQL or Valkey to run beside it. It has the same MQTT 3.1, 3.1.1 and 5.0 broker and the same web UI as TBMQ, and it starts with one Docker command. The beta image is thingsboard/tbmq-lite:2.5.0-beta, for linux/amd64 and linux/arm64, and the beta covers TBMQ Lite only. Start with the TBMQ Lite docs or the product page.

TBMQ Lite TBMQ
Deployment One container Kafka, PostgreSQL and Valkey beside one or more broker nodes
Storage Embedded store on one volume Kafka, PostgreSQL, Valkey
Client types DEVICE DEVICE and APPLICATION
Integrations None HTTP, MQTT, Kafka
Throughput 15,000 msg/s (7,500 in + 7,500 out) on 2 CPUs and 2 GB Millions of msg/s
License Apache 2.0 Apache 2.0 (Community Edition)

What TBMQ Lite is

MQTT clients connect to TBMQ Lite, which runs the MQTT broker, the web UI and REST API, and an embedded store, and keeps everything on one data volume

TBMQ Lite and TBMQ are built from the same code. TBMQ Lite keeps TBMQ’s MQTT handling: MQTT 3.1, 3.1.1 and 5.0, persistent sessions with durable offline queues, retained messages, shared subscriptions, and the same five authentication providers (Basic, X.509, JWT, SCRAM and HTTP). It keeps the REST API and the web UI too.

What it leaves out is the infrastructure around the broker. Clustered TBMQ runs its nodes beside Kafka, PostgreSQL and Valkey. TBMQ Lite keeps sessions and their queues, retained messages, credentials, users and settings in an embedded store on one data volume.

It is built for production sites that fit one machine, for the edge, and for labs and laptops. Clustered TBMQ remains the broker for high availability and scale; when to choose it is covered below.

What’s in the beta

Install with one command

A docker run command starts TBMQ Lite on the tbmq-lite volume, and clients connect on ports 1883, 8084 and 8083

TBMQ Lite needs Docker and nothing else. One command starts it, with its data in a named volume. Choose the administrator password before the first start: TBMQ_ADMIN_PASSWORD applies only to an empty volume, see Set the password at install.

On a machine others can reach, start it with a password of your own in place of choose-a-strong-password:

Terminal window
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-beta

On a machine only you can reach, start it without one and set the password at the first sign-in:

Terminal window
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-beta
  • Ports. 1883 is MQTT over TCP, 8083 serves the web UI, the REST API and the health endpoint, and 8084 is MQTT over WebSocket. The TLS listeners (MQTTS on 8883, WSS on 8085) are off until you enable them.
  • The data volume. Everything the broker keeps lives under /data, in the tbmq-lite volume, so the data survives when the container is removed. To upgrade, recreate the container with the new image on the same volume. The broker takes a checkpoint before it upgrades the store.
  • Hosts. One image serves linux/amd64 and linux/arm64: Linux with Docker Engine, Raspberry Pi OS (64-bit), and Docker Desktop on Windows and macOS.
  • Compose and health. A Docker Compose file works the same way. The image has a Docker health check, so docker ps shows the container as healthy once the broker is up.

The install guide covers Compose, bind mounts and upgrades. Getting started takes a new broker from that command to messages flowing, including to a client that was offline when they were sent.

Secure from the first start

The administrator sets a password at the first start or the first sign-in, and Prometheus scrapes the metrics endpoint with a Bearer token

A new TBMQ Lite broker doesn’t keep its default administrator password. Signing in as sysadmin@thingsboard.org with sysadmin leads straight to a password change: the broker doesn’t let that password in, and the new one must meet the password policy and can’t be sysadmin.

Until someone sets the new password, whoever reaches port 8083 first can take the account. That is why, on a machine others can reach, the install command above sets TBMQ_ADMIN_PASSWORD on the first start. Administrators you add later on the Users page with the default password are asked to change it at their first sign-in, too.

Metrics are closed by default as well. Every actuator endpoint except /actuator/health and the /actuator links page needs a token. Set TBMQ_METRICS_TOKEN and send it as Authorization: Bearer <token>. Prometheus sends it with authorization::

scrape_configs:
- job_name: tbmq-lite
metrics_path: /actuator/prometheus
authorization:
credentials: a-long-random-token
static_configs:
- targets: ['tbmq-lite-host:8083']

Without the token, /actuator/prometheus and /actuator/info answer 401. TBMQ Lite exposes TBMQ’s Prometheus series, without those of Kafka, SQL write queues, APPLICATION clients and integrations. It adds series of its own for trimmed and expired queue messages, the message pipeline and the store’s memory. See Metrics token.

Acknowledged messages survive a crash

A publisher’s QoS 1 message is handed to online subscribers and written to the write-ahead log for persistent sessions before TBMQ Lite acknowledges it, and a persistent subscriber gets it when it reconnects

TBMQ Lite acknowledges a QoS 1 or QoS 2 publish, with PUBACK or PUBREC, once the message has been:

  • handed to every online subscriber without a persistent session, and
  • written to the store’s write-ahead log for every subscriber with a persistent session, and for the retained messages when the publish is retained.

That decides what a failure can lose:

  • Process crash (an out-of-memory exit, docker kill): no acknowledged message is lost. When the broker starts again, sessions pick up their queues.
  • Power cut or host crash: the write-ahead log reaches the disk about once a second by default, so up to about a second of acknowledged messages can be lost. STORE_WAL_SYNC=always syncs on every write and closes that window, at a cost in write throughput.
  • Duplicates: a QoS 1 or QoS 2 message in flight when the process dies can reach persistent subscribers twice. TBMQ has the same window.

Persistent queues have the same limits as in TBMQ: a persistent DEVICE client keeps up to 10,000 messages by default, each for a week by default. When a persistent copy can’t be written, for example because the disk is below the watermark, or when the message pipeline is full, the broker refuses the publish instead of acknowledging it. An MQTT 5 publisher gets an error reason code, and an MQTT 3.x publisher is disconnected.

Guarantees and limits has the details.

Backup and restore

An administrator backs up TBMQ Lite from the web UI, the REST API or the command line, and gets a tar.gz archive of the whole store

All of TBMQ Lite’s data is in its store: sessions and their queues, retained messages, credentials, providers, users, settings and statistics. A backup is a consistent copy of that store in one .tar.gz archive, and there are three ways to take one:

  • From the web UI, while the broker runs: Settings → General, then Download backup on the Backup card.
  • With the REST API, while the broker runs: GET /api/system/backup with a system administrator’s token streams the same archive, from a script or a scheduled job.
  • From the command line, with the broker stopped: a helper container writes the archive.

To restore, stop the broker, replace the store with the archive’s db directory and start it again. A backup from an older version is upgraded on start, and one from a newer version is refused. Before an upgrade changes the store, the broker also takes a pre-upgrade-<from>-<to> checkpoint, so you can go back if an upgrade fails.

  • The broker doesn’t back itself up: schedule backups and keep them off the host.
  • A backup holds the BCrypt hashes of the client and user passwords, so store it like a secret.
  • Don’t copy /data of a running broker either: the store keeps changing during the copy, and the copy may not open.

See Backup and restore.

The web UI you know

The TBMQ Lite web UI menu: Home, Sessions, Subscriptions, Authentication, WebSocket client, Retained messages, Shared subscriptions, Monitoring, Users and Settings, without Integrations, Kafka management and the APPLICATION shared subscriptions page

TBMQ Lite comes with TBMQ’s web UI: sessions and subscriptions, credentials and authentication providers, blocked and unauthorized clients, the WebSocket client, retained messages, shared subscription groups, monitoring, users and settings. The pages of features a single node doesn’t have are left out: Integrations, Kafka management, and the shared subscriptions page for APPLICATION clients.

TBMQ Lite has one client type, DEVICE, so the client credentials form has no client type field. A new broker opens the Home page with a getting-started dialog, and the WebSocket client page lets you publish and subscribe from the browser right after the first sign-in.

Start on Lite, move to TBMQ later

TBMQ Lite exports Basic credentials with their password hashes to a CSV file, which clustered TBMQ imports on its credentials page

If a deployment outgrows one node, its clients can keep their passwords. TBMQ Lite exports its Basic credentials to CSV with their BCrypt password hashes, and clustered TBMQ imports the file on its credentials page. The import needs a TBMQ version that reads password hashes: Moving credentials to TBMQ names it.

  1. In TBMQ Lite, go to Authentication → Credentials, click the Export to CSV icon, leave Include password hashes selected and click Export to CSV.
  2. In TBMQ, click + Add client credentials on the same page, choose Import Basic credentials and select the file.

X.509 and SCRAM credentials are not exported: move them with the REST API. Sessions and stored messages don’t move. With the hashes, the file holds secrets, so download it over HTTPS and delete it after use.

Performance

TBMQ Lite sustains 15,000 msg/s of QoS 1 traffic in and out on 2 CPUs and 2 GB with an ack p99 of 17 ms, and starts in about 8.5 s

We measured TBMQ Lite on one host, with the store’s volume throttled to the baseline of an AWS gp3 volume (3,000 IOPS, 125 MB/s), default settings, and each rate in one 10-minute run. The workload:

  • 10,000 MQTT clients, 9,000 publishers and 1,000 persistent DEVICE subscribers that each receive the topics of 9 publishers
  • QoS 1 both ways
  • 402-byte messages

Each publish reaches one subscriber, so the throughput, in + out, is twice the publish rate.

Container Highest sustained throughput Ack p99 (median / worst 10-s window)
2 CPUs, 2 GB (reference) 15,000 msg/s: 7,500 in + 7,500 out 17 / 52 ms
1 CPU, 2 GB (best effort) 7,500 msg/s: 3,750 in + 3,750 out 24 / 28 ms

“Sustained” means no lost, refused or dropped message, no trimmed or expired queue message, a pipeline that doesn’t grow, and an ack p99 under 100 ms in every 10-second window.

The footprint was measured separately:

Measurement Result
Startup until the health endpoint reports UP (2 CPUs, 2 GB, empty store) About 8.5 s, on amd64 and arm64
Memory at idle, 5 minutes after start 340–390 MiB on amd64, 430–500 MiB on arm64
Memory at 15,000 msg/s (in + out) for 60 minutes, 2 GB Levels off at 870–880 MiB (amd64)
Image size, uncompressed 277 MB on amd64, 296 MB on arm64

Memory is the resident memory (RSS) of the broker’s process. The Capacity section of the docs describes the runs in full.

Beta limits, and when to choose TBMQ

Three choices: TBMQ Lite when one machine carries the load and the clients are devices, a single TBMQ node for APPLICATION clients and integrations, and a TBMQ cluster for high availability and scale

TBMQ Lite is a beta, and it is deliberately smaller than TBMQ:

  • DEVICE clients only. APPLICATION clients, with their shared subscriptions, exist only in clustered TBMQ. TBMQ Lite refuses to create credentials of another type, and a client that an authentication provider marks as APPLICATION or INTEGRATION connects as a DEVICE client.
  • No integrations. The HTTP, Kafka and MQTT integrations need TBMQ, including the MQTT integration that bridges to another broker.
  • One node. No clustering, no failover, no node drain. Several TBMQ Lite containers are independent brokers.
  • Queue limits. A persistent DEVICE queue holds 10,000 messages by default. A backend that subscribes to the traffic of many devices fills it quickly: at 1,000 msg/s, the default covers 10 seconds offline.
  • Settings may change. Configuration keys and defaults may still change before the first release.

Pick a single TBMQ node if you need APPLICATION clients, integrations, or a backend subscriber that must buffer more than a DEVICE queue holds while it is offline. Pick a TBMQ cluster for high availability, or more traffic than one node carries. Lite compared with TBMQ puts the two side by side, and Guarantees and limits lists every limit.

Final words

TBMQ Lite brings TBMQ’s MQTT broker to the places where running Kafka, PostgreSQL and Valkey beside it isn’t worth it. On one machine you get the same MQTT handling and web UI, acknowledged messages that survive a crash, built-in backups, and a way to move your credentials to clustered TBMQ when you outgrow a single node.

It’s a beta, so try it and tell us what you find. Start with Getting started, and report problems, or limits we haven’t listed, as GitHub issues with TBMQ Lite in the title. Reported issues are tracked under the Lite label.

If you find TBMQ useful, support the project by starring the TBMQ GitHub repository and by opening issues or pull requests.

Run TBMQ Lite

A self-contained MQTT broker for one node: MQTT 3.1, 3.1.1 and 5.0, persistent sessions, the web UI and built-in backups. One Docker command, on amd64 and arm64.