How to Link Discord to FiveM: A Complete Setup Guide
Connecting Discord to FiveM opens up a layer of community management, role-based server access, and in-game identity verification that most serious roleplay and multiplayer servers rely on heavily. Whether you're a server owner setting up authentication or a player trying to join a whitelist community, understanding how this integration works — and what it actually requires — will save you a lot of frustration.
What "Linking Discord to FiveM" Actually Means
The phrase covers a few different things depending on who's asking:
- Players linking their Discord account to their FiveM/Cfx.re account for identity verification
- Server owners integrating Discord OAuth2 so players must connect Discord before joining
- Admins using Discord roles to gate server access or assign in-game permissions
These are meaningfully different processes. Most confusion comes from players assuming they need to do something complex when the basic account link is straightforward — and server owners underestimating the technical lift required to build a full OAuth integration.
Linking Your Discord to Your Cfx.re Account (Player Side)
FiveM operates under the Cfx.re platform, and that's where the official Discord connection lives.
Steps to link Discord to your Cfx.re account:
- Go to forum.cfx.re and log in or create an account
- Click your profile icon in the top right corner
- Navigate to Preferences → Account
- Scroll to the Connected Accounts section
- Click Connect next to Discord
- You'll be redirected to Discord's authorization page — approve the connection
- Once approved, your Discord account appears as linked in your Cfx.re profile
This connection is primarily used for forum identity and community verification. It does not automatically give you access to every FiveM server — individual servers run their own Discord verification systems on top of this.
How Server-Side Discord Integration Works 🔧
When a FiveM server requires Discord linking before you can play, it's typically running one of two approaches:
1. Discord Bot + Whitelist System
The server uses a Discord bot that cross-references your Discord ID against an approved list. Players join the server's Discord, go through a verification or application process, get assigned a specific role, and then that role is checked when they attempt to connect to the FiveM server.
2. Discord OAuth2 via Server Scripts
More technically involved, this method uses OAuth2 authentication — the same standard used when you "Log in with Google" on a website. The server redirects connecting players through a Discord login flow, captures their Discord ID, and validates it against permissions or a database.
Popular FiveM frameworks like ESX and QBCore have community-developed resources (such as discord-api or badger_discord_api) that handle this. These scripts query the Discord API in real time to check things like:
- Whether the player is in a specific Discord server (guild)
- What roles they hold
- Whether their account meets a minimum age requirement
3. Screened Entry via Bot Commands
Simpler servers use a bot like Carl-bot, MEE6, or a custom bot where players run a command (e.g., /verify) that ties their Discord to a license identifier. The FiveM server then checks this pairing at connection time.
What You Need on the Technical Side
The complexity varies significantly depending on your role:
| Role | What's Required |
|---|---|
| Player joining a server | Discord account + Cfx.re account (usually just follow server instructions) |
| Server owner (basic bot) | A Discord bot, a shared spreadsheet or database, a FiveM script |
| Server owner (OAuth2) | Discord Developer App, OAuth2 credentials, a web endpoint or txAdmin integration |
| Server owner (framework) | ESX/QBCore install, a Discord API resource, server-side Lua knowledge |
The Discord Developer Portal (discord.com/developers) is where you create an application and generate the Client ID and Client Secret needed for OAuth2 flows. This is a requirement for any server doing real-time role checks.
Common Issues Players Run Into
"The server says I haven't linked my Discord" This usually means the server is checking for membership in their specific Discord guild, not just whether you have a Discord account. Joining their Discord server first is almost always the missing step.
"My roles aren't being detected" Role detection via Discord API requires the bot to have the correct OAuth2 scope (guilds.members.read) and sufficient bot permissions in the Discord server. If the server recently changed their bot or roles, there may be a sync delay.
"The verification link expired" OAuth2 tokens are time-limited. If you waited too long between starting verification and approving it in Discord, the token invalidated. Restarting the process typically resolves it.
Variables That Change How This Works For You 🎮
A few factors determine which path applies to your situation:
- Whether you're a player or server operator — the process is almost entirely different
- The specific FiveM server's requirements — some only need guild membership, others check specific roles, some use full OAuth2
- Your server's framework — ESX and QBCore have different community resources and documentation
- Your technical comfort level — setting up OAuth2 and a web endpoint requires understanding of APIs, environment variables, and server configuration
- Whether you're using txAdmin — this server management tool has its own integration options that simplify some of the setup
The right method for any given server or operator depends heavily on how that community is structured, what level of access control they need, and what technical resources they have available to maintain it.