All articles
Configurationserver.cfgFiveM configurationFiveM server setup

FiveM server.cfg Configuration Guide: Every Setting Explained

Master every FiveM server.cfg setting — endpoints, hostname, OneSync, license key, ace permissions, banners, and more. The complete guide for server owners.

March 4, 202611 min readBy CRM Development
On this page

The server.cfg file is the single most important configuration file on any FiveM server. Every startup setting — your server name, slot count, license key, enabled resources, and admin permissions — lives here. Getting it right from the start saves you hours of debugging later.

This guide covers every meaningful convar and directive you will encounter when running a FiveM server, whether you are setting up a fresh ESX roleplay server, a QBCore pack, or a custom Qbox build. All facts here reflect how FXServer actually works.

Network Endpoints: TCP and UDP

The first thing FXServer reads is where to listen for connections. You must define both a TCP and UDP endpoint. The default port is 30120 and both must point to the same port. Using 0.0.0.0 tells the server to listen on all network interfaces.

cfg
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

Firewall reminder

Port 30120 must be open for both TCP and UDP in your VPS or dedicated server firewall. On Windows Server, add inbound rules in Windows Firewall. On Linux, use ufw or iptables.

Server Identity Settings

These convars control how your server appears in the FiveM server browser and in txAdmin. A well-crafted hostname with your server's brand and a clear description help players find and recognize your server.

  • sv_hostname — the name shown in the server browser. Supports color codes (^1 red, ^2 green, etc.).
  • sv_projectName — internal project identifier, used by txAdmin and monitoring tools.
  • sv_projectDesc — a short description of your server shown in browser details.
  • sets tags — comma-separated tags (e.g., roleplay, esx, serious) that help players filter the browser.
  • sets locale — your server's primary language code (e.g., en-US, hu-HU) for browser filtering.
  • sets banner_detail — URL to your full server banner image (recommended 1900x520 px).
  • sets banner_connecting — URL to the banner shown while a player is connecting.

License Key and Steam API Key

Your server cannot appear online without a valid Cfx.re license key from keymaster.fivem.net. The Steam Web API key is optional but recommended — it allows Steam-based identifiers which many anticheat and whitelist systems rely on.

cfg
sv_licenseKey "YOUR_LICENSE_KEY_FROM_KEYMASTER"
set steam_webApiKey "YOUR_STEAM_API_KEY"

Player Slots and OneSync

sv_maxclients sets your server's player cap. Without OneSync, the hard limit is 32. With OneSync enabled, you can go up to 2048 slots. For any modern serious or semi-serious RP server you should enable OneSync regardless of slot count — many scripts require it.

cfg
set onesync on
sv_maxclients 64

sv_enforceGameBuild: Loading GTA DLC Content

By default FXServer loads a baseline GTA build. If your server uses custom MLOs, vehicles, or other content from newer GTA updates, you must set sv_enforceGameBuild to the appropriate build number. All players connecting must have at least that GTA version installed.

Build NumberNotable DLC / Content
2699The Contract (Dr. Dre, Agency) — widely used baseline
2802The Criminal Enterprises update
3095San Andreas Mercenaries and later assets
cfg
set sv_enforceGameBuild 2699

Security Settings: ScriptHook and RCON

sv_scriptHookAllowed controls whether clients can run ScriptHook-based mods (trainers, mod menus). Always keep this at 0 on any public server. RCON (remote console) lets you run server commands remotely — either set a very strong password or leave it blank to disable RCON entirely.

cfg
sv_scriptHookAllowed 0
rcon_password ""

RCON security

If you use txAdmin you do not need RCON. Leave rcon_password blank. If you do enable it, use a random 32+ character password — RCON gives full console access to your server.

Server Icon and Branding Assets

Place a file named icon.png (96x96 pixels) in your server root directory. FiveM will automatically serve it as the server icon in the browser. For banners, host your images externally (or on your VPS as static files) and reference the URLs via sets banner_detail and sets banner_connecting.

Resource Loading with ensure

The ensure directive tells FXServer to start a resource. Load order matters — a resource that depends on ox_lib must be ensured after ox_lib. A clean load order prevents the majority of startup errors.

  1. Core FiveM resources: spawnmanager, sessionmanager, mapmanager, chat, hardcap, rconlog
  2. UI and utility libraries: ox_lib
  3. Your framework: es_extended (ESX) or qb-core or qbx_core
  4. Framework dependencies: ox_inventory, oxmysql, esx_menu_default, etc.
  5. Addon resources and custom scripts

