DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
FREEDOM251

Freedom251 › Blog › Developer Tools

MQTT TUI: How to Use mqttui to Subscribe and Publish from the Terminal

By Freedom251 Team · · 4 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

mqttui is a terminal MQTT client for quickly subscribing to topics and publishing messages. Its README documents an interactive topic view, a publish command, retained publishing, payloads read from standard input, and a logging mode that writes received messages to standard output. You need access to an MQTT broker; the documented default is mqtt://localhost.

What is mqttui?

mqttui is EdJoPaTo’s terminal user interface for MQTT. The project describes its purpose as “Subscribe to a MQTT Topic or publish something quickly from the terminal.” It is intended for a quick terminal workflow rather than a graphical connection manager or a collection of single-purpose shell commands. The project README documents its features and examples at github.com/EdJoPaTo/mqttui.

As an Amazon Associate I earn from qualifying purchases.

MQTT is a lightweight publish/subscribe messaging protocol, as described by the Eclipse Mosquitto MQTT manual. Clients communicate through a broker: publishers send messages to topics, and subscribers receive messages for topics to which they subscribe. That makes a broker connection the first requirement for using mqttui.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What can you do with mqttui?

Subscribe interactively

The README documents an interactive mode that can subscribe to all topics or to a selected topic. Use a narrower topic when you know what you are looking for; subscribing broadly can show traffic unrelated to your test. The README’s default broker URI is mqtt://localhost, so that address is appropriate only when a broker is reachable on the same machine.

Publish a message

The publish subcommand accepts a topic and payload. The README also documents retained publishing, which asks the broker to keep the latest retained message for a topic for future subscribers, and reading the payload from standard input. This makes it possible to send a short test payload directly or pipe generated content from another command.

Choose the topic and payload deliberately: subscribers act on messages they receive, and the project’s quick-publish workflow does not replace checking what the receiving application expects.

Log incoming messages

A separate logging mode writes received messages to standard output. The README’s example includes the topic, QoS, payload, and retained-message information. Standard output makes this mode useful when you want to capture or pipe message output instead of viewing it in the interactive interface.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to install mqttui

The project README documents two installation routes: download and extract a release archive, then put the binary somewhere on your PATH; or clone the source and build or install it with Cargo. It also gives Windows archive guidance. Release versions and supported architectures can change, so check the current README and release assets before choosing an archive rather than relying on an old filename or version.

How to connect it to a broker

  1. Choose a broker. Use a broker you control or are authorized to access. For a local broker, mqttui documents mqtt://localhost as its default URI.
  2. Check the connection details. Confirm the broker address and any required credentials or transport settings in the current project documentation and your broker’s configuration.
  3. Start with a focused subscription or test topic. Subscribe to the topic you expect to inspect, or publish a non-sensitive test message to a topic designated for testing.
  4. Inspect the result. Confirm the topic and payload shown by the subscriber or logger match what you sent. Avoid putting secrets or private data into a public test broker.

The README demonstrates test.mosquitto.org as a public test broker. Treat it as an example for testing, not a private or production destination: public brokers are not suitable for confidential messages or controlled application traffic.

How mqttui compares with other MQTT clients

Tool Interface and workflow Documented capabilities Good fit when
mqttui Interactive terminal interface, with separate publish and logging modes. Topic subscription, publishing, retained messages, stdin payload input, and stdout logging are documented in the project README. A protocol-version matrix and transport details are not stated there. You want a terminal-based live topic view or a quick message without opening a desktop application.
MQTTX Cross-platform desktop client; MQTTX also has a separate CLI. The MQTTX manual describes MQTT 5.0 connection testing, publishing and subscribing, WebSocket support, and payload format conversion. The MQTTX CLI README describes a command-line MQTT 5.0 client. You prefer a desktop interface or need the manual’s documented WebSocket and payload-conversion features.
Mosquitto command-line clients Individual commands, including mosquitto_pub and mosquitto_sub, supplied with the Mosquitto package according to the MQTT.org software catalog. Separate publish and subscribe command workflows; consult the package documentation for options relevant to your installation. You want command-oriented use that can be incorporated into scripts or shell pipelines.

These tools suit different interaction styles; the cited documentation does not establish a like-for-like performance comparison. Choose by whether you need an interactive terminal view, a desktop workflow, or discrete commands for automation, and verify protocol and transport requirements against the tool documentation for your broker.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When you do not already have a broker

You need a broker to exchange MQTT messages. If you do not have one, use a public test broker only for non-sensitive experiments, or arrange a broker you control. MQTTX’s documentation describes EMQX Cloud as a public broker for testing, but no particular hosted service is required to use mqttui.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Developer ToolsIoTMQTTmqttuiterminal tools

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.