Skip to content
Current coupon:10% offUse it in your order

FiveM server.cfg explained line by line (including OneSync)

What every line of server.cfg does: ports, the name in the server list, license key, game build, OneSync, ensure order and ACE permissions. With recommended values.

  • advanced
  • ~25 min
  • Updated 2 Oct 2026

server.cfg is the main configuration file of a FiveM server: it sets the port, the name in the server list, the license key, game build, OneSync, which resources start and admin permissions. We'll go through it line by line and, for each setting, explain what it does and which value to choose.

What you'll need

  • A FiveM server at StormHost (or your own FiveM server)
  • Access to the files: the Files tab, or CFG Editor in txAdmin
  • About 25 minutes

Where to find server.cfg#

  • Server with txAdmin: server.cfg is in the folder you chose when deploying the recipe (txAdmin suggests txData/<NAME>_<CODE>.base). The easiest way to edit it is CFG Editor in the left menu of txAdmin; save with Ctrl+S. You'll find the path in txAdmin under Settings › FXServer (the Server Data Folder field; the CFG File Path field appears when you show the advanced options).
  • Server without txAdmin: server.cfg is in the server's main folder. Edit it in the customer area in the Files tab (guide).

Changes to server.cfg only take effect after a server restart.

The customer area may overwrite some lines

On a server without txAdmin, the customer area may write values from the Settings tab › Variables into server.cfg at every startup (typically the port, server name, license key and slot count). If your changes to these lines keep reverting after a restart, change the value in the variables, not in the file.

How server.cfg is read#

  • The file is read top to bottom, line by line. Each line is one server console command.
  • Text after # is a comment and the server ignores it. You “turn off” a line by putting # at its start.
  • Put values with spaces in quotes: sv_hostname "Muj server".
  • If the same setting appears twice in the file, the last one wins.
  • The exec file.cfg command loads another configuration file (for example exec permissions.cfg). Handy for keeping things organized.

Variables (convars) are set with three commands:

CommandWhat it doesWhen to use it
setSets the variable for the server only.Secret and server-side values, for example set mysql_connection_string.
setrSets the variable and also sends it to players (client scripts).Settings that scripts on the player's side need (language, voice chat). Never for passwords.
setsSets a variable that shows up in the server list and in info.json.Public details: sets sv_projectName, sets tags, sets locale.

Never set a password with setr or sets

A value set with setr is sent to all players, and one set with sets is publicly visible. Always set the database connection string or any other password with set only.

Sample server.cfg#

This sample is based on the default FiveM configuration and the txAdmin recipes. Each block is explained below.

server.cfgcfg
# --- Network ---
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
sv_maxclients 48
sv_endpointPrivacy true

# --- Server list ---
sv_hostname "Muj RP server"
sets sv_projectName "Muj RP server"
sets sv_projectDesc "Czech roleplay server with custom scripts"
sets tags "roleplay, czech, esx"
sets locale "cs-CZ"
load_server_icon logo.png
#sv_master1 ""

# --- Keys ---
sv_licenseKey "<LICENSE_KEY>"
set steam_webApiKey "none"

# --- Game and security ---
sv_enforceGameBuild 3258
sv_scriptHookAllowed 0
sv_enableNetworkedSounds false
sv_enableNetworkedScriptEntityStates false
sv_filterRequestControl 2

# --- OneSync (only without txAdmin, see below) ---
set onesync on

# --- Database ---
set mysql_connection_string "mysql://<USER>:<PASSWORD>@<DATABASE_IP>:3306/<DATABASE_NAME>"

# --- Resources ---
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
ensure oxmysql
ensure [standalone]

# --- Permissions ---
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_principal identifier.fivem:<FIVEM_ID> group.admin

Replace the values in angle brackets with your own details (delete the brackets): <LICENSE_KEY> is the key from the Cfx.re Portal, the database details are in the Database tab, and <FIVEM_ID> is the numeric ID of your Cfx.re account (the permissions section explains how to find it).

Network and slots#

SettingWhat it doesRecommended valueWhen to change it
endpoint_add_tcp "0.0.0.0:30120"The address and port where the server accepts TCP connections (resource downloads, server list information).0.0.0.0 and the port from the Network tab (the Connection address line).Only when the port changes. 0.0.0.0 means “on all of the server's addresses”.
endpoint_add_udp "0.0.0.0:30120"The same for UDP, which carries the game itself.The same address and port as for TCP.TCP and UDP must always use the same port.
sv_maxclients 48Maximum number of players (1–⁠2048).48More than 48 requires an Element Club Argentum subscription (see OneSync). Values of 32 and up require OneSync.
sv_endpointPrivacy trueHides player IP addresses in public server listings.trueLeave it on, it protects players.

30120 is the default FiveM port. On our servers, your server's port is the one you see in the Network tab, and it must be on both endpoint_add_* lines. Watch out after deploying with a txAdmin recipe: if txAdmin doesn't know the server's port, it writes the default 30120 into server.cfg. Check it and change it if needed.

