From e5bd28ee30c74a803608b4affbaa109f3012940e Mon Sep 17 00:00:00 2001 From: Sam Hadow Date: Thu, 14 May 2026 14:07:37 +0200 Subject: [PATCH] discord bridge example --- ...f-hosting-a-matrix-instance-with-podman.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/_posts/2026-04-30-self-hosting-a-matrix-instance-with-podman.md b/_posts/2026-04-30-self-hosting-a-matrix-instance-with-podman.md index dd9a690..590a67b 100644 --- a/_posts/2026-04-30-self-hosting-a-matrix-instance-with-podman.md +++ b/_posts/2026-04-30-self-hosting-a-matrix-instance-with-podman.md @@ -313,3 +313,42 @@ register_new_matrix_user --user --config /data/homeserver.yaml ``` Or with the registration API, you can use [this script](https://git.hadow.fr/sam.hadow/Useful-scripts/src/branch/main/create_matrix_account.sh). + +## what about bridges? + +Bridges allow you to receive message from other services in matrix. In this section I'll give an example on how to self host a bridge alongside your matrix instance with the discord bridge. + +### discord bridge example + +Creating the initial bridge files: + +```bash +mkdir -p /home/data/podman/synapse/mautrix-discord +podman run --rm -v /home/data/podman/synapse/mautrix-discord:/data:z dock.mau.dev/mautrix/discord:latest +``` + +Create the database: *(adapt the password)* + +```bash +podman exec -it synapse-db /bin/bash +psql -U synapse +CREATE USER discordmautrix WITH PASSWORD 'password'; +CREATE DATABASE discordmautrix WITH OWNER = 'discordmautrix' ; +``` + +Then delete synapse container and recreate it with the bridge registration file: *(don't forget to regenerate, or adapt, the systemd service) + +```bash +podman run -d --pod=synapse \ +-e SYNAPSE_CONFIG_PATH=/data/homeserver.yaml \ +-v /home/data/podman/synapse/config:/data:Z \ +-v /home/data/podman/synapse/media:/data/media:z \ +-v /home/data/podman/synapse/logs:/data/logs:Z \ +-v /home/data/podman/synapse/mautrix-discord-registration.yaml:/data/mautrix-discord-registration.yaml:Z \ +--name=synapse-app \ +--label io.containers.autoupdate=registry docker.io/matrixdotorg/synapse:latest +``` + +#### using the bridge + +You'll then have access to a user "discord bridge bot" on your instance where you can log in into your discord account and then bridge your messages.