Bugün 20% tasarruf edin Ödemede WELCOME kodunu kullanın. WELCOME

FiveM server.cfg Guide

The sunucu.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 FiveM sunucusu nasıl oluşturulur. For deeper optimizations, see our Performance hub.



TL;DR: Production-ready baseline (annotated)

A clean sunucu.cfg is the foundation of stability. Below are two examples: a minimal dev config ve bir 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"

Uç: 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:

ConvarAmaçÖrnekWhen to changeCaveats
sv_ana_bilgisayar_adıPublic 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 languageyerel ayarı "en-US" olarak ayarlarMatch server languageWrong locale may hide server
sv_endpointPrivacyHide public IP in browsersv_endpointPrivacy doğruRecommended 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

Uyarı: 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 sunucu.cfg veya 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).

AyarEffectTypical valueImpact on CPU/memoryDocs
onesyncEnables OneSyncAçıkHigher CPU usage[OneSync docs][3]
onesync_populationControls local NPCs/trafficAçık (optional)Adds CPU load[OneSync docs][3]
onesync_distanceCullVehiclesStream vehicles efficientlydoğruBetter perf, saves bandwidth[OneSync docs][3]

Uç: Ölçek sv_maxclients with hardware. Use Resmon guide to measure resource impact.


Resource start order & dependencies

Resources load in the order defined by emin olmak. 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

İçinde sunucu.cfg:

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

Security & abuse hardening

A secure sunucu.cfg prevents leaks and abuse.

Checklist:

  • sv_endpointPrivacy doğru
  • sv_scriptHook 0 (block client mods)
  • Strong or disabled rcon_password
  • Kullanmak add_principal Ve add_ace for ACLs
  • Hide API keys in .env, not in sunucu.cfg
  • Update artifacts regularly
  • Monitör txAdmin logs
  • Kullanmak 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 beğenmek:

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_usta1 → no longer needed.
  • sv_useDirectListing → replaced by sv_endpointPrivacy.

Validation & troubleshooting

Key checks after editing sunucu.cfg:

BelirtiLikely causeDüzeltmekZaman
Server not startingSyntax error in configCheck console, remove invalid lines5m
Not in server listMissing sv_ana_bilgisayar_adı/tagsAdd hostname/tags, check firewall, sv_usta110m
Players can’t connectPorts closed / wrong IPOpen 30120 TCP+UDP, check endpoint_add_*15m
High CPU usageToo many slots / bad scriptsDaha düşük sv_maxclients, kullanmak Performance tuning20m
Long loading timesLarge assets unoptimizedKullanmak Optimize loading times + CDN20m
Crashes after updateBuild mismatchPin sv_enforceGameBuild, update [artifacts][4]15m

Internal resources & next steps


SSS

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

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

3. What’s the difference between ayarlamak, sets, Ve setr?

  • ayarlamak: 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?
Kontrol etmek sv_ana_bilgisayar_adı, sets tags, sets locale, Ve 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?
Kullanmak 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?
Kullanmak resmon 1 in console. See our Resmon guide for details.

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


Credits:

Luka
Luka

Ben Luke, bir oyuncuyum ve FiveM, GTA ve rol yapma hakkında yazmayı seviyorum. Bir rol yapma topluluğu yönetiyorum ve sunucuları yönetme konusunda yaklaşık 10 yıllık deneyimim var.

Articles: 436