Name and server list#

SettingWhat it doesRecommended value
sv_hostnameServer name for the console and some tools. It usually doesn't appear in the server list.A short server name.
sets sv_projectNameThe project name players see in the server list. It should be a name, not a list of tags.Your community's name, for example Muj RP server.
sets sv_projectDescThe description in the server list, one sentence.A short sentence about the server.
sets tagsComma-separated tags players use to find the server.roleplay, czech and the like.
sets localeThe server's main language. The default root-AQ is a placeholder and should be changed.Your players' language, for example en-US for English or cs-CZ for Czech.
load_server_iconThe server icon in the list. It must be a 96 × 96 px PNG in the server folder.logo.png
sets banner_detail, sets banner_connectingThe URL of the banner image in the server details and while connecting.Optional.
#sv_master1 ""When this line is not commented out, the server shows as private in the list and can't be joined from the server browser. It doesn't remove it from the list, though.Leave it commented out with #, or delete the line.

sets sv_projectName and sets sv_projectDesc are required. If they're missing, the server prints an error at startup and may not appear in the list.

Colors in the name are written with the codes ^0 to ^9 (for example ^1 for red). Don't overdo it; the server list may shorten an overly “decorated” name.

Keys#

SettingWhat it doesRecommended value
sv_licenseKeyThe server license key from the Cfx.re Portal. The server won't start without it.Your key (guide).
set steam_webApiKeyA Steam Web API key. You only need it if your scripts work with players' Steam identifiers."none", or your key from steamcommunity.com/dev/apikey (opens in a new window).
rcon_passwordThe password for the RCON remote console (UDP). If it isn't set, RCON is off.Don't set it. You have a console in the customer area and in txAdmin.

Game and security#

