WELCOME coupon available Use code WELCOME at checkout through July 31, 2026. WELCOME

FiveM server.cfg Guide

The server.cfg file is the heart of every FiveM server. It defines how your server runs: slots, networking, game build, OneSync, logging, and visibility in the server list. This guide is for server owners and developers who want safe defaults, production hardening, and performance best practices. Always keep backups and use version control. If you’re new, start with our How to create a FiveM server. For deeper optimizations, see our Performance hub.



TL;DR: Production-ready baseline (annotated)

A clean server.cfg is the foundation of stability. Below are two examples: a minimal dev config and a hardened production config.

Minimal dev config

# server.cfg (development)
# Basic config for local testing

# Network
endpoint_add_tcp "0.0.0.0:30120"   # TCP port binding
endpoint_add_udp "0.0.0.0:30120"   # UDP port binding

# Server info
sv_hostname "My Dev Server"
sv_maxclients 8

# OneSync
set onesync on

# Resources (basic example)
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure hardcap
ensure baseevents

# Permissions (default ACL)
exec permissions.cfg

Hardened production config

# server.cfg (production)

# Network
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# Security
sv_endpointPrivacy true                # Hide IP in server list
sv_scriptHook 0                         # Disable client mods
rcon_password "StrongRconPassword123"   # Disable if not needed

# Slots
sv_maxclients 64                        # Adjust to host capacity

# Game build (use latest recommended)
sv_enforceGameBuild 2944                # Or alias: "mp2024_02"

# Project info
sv_hostname "FIVEMX Roleplay | Serious RP"
sets sv_projectName "FIVEMX RP Server"
sets sv_projectDesc "Realistic RP with QBCore & custom scripts"
sets tags "roleplay, seriousrp, qbcore"
sets locale "en-US"
load_server_icon mylogo.png
sets banner_detail "https://cdn.example.com/banner.png"
sets banner_connecting "https://cdn.example.com/loading.png"

# OneSync
set onesync on

# Resources (use resource list)
exec resources.cfg

# Logging & ACL
set sv_logLevel 2
exec permissions.cfg

# txAdmin integration
set mysql_connection_string "mysql://user:pass@localhost/fivemdb"

Tip: Always validate your config after edits with txAdmin health checks and console logs. See txAdmin logs.


Server information & listing

The following convars control how your server appears in the server browser and API:

ConvarPurposeExampleWhen to changeCaveats
sv_hostnamePublic name in the server listsv_hostname "My RP Server [EN]"Always setAvoid special chars, keep clear
sets sv_projectNameInternal project display namesets sv_projectName "MyCommunityRP"Branding, multi-server setupsOnly visible in list UI
sets sv_projectDescDescription shown in listsets sv_projectDesc "QBCore RP Server"Add rules, language, featuresKeep < 100 chars
sets tagsServer list tagssets tags "roleplay, cars, qbcore"Improve discoverabilityUse official tags only
sets localeDefault languagesets locale "en-US"Match server languageWrong locale may hide server
sv_endpointPrivacyHide public IP in browsersv_endpointPrivacy trueRecommended for productionPlayers connect via Cfx relay
load_server_icon96×96 PNG iconload_server_icon mylogo.pngFor brandingMust be square, <96×96 pixels
sets banner_detailLarge banner in server listsets banner_detail "url"Optional but recommendedMust be HTTPS URL
sets banner_connectingBanner shown on connectingsets banner_connecting "url"Good for branding/loadingUse CDN to avoid lag

See the [official convars list][1] for full reference.


Networking & slots

FiveM servers use TCP/UDP endpoints. By default, port 30120 is used.

endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
sv_maxclients 64
  • Run multiple servers on one machine with port offsets: e.g. 30121, 30122.
  • Match firewall rules to open TCP/UDP ports.
  • sv_maxclients directly affects CPU & RAM usage — don’t set higher than your hardware can handle. See Server Hosting Providers

Warning: Don’t expose MySQL or RCON ports to the internet.


Game build & artifacts

Each server build (artifact) corresponds to a GTA V game build. Always pin a specific build to avoid unexpected changes.

# Example forcing build 2944 (Los Santos Drug Wars update)
sv_enforceGameBuild 2944
# or use alias
enforce_game_build mp2024_02
  • [Official convars doc][1] lists valid build numbers.
  • Set build in server.cfg or in txAdmin → Settings → FXServer → Additional arguments:
+set sv_enforceGameBuild 2944
  • Download latest artifacts from [runtime.fivem.net][4] (Windows) or the Linux build page.
  • Never mix client and server builds.

OneSync configuration

OneSync enables server-side entity sync: more players, accurate states, better streaming. Always use OneSync on for modern frameworks (QBCore, ESX).

SettingEffectTypical valueImpact on CPU/memoryDocs
onesyncEnables OneSynconHigher CPU usage[OneSync docs][3]
onesync_populationControls local NPCs/trafficon (optional)Adds CPU load[OneSync docs][3]
onesync_distanceCullVehiclesStream vehicles efficientlytrueBetter perf, saves bandwidth[OneSync docs][3]

