Disclosure: Some links in this article are affiliate links. We may earn a commission on qualifying purchases at no extra cost to you.
Zigbee2MQTT turns a cheap USB dongle into a fully local Zigbee network that talks to Home Assistant — or to almost anything else — over MQTT, with no cloud dependency and no vendor lock-in. It's the reason a $30 stick can outlive three generations of proprietary hubs: as long as MQTT and Node.js exist, your Zigbee network keeps working.
The problem is that most setup guides floating around are a version or two behind. Zigbee2MQTT moved from npm to pnpm, deprecated the old ezsp driver in favor of ember, and replaced manual YAML editing with a first-run onboarding wizard. Following outdated instructions is the single biggest reason new installs stall out on "no valid USB adapter found" or silently misconfigured backups.
This guide covers both realistic install paths — the Home Assistant add-on and the standalone/Docker route for a Raspberry Pi or NAS — at equal depth, plus the coordinator hardware decision that determines how well your mesh performs six months from now. It assumes no prior Zigbee experience but doesn't dumb down the parts that actually cause failures: channel selection, driver types, and backup strategy.
This guide is built for anyone setting up their first Zigbee2MQTT instance, migrating off a proprietary hub, or troubleshooting a shaky mesh that was set up without knowing the details below.
What You'll Need
- A Zigbee coordinator (USB dongle or networked adapter — see Step 1)
- A host to run Zigbee2MQTT: Home Assistant OS/Supervised, or any Linux box / Raspberry Pi / NAS for the standalone path
- An MQTT broker (Mosquitto, free)
- A USB 2.0 extension cable (0.5–1.5 m) — treat this as mandatory, not optional
- 20–30 minutes for the initial setup, plus time to pair each device afterward
Before You Start — What to Decide First
Two decisions made now will save hours of re-pairing later.
Pick your Zigbee stack once, and commit. Zigbee2MQTT (Z2M), ZHA (built into Home Assistant), and deCONZ/Phoscon are not interchangeable — migrating from one to another means re-pairing every single device. Z2M's main advantage is breadth: it currently supports 5,521 devices from 583 vendors, ahead of ZHA's list, plus deeper per-device configuration (reporting intervals, LED behavior, OTA updates) exposed directly through its UI and MQTT topics. If you're starting fresh and want maximum device compatibility and configurability, Z2M is the safer long-term bet.
Set your channel before you pair a single device. This is the mistake that causes the most rework. Z2M defaults to Zigbee channel 11, ZHA defaults to 15 — both were chosen to avoid the three non-overlapping Wi-Fi channels (1, 6, 11). The recommended Zigbee channels are 11, 15, 20, and 25. Changing the channel after devices are paired requires re-pairing most of them, and channel changes are only supported cleanly on zstack and ember adapters. Decide your channel in Step 6, not after the fact.
Step 1 — Choose Your Zigbee Coordinator
The coordinator is the one piece of hardware you shouldn't cheap out on or guess at — it determines your driver type, your backup/restore capability, and ultimately your mesh's stability.
| Coordinator | Chipset / Driver | Backup/Restore | Best for |
|---|---|---|---|
| SONOFF ZBDongle-P | TI CC2652P, zstack |
✅ Full support | Default recommendation for new Z2M builds |
| SONOFF ZBDongle-E | Silicon Labs EFR32MG21, ember (or deprecated ezsp) |
✅ with ember only |
Users who also want Thread/Matter flexibility |
| Phoscon ConBee II | deconz |
✅ since Z2M 2.5.0 | Existing deCONZ/Phoscon owners |
| SMLIGHT SLZB-06 | TI CC2652P + Ethernet/PoE, zstack |
✅ Full support | Central placement away from the server, PoE setups |
SONOFF ZBDongle-P is the community default and the one this guide recommends starting with. It ships pre-flashed with Z-Stack 3.x, uses the mature zstack driver with full coordinator backup support, and handles up to 50 direct child devices and 200 total on current firmware. Its one quirk: some Raspberry Pi 4 boards can't supply the dongle's power draw over a hub-heavy USB bus — a powered USB hub fixes it.
SONOFF ZBDongle-E uses the Silicon Labs EFR32MG21 chip and is worth considering if you also want Thread/Matter flexibility down the line. Make sure it's running the ember driver (EZSP firmware 7.4+) — the older ezsp driver is deprecated and doesn't support backups. Community reports also note occasional pairing trouble with Aqara sensors on this chipset specifically.
Phoscon ConBee II makes sense mainly if you're already running deCONZ/Phoscon and don't want to buy new hardware. Its deconz driver got a full backup/restore and channel-changing refactor in Z2M 2.5.0, closing the gap with zstack/ember adapters.
SMLIGHT SLZB-06 connects over Ethernet or PoE instead of USB, which solves the interference problem at the source — you can mount it centrally in the house instead of wherever your server happens to sit. It uses the same CC2652P chip and zstack driver as the ZBDongle-P, so it inherits the same backup support and device capacity.
Whichever you choose, a USB 2.0 extension cable is not optional. USB 3.0 ports and HDMI cables emit 2.4 GHz interference strong enough to meaningfully degrade Zigbee range — even 50 cm of separation makes a measurable difference. Plan on using one from the start rather than troubleshooting range complaints later.
Step 2 — Install Zigbee2MQTT via the Home Assistant Add-on
If you're already running Home Assistant OS or Supervised, this is the path of least resistance.
- Install the MQTT broker first: Settings → Add-ons → Add-on Store, search for Mosquitto broker (official Home Assistant add-on), install and start it. Create a dedicated Home Assistant user (e.g.
mqtt) for authentication — defaults are fine for a residential network. - Plug in your coordinator, ideally via the USB extension cable, away from the server chassis, HDMI ports, and USB 3.0 devices.
- In the Add-on Store, search for Zigbee2MQTT and install it.
- Start the add-on and open its Web UI. On first run, the onboarding wizard on port 8080 walks you through adapter detection (it auto-detects serial and mDNS adapters), MQTT connection settings, and initial preferences — no manual
configuration.yamlediting required.
This is the biggest practical change from older guides: Z2M 2.x replaced hand-written YAML setup with this wizard by default. If you ever need to force it to reappear, the environment variable Z2M_ONBOARD_FORCE_RUN=1 does it.
Step 3 — Install Zigbee2MQTT Standalone (Docker / Raspberry Pi / NAS)
If you're not running Home Assistant, or you prefer to keep Z2M decoupled from it (common on a NAS or a dedicated Pi), the standalone route works identically well.
Requirements: Node.js 20 or 22 (Node 18 was dropped in the 2.x line), and — since Z2M 2.0 — pnpm instead of npm. If you're upgrading an older bare-metal install, run npm install -g pnpm before pulling the new version.
Docker route (recommended for most standalone setups):
- Install Mosquitto as its own container (
eclipse-mosquittoimage) or viaapt install mosquitto mosquitto-clientson Debian/Raspberry Pi OS. Mosquitto 2.0+ defaults to local-only mode — for remote or authenticated access you need an explicitlistener,allow_anonymous false, and a password file generated withmosquitto_passwd. - Pull the official image:
ghcr.io/koenkk/zigbee2mqtt. It supports linux/386, amd64, arm/v6, arm/v7, arm64, and riscv64 — covering everything from an old Pi 3 to a NUC. - Mount a persistent
datadirectory and pass through the coordinator's USB device. - Start the container and open the web UI on port 8080 — the same onboarding wizard used in the add-on path runs here too.
On a Synology NAS specifically: DSM7 removed native USB serial support, so you'll need to load the usbserial or cdc-acm kernel modules manually before the container can see the dongle. This trips up a lot of first-time NAS installs — check it before assuming your dongle is faulty.
Note on architecture: if you're instead running the Home Assistant OS add-on, it only supports 64-bit hosts (aarch64/amd64) — 32-bit boards like the Sonoff iHost or an old armv7 Pi can't run it. The standalone Docker path is more forgiving on older hardware.
Step 4 — Complete the First-Run Setup Wizard
Whichever path you took, the wizard handles the same core decisions:
- Adapter detection — confirm it found your coordinator on the correct serial port (or
tcp://address for a networked coordinator like the SLZB-06). - Driver selection — the wizard should auto-select the correct driver (
zstackfor TI-based dongles,emberfor current-firmware Silicon Labs dongles,deconzfor ConBee). If you're on an EFR32-based dongle and it defaults toezsp, update the adapter firmware and switch toembermanually —ezspis deprecated and doesn't support coordinator backups. - MQTT connection — point it at your broker's address, port (1883 by default), and credentials if you set any.
- Frontend and network settings — this is also where you'll set your Zigbee channel (see Step 6 before finalizing this).
Step 5 — Connect Zigbee2MQTT to Home Assistant via MQTT
If you installed Z2M standalone (outside Home Assistant), or even via the add-on, you still need the MQTT integration to get devices into HA's device and entity registry.
- In Z2M's configuration, set
homeassistant: true— this enables MQTT auto-discovery. - In Home Assistant, go to Settings → Devices & Services → Add Integration → MQTT. If it's the official add-on, choose "Use the official Home Assistant add-on"; otherwise enter your broker's host, port, and credentials manually.
- Once connected, Z2M-paired devices — lights, switches, sensors, locks, covers, and groups — appear automatically as HA entities, editable from the UI without a restart.
If the MQTT integration shows "Failed to connect" during autodetection, it's usually a harmless timeout — adding it manually resolves it in most cases. If devices simply don't show up in HA at all, it's almost always one of two things: homeassistant: true wasn't set in the Z2M config, or the MQTT integration was never added.
Step 6 — Set Your Zigbee Channel Before Pairing Devices
This step belongs before pairing, not after. In the Z2M configuration's advanced section, set channel to one of the recommended values — 11, 15, 20, or 25 — chosen to avoid overlap with the three non-overlapping Wi-Fi channels (1, 6, 11). If you're running both Z2M and ZHA on separate dongles, keep them on different channels (Z2M defaults to 11, ZHA to 15) to reduce mutual interference.
Changing the channel later is disruptive: it's only supported cleanly on zstack and ember adapters, and even then it typically forces a re-pair of affected devices. Lock this in now.
Step 7 — Pair Your First Devices (Routers First, Then Battery Devices)
Order matters here more than most guides admit.
- Pair mains-powered routers first, starting with the ones closest to your coordinator and working outward. A router is any mains-powered device that extends the mesh — smart plugs are the easiest example. The SONOFF S31 Lite zb is a solid, inexpensive choice: it's a 15A Zigbee 3.0 plug with energy monitoring that doubles as a mesh router, fully local with OTA support through Z2M.
- Then pair battery-powered end devices — sensors, buttons, and similar — now that they have nearby routers to hop through. A motion sensor like the SONOFF SNZB-03P (6 m/110° detection, under 5-second response, roughly 3-year battery life on a single CR2477 cell) is a good low-cost way to test end-device pairing.
- Be deliberate about smart bulbs as "routers." Not every mains-powered device should be treated as a mesh anchor. Zigbee bulbs from brands like Sengled are intentionally designed as end devices rather than routers, specifically because a bulb that gets switched off at the wall makes an unreliable router — the deliberate design choice avoids that failure mode. Use dedicated plugs or purpose-built repeaters for mesh routing, not bulbs.
- Watch for Aqara/Xiaomi pairing trouble. These devices deviate slightly from the Zigbee spec and are known to drop off cheaper or non-compliant routers. Aqara hubs, Tuya/Sonoff plugs, and IKEA repeaters are the commonly reported compatible routers if you're building a mesh around Aqara sensors.
Step 8 — Back Up Your Coordinator
Once your mesh is stable, back it up — and back up the right thing. Only the zstack and ember drivers support full coordinator backup and restore; deconz gained this in Z2M 2.5.0, but ezsp, zboss, and zigate still do not.
The recurring mistake here is backing up only database.db. A working restore needs the entire data/ directory: configuration.yaml, database.db, coordinator_backup.json, and state.json together. Copying the database alone is a common reason restores silently fail to bring devices back after a coordinator swap or SD card failure.
Common Mistakes to Avoid
- Running ZHA and Zigbee2MQTT against the same USB dongle. They can't share a coordinator. If you want both integrations active, use two separate dongles on two different channels.
- Sticking with the deprecated
ezspdriver on a Silicon Labs dongle. Update the adapter firmware to EZSP 7.4+ and switch toember— it's required for backup support and generally more stable. - Skipping the USB extension cable. This is the single most reported "fix" for range and dropout complaints, and it costs a few dollars.
- Changing the Zigbee channel after pairing dozens of devices. Decide the channel in Step 6, before pairing anything beyond a test device.
- Assuming any mains-powered device extends your mesh. Cheap bulbs and some plug models make poor routers; check a device's role before relying on it as a repeater.
- Backing up only
database.db. Back up the wholedata/directory or the restore won't bring your devices back. - On a Synology NAS, assuming a "faulty" dongle when it's a missing kernel module. DSM7 needs
usbserial/cdc-acmloaded manually before USB coordinators are visible to Docker.
Frequently Asked Questions
Q: Do I need Home Assistant to run Zigbee2MQTT?
No. Zigbee2MQTT runs standalone via Docker or a native Node.js install on a Raspberry Pi, NAS, or any Linux host, communicating purely over MQTT. Home Assistant integration is optional and handled through the standard MQTT integration with homeassistant: true enabled in the Z2M config.
Q: Should I choose Zigbee2MQTT or ZHA?
Zigbee2MQTT currently supports more devices (5,521 models across 583 vendors) and exposes deeper per-device configuration through its UI and MQTT topics. ZHA is simpler because it's built directly into Home Assistant with no separate broker to manage. Either is a reasonable choice — the real cost is switching later, since migrating between them means re-pairing every device.
Q: Which Zigbee coordinator should I buy?
For most new Z2M setups, the SONOFF ZBDongle-P (TI CC2652P, zstack driver) is the safest default: mature driver support, full coordinator backup, and strong device-capacity headroom. Consider the SLZB-06 if you want to place the coordinator away from your server over Ethernet or PoE, or the ZBDongle-E if you also want Thread/Matter flexibility.
Q: Is the ConBee II still a good choice for Zigbee2MQTT?
It works well, especially if you already own one from a deCONZ/Phoscon setup — Z2M 2.5.0 added full backup and channel-change support for the deconz driver, closing most of the gap with TI and Silicon Labs adapters. For a brand-new purchase, most of the community defaults to a zstack- or ember-based dongle instead.
Q: Why can't Zigbee2MQTT find my USB adapter?
This is usually a missing or incorrect adapter/port setting rather than a hardware failure — set both explicitly in the configuration rather than relying on auto-detection. On a Synology NAS, it's frequently a missing usbserial or cdc-acm kernel module rather than a bad dongle.
Q: How do I back up my Zigbee network before making changes?
Copy the entire data/ directory — not just database.db — which includes configuration.yaml, coordinator_backup.json, and state.json. This only works reliably on zstack and ember adapters (and deconz since Z2M 2.5.0); ezsp, zboss, and zigate don't support coordinator backup.
Conclusion
Zigbee2MQTT rewards a small amount of upfront planning: pick a coordinator with a supported driver, decide your channel before pairing anything, and treat the USB extension cable as mandatory rather than optional. Whether you install it through the Home Assistant add-on or standalone via Docker, the setup itself takes well under an hour — the pairing order and backup discipline afterward are what separate a mesh that stays reliable for years from one that needs troubleshooting every few months.
Once the coordinator and broker are running, building out the mesh is straightforward: add routers first, close to the coordinator, then fill in battery-powered sensors and switches as needed. From there, Zigbee2MQTT's device support and configurability make it one of the few smart home investments that keeps paying off as the network grows.