SettingWhat it doesRecommended valueWhen to change it
sv_enforceGameBuildEnforces a game version (game build) with certain DLCs. Players download it the first time they connect. Can only be set at server startup.The build your scripts and maps require. txAdmin recipes set it for you.When a script or MLO needs a newer DLC (cars, interiors).
sv_scriptHookAllowedAllows players to use ScriptHook V (menus and mods on the player's side).0 (disabled)Don't allow it, it opens the door to cheats.
sv_pureLevelBlocks modified game files on players' side: 1 allows only audio and known graphics mods, 2 blocks everything.Not set, or 1Competitive and PvP servers.
sv_enableNetworkedSoundsLets clients send sound events through the server. Often abused.falseOnly when a script explicitly needs it.
sv_enableNetworkedScriptEntityStatesLets clients change entity state through the server. Often abused.falseOnly when a script explicitly needs it.
sv_filterRequestControlBlocks taking control of other players' entities (0 off up to 4 strictest).2 (blocks taking over player-controlled entities)If scripts that hand over entities have problems, try 1.

Selected game builds (each also includes all older DLCs):

BuildDLC name
2802Los Santos Drug Wars
3095The Chop Shop
3258Bottom Dollar Bounties
3407Agents of Sabotage
3570Money Fronts
3751A Safehouse in the Hills
3889The Kortz Center Heist

The full, up-to-date list is in the FiveM documentation (link at the bottom). A higher build means a bigger download for players the first time they connect.

OneSync#

OneSync is FiveM's synchronization system: the server knows the position and state of all players and entities (cars, peds, objects) and decides itself what to send to whom. Thanks to this, it can handle more players, and scripts can work with entities directly on the server. Modern frameworks (ESX Legacy, QBCore, Qbox) require OneSync.

ModeWhat it meansWhen to use it
onFull OneSync (formerly “Infinity”), up to 2048 players. Entities far from a player aren't sent to them.Almost always. txAdmin recipes turn it on for you.
legacyA compatibility mode for old scripts that expect every player to see all the others. Worse performance and graphical glitches.Only for an old script that doesn't work otherwise.
offNo OneSync; the server only relays data between players. Only for small servers: 32 or more slots require OneSync.Practically never.

Slot limits:

  • OneSync is free up to 48 slots. More slots require a FiveM Element Club Argentum subscription or higher on the Cfx.re Portal (opens in a new window).
  • sv_maxclients of 32 and up requires OneSync on or legacy; more than 64 requires on.
  • The subscription alone doesn't raise the slot count. After buying it, you have to increase sv_maxclients and restart the server.

Where to turn OneSync on:

  • With txAdmin: only in txAdmin, Settings › FXServer › advanced options › OneSync (OneSync On recommended). txAdmin comments out any set onesync lines in server.cfg itself, with the note onesync MUST only be set in the txAdmin settings page.
  • Without txAdmin: with the line set onesync on in server.cfg.

The FiveM for GTAV Enhanced platform no longer uses peer-to-peer (P2P) synchronization; the game always runs through the server.

Resources and ensure order#

CommandWhat it does
ensure nameStarts a resource. If it's already running, restarts it. The recommended command for server.cfg.
start nameStarts a resource if it isn't running.
ensure [category]Starts all resources in the [category] folder (a folder in square brackets).

Resources start in the order they appear in the file. So:

  1. Standard FiveM resources at the top (mapmanager, chat, spawnmanager …).
  2. Then the libraries the others depend on: oxmysql, ox_lib.
  3. Then the framework core (es_extended, qb-core, qbx_core).
  4. Finally the framework scripts and your own scripts.

If a script comes before its dependency, it won't start. Details in FiveM resources.

ACE permissions#

FiveM has a built-in permission system (ACL). It's made up of two commands:

server.cfgcfg
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_principal identifier.fivem:<FIVEM_ID> group.admin
  • add_ace group.admin command allow – the group.admin group may use all commands (command is the general permission for commands).
  • add_ace group.admin command.quit deny – except the quit command, which shuts down the server.
  • add_principal identifier.fivem:<FIVEM_ID> group.admin – the player with this identifier belongs to the group.admin group and inherits its permissions.

In general: add_ace <WHO> <WHAT> allow|deny grants a permission and add_principal <WHO> <GROUP> puts a player in a group. The opposite commands are remove_ace and remove_principal. To find out whether someone has a permission, use the test_ace <WHO> <WHAT> command in the console.

Player identifiers:

IdentifierExampleNote
identifier.fivem:identifier.fivem:<FIVEM_ID>The numeric ID of the Cfx.re account. txAdmin uses it for the main admin.
identifier.license:identifier.license:<PLAYER_LICENSE>The Rockstar game license. Used by most frameworks (QBCore).
identifier.discord:identifier.discord:<DISCORD_ID>The numeric Discord user ID. The player must have Discord running.
identifier.steam:identifier.steam:<STEAM_HEX>The Steam ID in hexadecimal. Only works with steam_webApiKey set.

You'll find a specific player's identifiers in txAdmin: Players, click the player and open the IDs tab. txAdmin adds the admin itself (the {{addPrincipalsMaster}} line in the recipe). Frameworks have their own admin groups, see ESX, QBCore or Qbox?.

For advanced users: permissions for a resource

A resource may need permission to run commands, for example add_ace resource.es_extended command.add_principal allow. Framework recipes include such lines. Don't delete them, otherwise the framework can't assign groups.

Verification#

  1. Save server.cfg and restart the server.
  2. In the console (customer area or Live Console in txAdmin), check that no errors appeared at startup and that the resources started (Started resource …).
  3. Open http://<IP_ADDRESS>:<PORT>/info.json in your browser (address from the Network tab). You'll see JSON with the server's public settings, including the values set with sets (sv_projectName, locale, tags).
  4. Check the server with the CFX Resolver tool: it shows the name, slots, OneSync and the enforced build.

Troubleshooting#

Look up messages you can't find here in Common FiveM server errors.

The server isn't in the server list or shows as “private”#

  • The sv_master1 "" line must not be active. Comment it out with #.
  • Check that you have both sets sv_projectName and sets sv_projectDesc.
  • It can take up to 8 minutes after startup for the server to appear in the list.
  • Check that you can connect to the server directly: press F8 in the game and type connect <IP_ADDRESS>:<PORT>.

Connection rejected by server: Client/Server game build revision mismatch#

The player and the server have different build revisions, typically shortly after a game update. Update the server artifacts (guide). Players can switch the Update Channel in the FiveM client (gear icon › Game).

Players take a long time to connect or get stuck downloading#

After you change sv_enforceGameBuild, every player downloads the DLC data. This happens only once. If they get stuck repeatedly, check that the build exists (table above) and that there's no typo.

A ## [txAdmin CFG validator]: … line appeared in server.cfg#

txAdmin commented out a line that isn't allowed in server.cfg and wrote the reason after the colon. Most often it's onesync MUST only be set in the txAdmin settings page. (OneSync belongs in the txAdmin settings) or you MUST NOT start/stop/ensure txadmin resources. (txAdmin starts on its own; delete ensure monitor).

You can't set more than 48 slots#

Without an Element Club Argentum subscription, the limit is 48. On a server without txAdmin, the slot count may also be controlled by a variable in the Settings tab › Variables.

A change reverted after a restart#

You edited a line that a variable from the Settings tab overwrites at startup, or a different file than the one the server loads. With txAdmin, check CFG File Path in Settings › FXServer.

Summary

  • server.cfg is read top to bottom. set is for the server only, setr is sent to players, sets is publicly visible. Passwords only with set.
  • The port in endpoint_add_tcp and endpoint_add_udp must match the Network tab. sv_projectName, sv_projectDesc and sets locale determine how the server looks in the list.
  • OneSync on is the right choice for almost every server. With txAdmin, it's turned on only in Settings › FXServer. Free up to 48 slots.
  • Start resources with ensure, dependencies before scripts. Add admins with add_principal and the player's identifier.

Search the guides