What a cfx.re join code is, and how to find yours

The six characters in cfx.re/join/xxxxxx are how FiveM addresses your server. Here is where to find yours, what it is safe to publish, and why it is a better thing to put on your website than an IP address.

Last updated

Every FiveM server has a join code: the six characters at the end of cfx.re/join/xxxxxx. It is the address players use, the key every status API is keyed by, and the one string your website needs in order to show a live player count.

It is also the thing people put off finding, because it looks like an implementation detail. It is not. It is the closest thing your server has to a phone number.

What it actually is

A join code is a stable alias for your server, issued by Cfx.re and resolved by their infrastructure at connect time.

That indirection is the whole point. A raw host:port address ties your community to one machine at one IP. If you change host, change provider, get a new IP, or move behind a proxy, the address your players memorized stops working and you have to reissue it everywhere. A join code survives all of that, because what changes is the record Cfx.re resolves, not the thing you published.

For a community website this matters more than it sounds. The address is the single most-copied string you publish. It is in your Discord, your videos, your listings, and other people's forum posts that you do not control. Anything that forces you to change it is expensive.

Where to find yours

Three places, in order of how likely they are to work right now.

The F8 console, in game. Connect to your own server, press F8, and the connection line includes the code. This is the most reliable method because it reports what players actually resolved, not what you think you configured.

Your server listing. Find your server in the FiveM server browser and the code is in the URL of its listing page.

txAdmin. If you deployed through txAdmin, the code appears in the panel once the server has registered with Cfx.re. Note that this requires the server to have come up and successfully checked in at least once, so it is not available while you are still debugging startup.

If none of the three produce a code, your server has not successfully registered with Cfx.re. That is a server problem rather than a lookup problem, and it usually means the server is not reachable from outside your own network.

Vanity codes

Some servers have a readable code rather than six random characters. These are vanity codes, and they resolve exactly like a generated one.

Useful to know when you are writing anything that consumes codes: a vanity code and a generated code are the same kind of thing and the same APIs accept both. If you are validating input on a lookup form, do not assume six characters.

Is it safe to publish

Yes. It is meant to be published. It is what you hand to players.

Two things worth separating, because they get conflated:

  • The join code is public by design. It is an address. Publishing it is the point of having one.
  • Your server's raw IP and port are not secret either, strictly, since anyone connected can see them. But there is no reason to publish them, and doing so hands a would-be attacker a target that bypasses whatever Cfx.re sits in front of. Publish the code, not the address.

If your website currently shows a raw host:port for people to paste into the console, replace it with a join link. It is better for players, and it is one fewer thing to change the next time you move host.

Using it on your website

Two jobs, and the code does both.

A join button. A link to https://cfx.re/join/xxxxxx opens FiveM and connects. No instructions, no copy-and-paste step, no "open the console and type connect". If your site currently explains how to connect in a paragraph, that paragraph can become a button.

Live status. Every FiveM status lookup is keyed by the join code. Give a widget the code and it can report whether the server is up, how many players are on it, and what the slot count is. That is covered properly in showing live server status on your website.

On RPWebsite both of these come from one configuration value. Set the join code and the join button, the player count and the player list all start working together.

Common problems

The code works in game but a status lookup returns nothing. Almost always a typo, a leading or trailing space, or a copied cfx.re/join/ prefix that was not stripped. Lookups take the bare code.

The code changed. Generated codes are stable for the life of the server registration. If yours changed, the server was re-registered, which usually means it was rebuilt from scratch rather than restarted. Check anywhere you hard-coded it.

A lookup works from your laptop and not from your deployed site. Your site is making the request from a datacenter rather than from a home connection, and datacenter ranges are treated differently by some upstreams. Cache aggressively and do not make the request once per visitor.

from $99

One-time · full source code

Get it now