GTA V FiveM guide

FiveM server.cfg Explained: Endpoints, Convars and Resources

By the ChicagoServers team · Updated · 7 min read

A FiveM server.cfg does five jobs: bind the server to a port (endpoint_add_tcp and endpoint_add_udp, normally 0.0.0.0:30120), identify it with a license key, set limits like sv_maxclients and onesync, grant permissions, and start your resources with ensure.

One thing trips up almost everyone following older tutorials: server name, description, tags, locale, banner and icon are no longer set in server.cfg. FiveM now configures them in the Cfx.re Portal. This guide is checked against the current FiveM documentation.

Quick answer
  • Bind with endpoint_add_tcp "0.0.0.0:30120" and endpoint_add_udp "0.0.0.0:30120". Port 30120 over TCP and UDP is the default.
  • sv_licenseKey comes from portal.cfx.re. sv_maxclients accepts 1 to 2048, but the free limit is 48 and values from 32 need OneSync.
  • sv_hostname, sv_projectName, sv_projectDesc, load_server_icon, tags and locale are deprecated in server.cfg. Set them in the Portal.
  • ensure starts a resource, or restarts it if it is already running. Order matters: dependencies go above the resources that use them.
  • Keep sv_scriptHookAllowed at its default of false.
On this page
  1. How server.cfg is loaded
  2. A working example, annotated
  3. Network and identity settings
  4. What moved to the Portal (and what still works in server.cfg)
  5. set, setr and sets: the three kinds of convar
  6. ensure, start and resource order
  7. Permissions with add_ace and add_principal
  8. Frequently asked questions
  9. References

How server.cfg is loaded

FXServer reads the file you point it at with +exec, and commands run top to bottom. In a vanilla install you start the server from your server-data folder with +exec server.cfg. With txAdmin, it runs the file for you. The FiveM docs list the common mistakes: if no resources are found and you see "Failed to start resource", you started from the wrong folder; if resources do not start and clients cannot connect, you left out +exec; and "no license key was specified" often means one of those two.

Lines starting with # are comments, and a config can include another with exec filename.cfg. Hosting with ChicagoServers? The GTA V FiveM server hosting page lists what is included, such as free server backups and SFTP file access.

A working example, annotated

Based on FiveM's example server.cfg and the txAdmin Basic Server recipe
# Network: TCP and UDP on port 30120
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# Identity and capacity
sv_licenseKey "your-key-from-portal"
sv_maxclients 48
set onesync on

# Default resources
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
ensure rconlog

# Scripthook off (default); not recommended to enable
sv_scriptHookAllowed 0

# Permissions
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_principal identifier.fivem:1 group.admin  # replace with your own identifier

# Optional
#set rcon_password "change-me"
#sv_master1 ""
#sv_enforceGameBuild 3751

Network and identity settings

SettingWhat it doesNotes
endpoint_add_tcpCreates a TCP listener, for example "0.0.0.0:30120".Only change the IP on servers with multiple network interfaces.
endpoint_add_udpCreates a UDP host on the given address and port.The address and port must be valid and unused.
sv_licenseKeyYour server license key.Get one at portal.cfx.re.
sv_maxclientsPlayer slots, from 1 to 2048.From 32 requires onesync on or legacy; above 64 requires on.
onesyncState awareness mode: off, on or legacy.On is full state awareness and server-determined entity routing. Legacy is not recommended.
sv_scriptHookAllowedLets clients with Script Hook V connect.Default false. Docs say enabling it makes the server vulnerable.
sv_enforceGameBuildSelects the game build clients use.Startup only. Some resources require a specific build. See the build table in the docs.
rcon_passwordEnables RCON.If unset, RCON is disabled. RCON uses UDP.
sv_master1 ""Marks the server private, disabling the browser's connect button.It does not delist the server. Leave it commented out unless you want this.
sv_endpointPrivacyIf true, hides player IPs from public reports.
steam_webApiKeyNeeded for Steam identifiers to be returned.Set only if you need Steam identifiers.

Slot limits: the default is 48 players. Going higher needs a Cfx.re Element Club subscription, and the exact ceiling depends on the tier and on OneSync Infinity, so check the current tiers at fivem.net/server-hosting before setting a large number.

The game server uses port 30120. If you run txAdmin yourself, its web interface uses a separate default port, 40120. A quick way to test that the game port is reachable is to open http://your-ip:30120/info.json in a browser; a JSON response means the server is up and reachable.

What moved to the Portal (and what still works in server.cfg)

FiveM now treats server listing details as account-level settings. The current Basic Server recipe's server.cfg says it plainly: server listing configuration moved to the Cfx Portal, and these convars cannot be configured in the file: sv_projectName, sv_projectDesc, sv_hostname, locale, tags, banner_connecting, banner_detail and load_server_icon. The FiveM docs mark sv_hostname, sv_projectName, sv_projectDesc and load_server_icon as deprecated and point to the Portal.

So if an old guide tells you to add sets tags "roleplay, economy" or sv_hostname "My Server", set those values at portal.cfx.re/servers instead. You can still use sets for custom server information, covered next.

set, setr and sets: the three kinds of convar

CommandVisible toTypical use
set name valueServer scripts only.Secrets and server-side config, such as a database connection string.
setr name valueServer and client scripts (replicated).Settings that the client UI also needs, such as locale for a framework.
sets name valueShown on the server details page, in the server list and in info.json.Public info such as sets Discord "link".

Use quotes around values with spaces. Never put secrets in setr or sets, because those values are exposed to players.

ensure, start and resource order

  • start name starts a stopped resource. stop name stops it.
  • ensure name restarts the resource if it is running, or starts it if it is not. It is the usual choice in server.cfg.
  • refresh rescans the resources folder, which you need after adding a resource while the server is running.
  • Folders in square brackets, like [standalone], are categories. ensure [standalone] starts every resource inside it.

Resources start in the order the lines appear, so list a resource's dependencies first. A typical pattern is database layer, then framework core, then framework add-ons, then your own scripts.

Dependencies first
ensure oxmysql
ensure my-framework-core
ensure [framework-addons]
ensure [my-scripts]

Permissions with add_ace and add_principal

FiveM uses an access control list. add_ace grants or denies an object to a principal, and add_principal makes one principal inherit from another.

Admin group, with quit denied
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_principal identifier.steam:110000112345678 group.admin

Identifiers in the docs include Steam and FiveM forms. txAdmin manages your own admin account, and the recipe fills in {{addPrincipalsMaster}}. Be strict with who you add. command allow gives a group every command.

Frequently asked questions

What port does a FiveM server use?

30120, over both TCP and UDP by default, set with endpoint_add_tcp and endpoint_add_udp. txAdmin's web interface defaults to TCP port 40120, which is separate.

Why is sv_hostname not changing my server name?

sv_hostname is deprecated, and the current Basic Server recipe states that listing details can no longer be configured in server.cfg. Set the name, description, tags and icon in the Cfx.re Portal instead.

What is the difference between ensure and start in FiveM?

start only starts a stopped resource. ensure restarts the resource if it is already running, or starts it if it is not, which makes it the safer choice for server.cfg.

How many players can my FiveM server hold?

The default limit is 48. More requires a Cfx.re Element Club tier and OneSync. sv_maxclients values from 32 require OneSync, and above 64 require OneSync on.

References