Tip: Scale sv_maxclients with hardware. Use Resmon guide to measure resource impact.


Resource start order & dependencies

Resources load in the order defined by ensure. Always start dependencies first.

# resources.cfg (split file)
ensure oxmysql
ensure qb-core
ensure qb-adminmenu
ensure qb-inventory
ensure qb-policejob
ensure my-custom-scripts

In server.cfg:

exec resources.cfg
  • Keep frameworks and DB connectors first.
  • Group related resources.
  • Avoid ensure * in production; it causes non-deterministic order.

Security & abuse hardening

A secure server.cfg prevents leaks and abuse.

Checklist:

  • sv_endpointPrivacy true
  • sv_scriptHook 0 (block client mods)
  • Strong or disabled rcon_password
  • Use add_principal and add_ace for ACLs
  • Hide API keys in .env, not in server.cfg
  • Update artifacts regularly
  • Monitor txAdmin logs
  • Use Resmon guide to catch heavy scripts

ACL example:

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

CDN & asset streaming (when to use)

For large MLOs, custom cars, and textures, use a CDN to reduce join times.

  • Host files on a CDN like Cloudflare R2 (set [CORS headers][6]).
  • For high performance, BunnyCDN supports [range requests][7] (needed for .rpf streaming).
  • Add versioned URLs to avoid cache conflicts.

See our Optimize loading times guide.


Myths & deprecated flags

Many configs online still show Source Engine cvars like:

sv_maxrate 0
sv_minrate 30000
sv_maxupdaterate 60

Do not use. These are not supported in FiveM and have no effect. See [official convars][1].

Deprecated/legacy convars:

  • sv_master1 → no longer needed.
  • sv_useDirectListing → replaced by sv_endpointPrivacy.

Validation & troubleshooting

Key checks after editing server.cfg:

SymptomLikely causeFixTime
Server not startingSyntax error in configCheck console, remove invalid lines5m
Not in server listMissing sv_hostname/tagsAdd hostname/tags, check firewall, sv_master110m
Players can’t connectPorts closed / wrong IPOpen 30120 TCP+UDP, check endpoint_add_*15m
High CPU usageToo many slots / bad scriptsLower sv_maxclients, use Performance tuning20m
Long loading timesLarge assets unoptimizedUse Optimize loading times + CDN20m
Crashes after updateBuild mismatchPin sv_enforceGameBuild, update [artifacts][4]15m

Internal resources & next steps


FAQ

1. What is server.cfg in FiveM?
It’s the main configuration file that defines server name, slots, resources, networking, security, and visibility.

2. Where should I place server.cfg?
Inside your server’s root folder (next to server.exe or FXServer entrypoint). txAdmin loads it automatically.

3. What’s the difference between set, sets, and setr?

  • set: server-only variable.
  • sets: shows up in server list (public info).
  • setr: synced to clients.

4. My server doesn’t show in the list. Why?
Check sv_hostname, sets tags, sets locale, and sv_endpointPrivacy. Also ensure your ports are open.

5. How do I increase player slots?
Change sv_maxclients. Scale gradually and monitor with Resmon guide. Ensure your hardware and network can handle it.

6. What is sv_enforceGameBuild?
A convar that forces clients to use a specific GTA V game build. Prevents crashes from mismatched versions. See [Convars doc][1].

7. Should I use build numbers or aliases?
Either works. Numeric (2944) is explicit; alias (mp2024_02) is easier to track. Both are supported.

8. Where do I set sv_enforceGameBuild in txAdmin?
In txAdmin → Settings → FXServer → Additional arguments. Example: +set sv_enforceGameBuild 2944.

9. What is OneSync?
A system that allows more players, accurate entity streaming, server authority. Required for modern frameworks. See [OneSync docs][3].

10. Infinity vs Legacy OneSync?
Legacy = up to 64 slots. Infinity = supports 128+, advanced entity sync. Always use onesync on (Infinity by default).

11. How do I organize resources?
Use exec resources.cfg. Start DB connectors first, then frameworks, then jobs/scripts. Avoid ensure *.

12. My banners don’t show in the server list.
Ensure URLs are HTTPS, public, and point to correct image sizes. Use a CDN for reliability.

13. What are txAdmin logs for?
They show errors, crashes, resource issues. See txAdmin logs.

14. How do I check performance issues?
Use resmon 1 in console. See our Resmon guide for details.

15. Are Source engine rate flags needed?
No. sv_maxrate, sv_minrate, sv_maxupdaterate do nothing in FiveM. Use [Convars doc][1] instead.


Credits:

Luke
Luke

I'm Luke, I am a gamer and love to write about FiveM, GTA, and roleplay. I run a roleplay community and have about 10 years of experience in administering servers.

Articles: 436