# mqtt2discord

> Self-hosted Python bridge that listens on MQTT topics and posts payloads to Discord channels via webhooks, with no bot registration.

- **Category:** [Bridges](https://selfhost.directory/bridges)
- **Source model:** Open source
- **Latest version:** v1.0.0
- **Author:** opensource-auke
- **Platforms:** Docker, Python
- **Requires:** MQTT Broker
- **Tags:** Iot, Mqtt, Discord, Home Automation, Docker, Python, Webhook, Heartbeat

## Docker images

- [`registry.gitlab.com/opensource-auke/mqtt2discord/mqtt2discord`](https://registry.gitlab.com/opensource-auke/mqtt2discord/mqtt2discord)
- [`aukevanderheide/mqtt2discord`](https://hub.docker.com/r/aukevanderheide/mqtt2discord) — Docker Hub mirror

## What is mqtt2discord?

mqtt2discord is a small Python bridge for homelab and IoT setups: it subscribes to MQTT topics on a broker you point it at and forwards each payload into a Discord channel using a channel webhook, which means you never register a Discord bot. Routing is many-to-many — you can add as many topic entries as you like, send several topics into the same channel, or fan one topic out to several channels, and each entry can optionally push a startup message. A heartbeat option can publish a JSON health summary (version, activity, send/receive counters) to a topic at a chosen interval, with an optional timezone for those timestamps. To run it yourself you copy config.json.sample to src/config.json and fill in broker host, port, optional username/password, timezone, heartbeat and topics; then either install the requirements with pip3 and run main.py, or use the container image from the GitLab registry (also mirrored on Docker Hub) with docker run, docker compose or Docker Swarm. The latest release is v1.0.0 from May 2022 and the repository's last activity is October 2023, and no licence file or licence statement is given in the sources.

## Should you self-host mqtt2discord?

mqtt2discord scores **43/100** on selfhost.directory ([how scoring works](https://selfhost.directory/scoring)) and ranks **#5 of 6** in [Bridges](https://selfhost.directory/bridges).

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available.

Its closest alternative on selfhost.directory is [Matrix-Telegram bridge](https://selfhost.directory/project/matrix-telegram-bridge) (65/100, 1 765 stars). It scores higher overall, so compare the two before you pick. [See mqtt2discord vs Matrix-Telegram bridge side by side.](https://selfhost.directory/compare/matrix-telegram-bridge-vs-mqtt2discord)

## Features

- Heartbeat health-check
- MQTT authentication
- MQTT to Discord message relay
- Multiple topics to multiple channels
- Per-channel startup message
- Timezone for heartbeat timestamps — Documented as available from version 1.0.1
- Webhook-based delivery (no bot registration)

## How to install mqtt2discord

### Install mqtt2discord with Docker

```bash
docker run --rm \
  -it \
  --name $app \
  -v "$PWD/src/config.json":/usr/src/bot/config.json \
  registry.gitlab.com/opensource-auke/mqtt2discord/mqtt2discord:latest
```

Note: Also documented for Docker compose (`docker compose up -d`) and Docker Swarm with the config passed as a swarm config.

### Install mqtt2discord with Python

You must have **python3** installed.

Install the requirements for the app

```bash
cd src
pip3 install -r requirements.txt
```

Run the app
```bash
python3 main.py
```

## mqtt2discord alternatives

- [Zigbee2MQTT](https://selfhost.directory/project/zigbee2mqtt): Open-source, self-hosted Zigbee-to-MQTT bridge that replaces proprietary vendor hubs, controlling thousands of devices via one USB coordinator and any MQTT broker. (compare: https://selfhost.directory/compare/mqtt2discord-vs-zigbee2mqtt)
- [mqttui](https://selfhost.directory/project/mqttui): MQTTUI is a self-hosted, open-source web app for monitoring and automating MQTT infrastructure with multi-broker support, rules engine, and alerting. (compare: https://selfhost.directory/compare/mqtt2discord-vs-mqttui)
- [amcrest2mqtt](https://selfhost.directory/project/amcrest2mqtt): Self-hosted open-source bridge that exposes all events from Amcrest cameras to an MQTT broker with built-in Home Assistant discovery support. (compare: https://selfhost.directory/compare/amcrest2mqtt-vs-mqtt2discord)
- [discord-rss-bot](https://selfhost.directory/project/discord-rss-bot): Self-hosted Discord bot that monitors RSS feeds and posts updates to channels in real-time with configurable intervals and Docker support. (compare: https://selfhost.directory/compare/discord-rss-bot-vs-mqtt2discord)
- [matterbridge](https://selfhost.directory/project/matterbridge): Self-hosted chat bridge daemon relaying channels between Discord, IRC, Matrix, Slack, Telegram, XMPP and Mattermost, with nickname spoofing, file relay and a REST API. (compare: https://selfhost.directory/compare/matterbridge-vs-mqtt2discord)
- [DockerDiscordControl](https://selfhost.directory/project/dockerdiscordcontrol): A self-hosted open-source Discord bot and web dashboard for managing Docker containers remotely — control, monitor, and automate from chat. (compare: https://selfhost.directory/compare/dockerdiscordcontrol-vs-mqtt2discord)
- [broadlink-mqtt](https://selfhost.directory/project/broadlink-mqtt): Self-hosted open-source MQTT client that bridges BroadLink smart home devices (RM, SP, A1, MP1, Dooya, BG1) to an MQTT broker for home automation integration. (compare: https://selfhost.directory/compare/broadlink-mqtt-vs-mqtt2discord)
- [DashCord](https://selfhost.directory/project/dashcord): A self-hosted Discord bot that turns chat messages, file uploads, and button panels into webhook calls for automation tools like n8n, Make, Zapier, and Node-RED. (compare: https://selfhost.directory/compare/dashcord-vs-mqtt2discord)

## More in Bridges

- [OpenCode Chat Bridge](https://selfhost.directory/project/opencode-chat-bridge): Self-hosted open-source bot connecting ACP agents like OpenCode and Ferrum to Matrix, Slack, WhatsApp, Discord, Telegram, and a web widget with permission-based security.
- [Zigbee2MQTT](https://selfhost.directory/project/zigbee2mqtt): Open-source, self-hosted Zigbee-to-MQTT bridge that replaces proprietary vendor hubs, controlling thousands of devices via one USB coordinator and any MQTT broker.
- [iGotify-Notification-Assistent](https://selfhost.directory/project/igotify-notification-assistent): Self-hosted bridge forwarding Gotify notifications to iOS via Apple's push service and SecNtfy, with end-to-end encryption and a native iOS app.
- [Matrix-Discord bridge](https://selfhost.directory/project/matrix-discord-bridge): Self-hosted open-source bridge connecting Matrix and Discord for using Matrix clients with Discord chats, featuring webhook relay and encryption.
- [Matrix IRC Bridge](https://selfhost.directory/project/matrix-irc-bridge): Self-hosted, open-source IRC bridge that connects Matrix homeservers to IRC networks with two-way messaging, private messages, and dynamic channel mapping.
- [Matrix Signal bridge](https://selfhost.directory/project/matrix-signal-bridge): A Matrix-Signal puppeting bridge
- [Matrix-Telegram bridge](https://selfhost.directory/project/matrix-telegram-bridge): Self-hosted open-source bridge connecting Matrix and Telegram with puppeting, relaybot, and double puppeting support for seamless cross-platform messaging.
- [mautrix-gmessages](https://selfhost.directory/project/gmessages): Self-hosted Matrix bridge for Google Messages (RCS/SMS) with media, reactions, typing notifications, read receipts, and automatic portal creation.
- [mautrix-googlechat](https://selfhost.directory/project/googlechat): An open-source, self-hosted Matrix bridge connecting Google Chat to Matrix for two-way messaging with media, threads, reactions, and multi-user support.

## Links

- [Homepage](https://gitlab.com/opensource-auke/mqtt2discord)
- [Project wiki](https://gitlab.com/opensource-auke/mqtt2discord/-/wikis/home)
- [GitLab container registry](https://gitlab.com/opensource-auke/mqtt2discord/container_registry/3058173)

---
Source: https://selfhost.directory/project/mqtt2discord