HACS and Customization

Do I need MQTT for Home Assistant?

No, Home Assistant does not need MQTT. You need a broker only for devices such as Tasmota and Zigbee2MQTT. Here is how to tell and how to set one up.

On this page
  1. What MQTT is
  2. When you need MQTT
  3. When you don’t
  4. Set up a broker
  5. Topics, discovery and retained messages
  6. Keep it secure
  7. Common confusion

No. Home Assistant does not require MQTT. Most integrations work without it, including Hue, ZHA, Z-Wave JS, Matter, ESPHome and many cloud services. You need MQTT only for certain devices and tools that publish their data through it.

What MQTT is

MQTT is a messaging protocol. Devices publish messages to topics on a broker, and other software subscribes to those topics. It is not a hub, and it is not a device. It runs fully on your local network and does not need cloud access.

Installing the MQTT integration on its own is not enough. A broker must be running for the integration to connect to.

When you need MQTT

You need MQTT for:

When you don’t

  • ESPHome uses its own native API on port 6053 by default.
  • ZHA is the built-in alternative to Zigbee2MQTT. It does not use MQTT.
  • Hue, Z-Wave JS, Matter and most cloud services work without a broker.

If you run ESPHome or Tasmota, our comparison of the two explains how each one connects to Home Assistant.

Set up a broker

The simplest route on Home Assistant OS is the Mosquitto broker add-on:

  1. Go to Settings > Apps (older releases call this Add-ons) and install the Mosquitto broker add-on.
  2. Start the add-on.
  3. Go to Settings > Devices & services, where Home Assistant shows an auto-discovered MQTT integration. Accept it.
  4. Create a dedicated Home Assistant user for your devices. The Mosquitto add-on uses Home Assistant user accounts for authentication.

The usernames homeassistant and addons are reserved, so you can’t use them for devices.

On Container installs, run a broker separately, for example with the eclipse-mosquitto Docker image. For more on add-ons, see what Home Assistant add-ons are and how to install them.

Topics, discovery and retained messages

  • Discovery uses the homeassistant/ prefix by default. Devices publish their configuration to topics that follow the pattern homeassistant/<component>/<object_id>/config.
  • Retained messages keep the last value on the broker, so Home Assistant has a value after a restart.
  • QoS levels set delivery guarantees: 0 means at most once, 1 means at least once, and 2 means exactly once.

To debug topics, use a tool such as MQTT Explorer, or the Listen to a topic option on the MQTT integration’s settings page.

Keep it secure

Don’t expose port 1883, the unencrypted MQTT port, to the internet. If you need remote access, use TLS on port 8883 together with authentication. The Mosquitto add-on also offers WebSocket ports, 1884 and 8884.

Common confusion

  • Zigbee2MQTT doesn’t replace the broker. It publishes to one.
  • Installing the MQTT integration alone doesn’t start a broker. You still need Mosquitto or another broker running.
  • MQTT is not a device or a hub. It is a protocol that needs a broker.

The complete guide to hacs and customization

What Is HACS and How to Install It in Home Assistant
Read the guide

Keep exploring

Guides from other topics

All topics →