Ace Permissions and Admin Setup

FiveM uses an access control system built around ace (access control entries) and principals. You grant permissions to a principal (like a group) and then add players to that principal. The built-in group.admin and group.moderator principals are already configured in many frameworks.

cfg
add_ace group.admin command allow
add_ace group.admin command.quit allow
add_principal identifier.steam:110000112345678 group.admin

Replace the Steam identifier with your actual Steam hex ID. You can find it by connecting to your server and checking the server console or using the identifiers shown in txAdmin's player list.

Full Annotated server.cfg Example

cfg
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

sv_hostname "^1My RP Server ^7| Serious Roleplay"
sv_projectName "MyRPServer"
sv_projectDesc "A serious FiveM roleplay experience."

sets tags "roleplay,serious,esx"
sets locale "en-US"
sets banner_detail "https://myserver.com/banner.png"
sets banner_connecting "https://myserver.com/banner.png"

sv_licenseKey "cfxk_XXXXXXXXXXXXXXXX"
set steam_webApiKey "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

set onesync on
sv_maxclients 64

set sv_enforceGameBuild 2699

sv_scriptHookAllowed 0
rcon_password ""

add_ace group.admin command allow
add_ace group.admin command.quit allow
add_principal identifier.steam:110000112345678 group.admin

ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure hardcap

ensure ox_lib
ensure oxmysql
ensure es_extended
ensure ox_inventory

ensure my_custom_script

Key Convars Reference Table

ConvarExample ValueDescription
sv_hostname"My RP Server"Server name in the browser. Supports color codes.
sv_maxclients64Max player slots. Requires OneSync for >32.
sv_licenseKey"cfxk_..."Cfx.re license from keymaster.fivem.net. Required.
set onesynconEnables OneSync. Required for >32 slots and modern scripts.
set sv_enforceGameBuild2699Forces a minimum GTA build to load DLC content.
sv_scriptHookAllowed0Keep 0/false on public servers to block mod menus.
rcon_password""RCON console password. Leave blank to disable.
set steam_webApiKey"YOUR_KEY"Enables Steam identifiers for whitelists and anticheat.
sets tags"roleplay,esx"Tags shown in the server browser filter.
sets locale"en-US"Server language code for browser filtering.
sets banner_detail"https://..."Full server banner image URL (1900x520 recommended).
sets banner_connecting"https://..."Banner shown to players while connecting.

Monitoring Resource Performance

After your server is running, use the resmon command in the FXServer console to view real-time resource CPU and memory usage. Any resource consistently above 1ms per tick should be investigated — poorly written scripts are the most common cause of server lag on well-configured setups.

Final Notes

A correctly configured server.cfg is the foundation every other customization builds on. If you are launching a new server or migrating an existing one, the team at CRM Development includes fully pre-configured server.cfg templates tuned for each server pack — ESX, QBCore, and Qbox — so you skip the guesswork and start with a working, secure baseline.

Frequently asked questions

Where do I get my FiveM license key for server.cfg?+

Your license key is generated at keymaster.fivem.net. Log in with your Cfx.re account, register your server, and copy the key into the sv_licenseKey line of your server.cfg.

What is the default FiveM server port and do I need to open it?+

FXServer uses port 30120 for both TCP and UDP by default. You must open this port in your firewall and forward it on your router (if hosting at home) for players to connect.

How many players can I have without OneSync?+

Without OneSync, FiveM servers are capped at 32 players. To go above 32 slots — up to 2048 — you must add `set onesync on` to your server.cfg.

Should I enable sv_scriptHookAllowed on my roleplay server?+

No. Keep sv_scriptHookAllowed set to 0 (false). Allowing ScriptHook lets clients run mods like trainer menus that can give unfair advantages or crash the server. Disable it on any serious or semi-serious RP server.

What order should I load resources in with ensure?+

Load core dependencies first: spawnmanager, sessionmanager, mapmanager, chat, then your framework (ESX, QBCore, Qbox), then framework dependencies (ox_lib, ox_inventory, etc.), and finally your addon scripts. Wrong load order is one of the most common causes of resource errors.

Ready-to-run FiveM packs

Skip the setup — grab 100k or die, Miami ghetto and NYC server packs from CRM Development.

Browse the shop

Related guides

server.cfgFiveM configurationFiveM server setupOneSyncace permissionsconvarsFiveM admin