Skip to Content
Getting StartedLicense Key Setup

FiveM License Key Setup

Every FiveM server needs a free Cfx.re server registration key. Create the key in the Cfx.re Portal, then provide it to txAdmin or set sv_licenseKey in the server.cfg loaded by FXServer.

Create a Cfx.re server registration key

  1. Open the Cfx.re Portal .
  2. Sign in with the Cfx account that will manage the server.
  3. Open Servers and then Registration keys.
  4. Create a key and give it a name that identifies the server or environment.
  5. Copy the generated value once and store it in your password or secrets manager.

Use separate, clearly named keys for unrelated production and development servers. If a key is exposed, replace it in the Portal and update the server configuration.

Configure the key with txAdmin

During the txAdmin Recipe Deployer:

  1. Continue to the Input Parameters or Before you begin step.
  2. Open the Portal link if you have not created a key yet.
  3. Paste the registration key into the license-key field.
  4. Run the recipe and select Save & Run Server.

txAdmin writes the required configuration for the selected server profile. Do not add a second conflicting sv_licenseKey line to another config file.

Configure the key in server.cfg

For a vanilla FXServer installation, add the key to the server.cfg that is passed to FXServer:

sv_licenseKey "replace-with-your-cfx-registration-key"

Start FXServer from the server-data directory and explicitly load that file:

# Linux example cd /opt/fivem/server-data bash /opt/fivem/artifacts/current/run.sh +exec server.cfg
# Windows PowerShell example Set-Location C:\FXServer\server-data C:\FXServer\server\FXServer.exe +exec server.cfg

FIVEM_LICENSE_KEY is not a standard FXServer configuration variable. A custom service may translate its own environment variable into +set sv_licenseKey, but exporting an arbitrary environment variable alone does not configure FXServer.

Verify the license key

Start the server and read the first startup errors. A successful validation continues into server and resource startup without a missing- or invalid-key error.

Confirm that:

  1. FXServer loaded the intended server.cfg.
  2. There is one active sv_licenseKey value.
  3. The value contains no leading/trailing spaces or copied quotation marks.
  4. The key is still present in the Cfx.re Portal.
  5. The server can reach Cfx.re services over the network.

Do not print the full key while debugging. Check whether the setting exists, not its secret value.

Fix common license-key errors

No license key was specified

  • Confirm the startup command includes +exec server.cfg.
  • Confirm the process starts in the correct server-data directory.
  • Search the loaded config for sv_licenseKey.
  • If txAdmin manages the server, edit the active txAdmin profile rather than a different copy of server.cfg.

Invalid license key

  • Paste the key again from the Cfx.re Portal.
  • Remove duplicate sv_licenseKey declarations.
  • Replace a revoked or exposed key.
  • Confirm a deployment template did not leave the placeholder changeme.

The key works in one environment but not another

Check which txAdmin profile, startup service, and server.cfg each environment actually loads. Do not copy a production secret into a development repository to work around configuration drift.

Protect the key

  • Never commit a real registration key, server.cfg, .env, or service environment file containing the key.
  • Restrict access to the server account and secret storage.
  • Replace the key immediately if it appears in logs, screenshots, chat, or Git.
  • Do not send the key to a resource author or hosting support unless the authorized provider explicitly requires it through a secure secret field.

For Steam Web API keys, Discord bot tokens, and resource-specific credentials, see API keys and secrets.

Next steps