How to Configure a FiveM Server (server.cfg Explained)
A line-by-line guide to the FiveM server.cfg file: endpoints, hostname, maxclients, resources, convars, RCON, and the license key — with safe examples.

The server.cfg file is the control panel for your FiveM server — it sets the ports, name, player cap, which resources load, and your license key. This guide explains every important line so you can configure your server with confidence. If you haven't installed FiveM yet, start with how to set up a FiveM server (GTA V roleplay) on a VPS.
Where server.cfg lives
It sits in your server-data directory (e.g. ~/FXServer/server-data/server.cfg) and is loaded at startup with +exec server.cfg. It's plain text — edit it with nano and restart the server to apply changes.
Endpoints: the ports players connect to
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
These bind the server to port 30120 on all interfaces. Change the port here if you run multiple servers on one box — and open the matching ports in your firewall. 0.0.0.0 means "listen on every network interface", which is what a public server needs.
Identity: hostname, tags, and locale
sv_hostname "My Nxeon GTA RP Server"
sets sv_projectName "Nxeon RP"
sets sv_projectDesc "Serious roleplay, custom jobs"
sets tags "roleplay, esx, economy"
sets locale "en-US"
sv_hostname is the name in the server browser. The sets lines publish metadata (shown on the server info panel and used for filtering). Good tags help players find you.

Player cap and OneSync
sv_maxclients 48
set onesync on
sv_maxclients caps concurrent players (up to 48 on the standard tier; higher counts need OneSync and a higher license tier). onesync on enables the state-sync system required for servers above 32 players and for most modern frameworks.
Loading resources with ensure
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure hardcap
ensure es_extended
ensure my-custom-job
ensure starts a resource and restarts it if it stops — it's the modern replacement for start. Order matters: frameworks like es_extended (ESX) must load before resources that depend on them. Learn the full workflow in how to add resources to a FiveM server.
Convars: passing config to resources
set mysql_connection_string "mysql://user:password@localhost/es_extended?charset=utf8mb4"
set es_enableCustomInventory true
setr voice_useNativeAudio true
- set creates a server-side convar (e.g. a database connection string).
- setr creates a replicated convar the client can also read (e.g. voice settings).
- sets creates a convar published in server info.
Keep secrets like database passwords in server.cfg only, and never in a public repo or screenshot.
RCON and admin
rcon_password "change-this-strong-password"
add_ace group.admin command allow
add_principal identifier.fivem:1234567 group.admin
Set a strong rcon_password (or leave it blank to disable remote console entirely, which many admins prefer, using txAdmin instead). The ACE lines grant admin permissions to specific identifiers. For most servers, txAdmin's web panel is the safer, easier way to manage admins.
The license key
sv_licenseKey YOUR_LICENSE_KEY_HERE
set steam_webApiKey ""
sv_licenseKey is your free keymaster key — the server won't start without a valid one. steam_webApiKey is optional and enables Steam identifiers.
A minimal working example
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
sv_hostname "My Nxeon GTA RP Server"
sv_maxclients 48
set onesync on
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure hardcap
rcon_password "change-this-strong-password"
sv_licenseKey YOUR_LICENSE_KEY_HERE
Applying changes safely
After editing, restart the server (or use txAdmin's restart) and watch the console for errors. If a resource fails to start, the console names it — usually a missing dependency or wrong ensure order. Schedule tidy restarts with automate game server restarts with systemd and cron, and size your box with Game Server Specs Explained: CPU, RAM and Bandwidth.
Handy admin and anti-cheat convars
A few more lines worth knowing:
sv_scriptHookAllowed 0
sv_enforceGameBuild 2802
sv_endpointprivacy true
- sv_scriptHookAllowed 0 blocks ScriptHook (a common cheat vector) — keep it off for RP.
- sv_enforceGameBuild pins the GTA build your resources target, so a game update doesn't break them.
- sv_endpointprivacy true hides player endpoints from other clients.
Splitting config into files
On big servers, keep server.cfg readable by splitting it and pulling the pieces in with exec:
exec resources.cfg
exec permissions.cfg
This separates a long resource list from your core settings and makes changes easier to review. After editing, restart or use txAdmin's reload, and always watch the console for the first resource that fails to start — fix that one and the cascade of errors usually clears.
FAQ
What's the difference between start and ensure?
ensure starts a resource and restarts it if it stops or is already running — it's idempotent and safer. start only starts it once. Use ensure everywhere.
Why won't my server start?
The most common cause is a missing or invalid sv_licenseKey. Also check that endpoints bind to 0.0.0.0 and that resource dependencies load in the right order.
What's the difference between set, sets, and setr?
set is server-side only, sets publishes the value in server info, and setr replicates it to clients. Use set for secrets, setr for client-visible settings.
How do I change the max player count?
Edit sv_maxclients. Above 32 players you must enable OneSync (set onesync on) and have a license tier that allows it.
Get your configuration dialed in on an NVMe game server VPS from Nxeon with full root access — and see our FiveM setup guide if you're starting from scratch.