How a Discord bridge fits a self-hosted Matrix server
If your team already runs Matrix and still needs access to Discord communities or direct messages during a transition, the bridge you add is mautrix-discord, one of the mautrix Go bridges. It runs as a separate process beside your homeserver and registers with the homeserver as an application service. The method is the homeserver's application service support, not a plugin loaded inside Synapse, so the bridge has its own configuration file, its own database connection and its own registration file that the homeserver must load. Its job is to relay messages, membership changes and media between Discord and Matrix rooms that you choose to map. It does not replace Discord, does not move your Discord history into Matrix, and does not make Discord users full Matrix accounts on your server. Discord-side users appear as ghost users that the bridge manages.
This page walks through planning, prerequisites, the configuration sequence, room and user mapping, security, testing and the points where bridges usually fail. Start by confirming the parts of the stack the bridge depends on: a homeserver that supports application services, PostgreSQL 16 or higher, and ffmpeg. The Discord bridge also uses LottieConverter for animated stickers, so decide early whether sticker support matters to your users. Confirm the exact versions against the mautrix bridge setup documentation before you install anything, since the requirements are set there and may change between bridge releases.
Note that the bridge follows the legacy architecture, so it does not offer the -e config generator flag that some newer mautrix bridges provide. Plan for writing and reviewing the configuration by hand, and keep that file under version control with secrets held outside it. Matrix.org lists four bridges for Discord, so the choice of mautrix-discord should be a deliberate decision, based on the features your teams need and on the maintenance you can support, not on the first result you find. Ask your bridge administrator and your security team to sign off on which Discord accounts and servers the bridge will act on before any configuration is applied.
What the homeserver, database and host need before installing mautrix-discord
Before any Discord bridge is configured, the homeserver, the bridge host and the Discord side each need to meet specific requirements. The cards below cover what the mautrix Go setup docs require, what to confirm on the Discord side, and how traffic moves between the three parts.
Homeserver with application service support
mautrix-discord runs as an application service (appservice) registered with your homeserver, so the homeserver must support application services. Confirm that your Synapse or other homeserver is configured to accept appservice registration files before you plan the rest of the build. Check that the bridge's registration file can be loaded without restarting into an unsupported mode, and record which homeserver version you tested against.
Bridge setup docsPostgreSQL 16 or higher
The mautrix Go bridges require PostgreSQL 16 or higher, which is a stricter floor than the PostgreSQL 14 minimum that recent Synapse releases use. Plan a separate database for the bridge rather than sharing one with the homeserver, so upgrades and backups can be scheduled independently. Ask your database team whether the version in your environment is supported and whether backups cover the bridge database.
ffmpeg for media conversion
The bridge converts media between Discord and Matrix formats, and ffmpeg performs that work on the bridge host. Install ffmpeg on the same host that runs the bridge binary, and confirm that the build includes the codecs your users send, such as the audio and video formats common in Discord messages. Test an upload in each direction before you open the bridge to users.
LottieConverter for animated stickers
Discord stickers and some emoji are animated Lottie files. The Discord bridge, along with the Telegram and WhatsApp bridges, uses LottieConverter to turn them into formats Matrix clients can display. Without it, animated stickers may arrive as unreadable attachments. Confirm the converter version and how it is installed on your bridge host, since the setup docs are the source for the exact requirement.
Discord application and bot permissions
The bridge acts on Discord through a Discord application with a bot account, and the permissions it needs determine which channels and direct messages it can read and relay. Decide which Discord servers will be bridged, then list the channel and message permissions the bot requires according to the bridge documentation. Confirm the exact permission set in the bridge docs before you grant it, and keep the bot's scope limited to the servers you have approved.
Network paths between three systems
Traffic flows between the bridge host, your homeserver and Discord, and each path needs to be open in the right direction. The bridge must reach the homeserver's client-server API and receive appservice traffic from it, and it must make outbound connections to Discord. Map each path with your network team, document which ones are internal and which cross the internet, and confirm firewall and proxy rules before installation.
How messages move between Discord, the bridge and the homeserver
A message starts in a Discord channel or direct message, and the bridge process picks it up through its Discord account connection. The bridge stores its mapping of Discord and Matrix objects in PostgreSQL, then sends the event to the Matrix homeserver using the appservice token listed in the appservice registration file. Media passes through ffmpeg and LottieConverter inside the bridge before it is uploaded, so check that both converters run on the bridge host and that the Discord credentials and appservice token stay in separate trust zones.
Message and media flow between Discord, the bridge, PostgreSQL, the homeserver and clients.
Why the legacy architecture changes the build and the upgrade path
mautrix-discord uses the legacy bridge architecture, so the team cannot generate its configuration with the -e flag that newer mautrix bridges offer. The bridge's example configuration file becomes the starting point, and every setting is written and checked by hand. For the build, this means the configuration is a reviewed artifact rather than generated output. Assign one engineer to draft it, a second to review it against the example file line by line, and record which bridge version the file was written for. Keep the Discord bot token, the homeserver address and the database connection string out of the file itself where your secrets process allows, and confirm with the bridge documentation which settings must match the appservice registration file exactly.
Hand-written configuration changes how you pin versions and run change control. Pin the bridge binary and its container image to a specific tag, and store the configuration file in the same repository as the deployment manifests so every edit has an author, a reason and a rollback point. When the bridge is upgraded, the reviewer should diff the new example file against your live configuration, because a setting that was optional in one release can be required in the next. Hand the operations team the pinned version, the diff checklist and the list of values that must change together, such as the registration file and the homeserver settings. This is the part of the handover that prevents a silent mismatch after a routine restart.
Before you commit to an upgrade schedule or a go-live date, confirm with the mautrix bridge documentation how upgrades, configuration changes and any migration steps are handled for legacy bridges, and whether a future move to the newer configuration tooling is planned. The answer determines how often your team will repeat the manual review and how much of the effort is recurring. Ask the bridge maintainers or the community channels listed in the documentation for their current guidance, and write the answer into the change-control runbook so the next upgrader does not have to rediscover it.
Configuration sequence for mautrix-discord with a Matrix homeserver
This sequence takes a Matrix homeserver from an empty database to a working Discord bridge with a test account and a bridged room. Each step ends with a check that confirms it, so problems surface before the next layer depends on them. The order matters because the homeserver must load the registration file before the bridge can exchange events.
Provision PostgreSQL 16 or higher
A database administrator or platform engineer creates a PostgreSQL 16 or higher database for the bridge, plus a dedicated role that owns only that database. Keep it separate from the homeserver's database so credentials and backups can be scoped independently. Confirm the server version with a version query, then confirm the role can connect and create tables in the bridge database but cannot read the homeserver database. The step is done when both checks pass from the bridge host.
Install ffmpeg and LottieConverter
The platform engineer installs ffmpeg and LottieConverter on the host that will run the bridge, under the same service account the bridge will use. ffmpeg handles media conversion for images, audio and video passing between the two platforms. LottieConverter is needed for animated stickers, which the Discord bridge converts. Record the path of each binary so the configuration can point to it. The step is done when ffmpeg reports its version and LottieConverter runs from that account's PATH without errors.
Write the bridge configuration by hand
The engineer starts from the sample configuration file shipped with the bridge release and edits it directly. mautrix-discord uses the legacy architecture and does not have the -e generator flag, so no generator can write the file. Set the homeserver address, the database connection using the role from the first step, the bridge's public URL that the homeserver will call, and the paths to the converters. Leave the token values empty until the registration step. The step is done when the bridge starts far enough to report that it parsed the file without configuration errors.
Generate the appservice registration file
The engineer runs the registration step described in the setup documentation for the bridge version in use and writes the output to a file the homeserver can read. The file carries the appservice ID, the bridge URL, the sender localpart, the user and room namespaces, and two tokens. Those tokens must match the bridge configuration exactly, so copy them across if the bridge does not do this for you. The step is done when the file exists, its tokens match the configuration, and only the homeserver and bridge accounts can read it.
Register the file with the homeserver
The homeserver administrator adds the registration file's path to the homeserver's application service configuration list and restarts the homeserver. Confirm the exact setting name in the homeserver's configuration documentation for the version in use. Watch the startup log for the appservice being loaded and for any error about overlapping namespaces or duplicate IDs. The step is done when the homeserver starts cleanly and its log shows the appservice ID from the registration file as loaded.
Start the bridge and confirm connectivity
The engineer starts the bridge service under its own account and watches the log for a connection to the homeserver. Then the administrator tests from the Matrix side: the bridge bot account should exist and answer a help command sent in a management room. Confirm the bridge URL is reachable from the homeserver host, because the homeserver must call the bridge to deliver events. The step is done when the bridge logs a successful connection and the bot answers in the management room.
Connect a dedicated test Discord account
The administrator uses a test Discord account that the organization controls and that holds no production access. Confirm with your policy owners that bridging this kind of account is permitted before starting, and check Discord's terms as they apply to your use. From the bridge management room, run the login flow the bridge documents for its version, and expect possible extra confirmation prompts if the account uses multi-factor authentication or new-login checks. The step is done when the bridge reports the account logged in and lists the servers and direct messages it can see.
Bridge a test room and test both directions
The administrator creates a test Matrix room, invites the bridge bot, and uses the bridge command to bridge a Discord channel or direct message the test account can see. Send a text message from each side, then an image, and check that each arrives on the other side with the correct sender and attachment. The image test exercises the ffmpeg path installed earlier. The step is done when text and an image appear in both directions, and this room and account are kept as the reference test for future upgrades.
Bridging Discord servers versus direct messages
Server bridging maps Discord channels in a guild to Matrix rooms that many people can join. The room is shared, so responsibility moves from individual users to the teams that run the Discord community and the Matrix room. Before any channel is linked, agree which Discord messages will be visible to Matrix users and who approves each link.
- Onboarding: Name the Discord administrators who will authorize the bridge account and the Matrix administrators who will create and approve rooms. Each linked channel needs a named owner on both sides.
- Room ownership: Decide whether the bridge creates a new Matrix room or links an existing one. Matrix admins should keep control of room settings, power levels and moderation, while Discord administrators keep control of channel permissions.
- Discord permissions: The bridge account needs to read the channels in scope and send messages there. Grant access only to the channels the rollout covers, so the account cannot relay from unrelated parts of the guild.
- Volume and features: Large guilds multiply rooms and message traffic. Confirm how your version handles threads, attachments, reactions and edits before you promise those features to users.
Check which channels are in scope, who may unlink them, and whether removing the bridge account from the guild stops the relay.
Direct message bridging connects one Discord user's private conversations to one Matrix user's account, so the relationship is personal. The Discord side belongs to a person rather than a team, which changes who can consent, who can revoke consent and what happens when someone leaves the organization. Treat each DM link as a personal data flow and document it before enabling it.
- Onboarding: Every participant in a bridged conversation should understand that their messages will be relayed. Confirm how the bridge sets up a link for each user, whether the individual signs in with their own Discord account, and how new users are added without an administrator handling their credentials.
- Ownership: The Matrix user who owns a bridged conversation usually controls the history it creates. Decide who may read that history, what happens when that employee changes role, and who removes the link.
- Account permissions: Bridging through a personal Discord account carries different terms and risks than bridging through a bot account. Review Discord's current terms on automated user accounts before any staff member uses one.
- Group conversations: Group DMs include people who have not agreed to be bridged. Confirm how your version handles them and whether they can be excluded.
Confirm the consent flow, the revocation path and the retention of relayed messages with the bridge documentation and your privacy team.
Both modes depend on the bridge release you deploy. The mautrix bridge setup docs describe the legacy architecture that mautrix-discord uses, so its configuration differs from newer generator-based workflows. Check the items below against the documentation for your exact release before you give anyone access.
- Architecture: mautrix-discord uses the legacy architecture and does not support the -e configuration generator flag. Write the configuration by hand and test it on a staging homeserver first.
- Homeserver and database: Confirm that your homeserver supports application services and that PostgreSQL 16 or higher is available for the bridge database.
- Media tools: Install ffmpeg. The Discord, Telegram and WhatsApp bridges also use LottieConverter for animated stickers, so decide whether your users need animated stickers before you install it.
- Supported modes: Verify in the release notes which of server channel and direct message bridging your version supports, and which message types cross in each direction.
- Alternatives: Matrix.org lists four bridges for Discord. Compare them against the mode you need before you commit to mautrix-discord.
Record the release version, the mode, the owners and the rollback steps in your change record before go-live.
How Discord identities, channels and media map to Matrix
This table compares each Discord object with the Matrix object mautrix-discord creates for it, and notes whether the mapping comes from bridge configuration or from the Discord account the bridge logs in with. Read it before choosing the bridge account, room layout and media settings, and confirm each row against the bridge version you deploy because mapping behavior changes between releases.
| Discord object | Matrix counterpart | Set by | What to verify |
|---|---|---|---|
| Discord user (puppet) | Ghost user with a Matrix ID generated from the Discord user ID under the bridge's username template | Bridge configuration (username template and display name settings) | Confirm the template in your config and how display names sync after a user changes nickname |
| Bridge login account | Matrix user that relays messages for the bridged Discord account | Account the operator logs in with during bridge setup | Confirm which Discord account type the current release supports and what it can see |
| Guild (server) | Matrix Space grouping the rooms for that guild | Bridge configuration and the guild the bridge account has joined | Confirm whether guilds are created as Spaces automatically in your version |
| Text channel | Matrix room (portal) linked to one Discord channel | Bridge permissions on the guild and the channel's Discord permissions | Check which channel types and thread types are bridged in your release |
| Direct message | Matrix direct room with the remote user's ghost | Depends on the Discord account; DM support and history depend on that account | Test DM bridging with a non-production account before relying on it |
| Nicknames and roles | Display names on ghosts; roles do not map to Matrix power levels | Discord account visibility and bridge display name settings | Verify how server nicknames and role colors appear, if at all, in your release |
| Attachments and files | Media uploaded to the homeserver media repository and linked from the event | Bridge media settings and homeserver upload limits | Confirm maximum sizes and whether large files fall back to links |
| Emoji and stickers | Custom emoji and stickers converted to Matrix media; animated stickers depend on LottieConverter | ffmpeg and LottieConverter availability on the bridge host | Confirm conversion formats and that LottieConverter is installed for animated stickers |
Securing the bridge account, tokens and bridged content
The mautrix-discord bridge holds a Discord account, a Matrix appservice token and a database with message history, so each of these becomes a sensitive asset. The cards below cover where those secrets live, who can reach them, and which content and platform questions your legal and security owners should settle before any Discord channel is relayed.
Discord account credentials and storage
The bridge signs in to Discord as a user account, so the credential it stores can act as a member of every server that account joins. Decide which account is used, who owns it, and how its login is protected, including whether two-factor authentication is enabled. Store the token in a secrets manager or a file readable only by the bridge service user, and confirm that it never appears in logs, backups shared with other teams or configuration committed to version control. Confirm the account's use with Discord's current terms before you connect it.
Appservice token and registration file
The appservice registration file holds the tokens that let the bridge act on your homeserver, so anyone who reads it can impersonate bridged users. Restrict the file to the bridge's service account and to the homeserver process that loads it, and rotate both tokens if the file is ever copied, pasted into a ticket or stored in a shared repository. Use the appservice registration steps in the mautrix setup documentation to generate the file, and record who holds it.
mautrix setup docsDatabase access and backups
The bridge database stores Discord identifiers, puppet profiles and the mapping between Discord channels and Matrix rooms, and it can hold the access data needed to resume sessions. Give the bridge its own PostgreSQL role with rights only to its database, and keep that database off shared administrative accounts. Backups should be encrypted, access-logged and retained on the same schedule as the homeserver database, and a restore test should confirm that the bridge reconnects without re-linking every portal.
Admin and portal room permissions
Admin rooms let a Matrix user issue commands that log the bridge in, link channels and change settings, so membership in those rooms is effectively administrative access. Keep the admin room limited to named operators and invite-only, and check the power levels of each portal room so that only the intended staff can invite users or change room settings. Review portal membership after staff changes, because a departed operator who stays in an admin room keeps the ability to relink Discord channels.
Relaying content into encrypted or unencrypted rooms
A bridge reads Discord messages in plain text before relaying them, so whatever it receives is readable by the bridge process and by anyone with its database. Relaying into an unencrypted Matrix room exposes that content to every member and to the homeserver, while an encrypted room only protects content after the bridge sends it, and bridges in encrypted rooms need device and key handling work. Decide per channel which rooms are encrypted, document the choice, and confirm with the security owner that Discord content may be stored on the homeserver at all.
Account-risk and platform-terms review
Before bridging, ask legal and security owners to review whether relaying Discord content and running a user-account session fits your Discord agreements, your data handling rules and the terms of the servers you join. Also confirm who may be bridged, how bridged users are told their messages leave Discord, and how you will stop the bridge if an account is restricted. This review is a decision for your organization. DeployOpen does not give a view on Discord's policy, so obtain that answer in writing from your own advisers.
Common mautrix-discord failures and how to fix them
This table lists the failures that most often come from the bridge prerequisites and setup sequence, with the likely cause, the check to run and the fix for each. Work through the rows in order, since a homeserver or database problem will surface as a confusing error later in the bridge logs. Confirm each item against the current mautrix setup documentation for your bridge version before changing production settings.
| Failure | Likely cause | Check and fix |
|---|---|---|
| Bridge cannot attach to the homeserver | Homeserver does not have application service support enabled, or the bridge cannot reach its URL | Confirm the homeserver accepts application services and the bridge can reach the homeserver address. Enable the setting, then restart the homeserver and the bridge. |
| Database startup fails | PostgreSQL is older than version 16 | Run a version query against the bridge database. Upgrade PostgreSQL to version 16 or higher, then restart the bridge. |
| Media uploads or downloads fail | ffmpeg is missing from the bridge host or container image | Check that ffmpeg runs on the host or inside the container. Install it or use an image that includes it, then retest a file upload. |
| Animated stickers do not convert | LottieConverter is missing, which the Discord bridge needs for animated stickers | Confirm the converter binary is on the path the bridge uses. Install it and send a test animated sticker from Discord. |
| Homeserver never loads the bridge | The registration file was generated but not listed in the homeserver configuration, or the path is wrong | Confirm the registration file path in the homeserver configuration and check the homeserver startup log for the loaded application service. Correct the path, then restart the homeserver. |
| Bridge users or rooms appear under the wrong domain | Homeserver domain in the bridge configuration does not match the server_name the homeserver uses | Compare the domain fields in the bridge configuration and the homeserver configuration. Align them, regenerate the registration file if needed, and restart both services. |
| Discord login or channels do not appear | Discord account or bot lacks the required permissions, or the connection to Discord was not completed | Re-run the Discord login from the bridge management room, then check that the account can see the target server and channels. Grant missing permissions in Discord and retry. |
| Bridged messages stop after a period | Discord session expired or the bridge lost its connection to Discord | Check the bridge logs for authentication or gateway errors. Log in again from the management room and confirm the bridge reconnects. |
Questions teams ask before bridging Discord to Matrix
What drives the cost of bridging Discord to Matrix?
The main cost is the time of the engineers who plan, install, configure and test the bridge, and the time of the people who confirm which Discord servers and direct messages are in scope. Effort rises with the number of Discord servers, the number of channels mapped to Matrix rooms, the media and sticker handling you need, and how much your Matrix homeserver already has in place, such as a PostgreSQL service, a reverse proxy and monitoring. Recurring costs are the hosting, database storage, backups and the ongoing time to watch the bridge and apply updates. Ask any partner for a quote that lists each of these as a separate line, with what is one-time and what recurs.
How long does a first Discord bridge take to validate?
The supplied material does not give a duration for this work, so confirm it against your own environment rather than planning from a generic figure. Validation depends on how quickly you can register the application service with your homeserver, provision PostgreSQL 16 or higher, install ffmpeg and the other media tools, and get a test Discord account and a test room. The longest step is usually agreeing which Discord channels and direct messages should cross into Matrix and who may bridge them. Ask your implementation team to list each validation step with a date and an owner before work starts.
What must our team provide before the bridge can run?
Your team must provide a Matrix homeserver that supports application services, a host or container for the bridge, a PostgreSQL 16 or higher database, and ffmpeg for media conversion. Discord, Telegram and WhatsApp bridges also use LottieConverter for animated stickers, so plan that tool too. You will also need a Discord account that is a member of the servers you want to bridge, and named owners for each Matrix room that will receive Discord content. Confirm with the mautrix documentation which setup steps apply to the legacy architecture before you assign hosts.
Can one internal engineer set up the Discord bridge alone?
One engineer with Matrix and PostgreSQL experience can usually complete a test bridge in a lab, but a production rollout needs more people than that. The bridge touches the homeserver configuration, the database, the media pipeline, the Discord account and the room membership model, and each has a separate owner in most organizations. Plan for a second person to review the appservice registration and the data handling decisions, and for someone to own day-to-day operations after go-live. If your team has no prior bridge experience, a partner can build the first deployment and transfer the runbook.
How do upgrades and rollback work for a legacy bridge?
mautrix-discord uses the legacy bridge architecture, which means its configuration is written by hand rather than generated with the -e flag used by newer mautrix bridges. Upgrades therefore require you to compare your configuration file with the new release and carry changes over manually. Before each upgrade, back up the bridge database and the configuration, and test the new version against a non-production homeserver. Rollback depends on database schema changes between versions, so confirm in the project documentation whether a downgrade is supported before you rely on it. Write the rollback steps into your runbook before go-live.
What are the security and data handling questions to settle first?
Settle who can see bridged content before connecting any Discord server. Bridged messages move from Discord into Matrix rooms, so anyone with access to those rooms can read them, and the bridge account holds credentials for the Discord side. Decide which Discord servers and direct messages may cross, store the bridge credentials in your normal secrets process, restrict the bridge's database access, and review how media is stored on your homeserver. Check the retention and erasure settings of your homeserver against your data protection obligations. Your compliance team should confirm the approach, since DeployOpen prepares evidence but does not issue audit reports or certifications.
When is it worth bringing in a partner for this bridge?
Bring in a partner when the bridge must run in production with defined scope, or when your team lacks time to own the database, media tooling and upgrades. A partner is also useful when many Discord servers must be mapped, when the bridge must meet internal security review, or when you want testing before users depend on it. DeployOpen plans, implements, hardens, backs up, upgrades and documents self-hosted platforms in infrastructure you control, usually under a fixed-scope written agreement, with ongoing support available as a retainer. Ask for a written scope, deliverables and the handover plan before you decide.
How DeployOpen scopes and delivers a Discord bridge
DeployOpen plans, builds, documents and supports Discord bridging on infrastructure you control, starting from your Matrix homeserver version, database platform and the Discord servers and direct messages you need to reach. Engagements are fixed-scope, so the scope, deliverables and timeline are agreed in writing before any build work begins.
How we scope
- Inventory the Discord servers, channels and direct messages that must appear in Matrix, and who needs access to each
- Confirm the homeserver implementation, version and appservice support, plus PostgreSQL 16 or higher and ffmpeg availability
- Record media conversion needs, including whether LottieConverter is required for animated stickers
- Agree in writing whether the bridge runs on the legacy architecture and which bridge option was chosen after comparing Discord options
How we build
- Generate and register the appservice configuration on the homeserver, then verify the registration file loads cleanly
- Provision a dedicated PostgreSQL 16 or higher database for the bridge with restricted credentials and backups
- Install and configure ffmpeg and any converter tools, then test media conversion for images, files and stickers
- Run the bridge in a test room with a non-production Discord server before connecting live channels
How we hand over
- Deliver the configuration, registration file and deployment records with secrets handled outside source control
- Document the bridge's admin commands, permitted users, room mappings and known feature limits for your team
- Provide an operations runbook covering restarts, database backups, log locations and upgrade steps for the bridge
- Walk your administrators through the verification checklist so they can repeat tests after changes
How we support
- Offer ongoing support, upgrades and continuous checks as a retainer after handover
- Review bridge upgrades against homeserver and PostgreSQL requirements before each change is applied
- Retest room mapping, media handling and permissions after platform updates or Discord-side changes
- Quote retainer scope from the written engagement, so recurring effort is visible before work starts

