How to Configure server.cfg for Your FiveM Server: Complete Reference
Your server.cfg controls everything about how your FiveM server runs. This complete reference covers every important setting from hostname and player limits to resource load order and ACL permissions.
Your server.cfg is the single most important configuration file on your FiveM server. Every time the server starts, it reads this file from top to bottom and applies every setting and ensure statement it finds. Getting it right is not optional — a misconfigured server.cfg causes startup failures, performance problems, and security issues.
This guide is a complete reference for every setting you need to understand.
File Location and Syntax
Your server.cfg lives in your server-data folder:
C:/FXServer/server-data/server.cfg
Syntax rules:
- Lines starting with
#are comments and are ignored by the server - Settings use the format
setting_name "value"orsetting_name value - Resource start commands use
ensure resource-name - Variables use
set variable_name "value"orsetr variable_name "value"
Server Identity Settings
These control how your server appears in the FiveM server browser:
# Display name in the server list — make it descriptive and unique
sv_hostname "ModForge Roleplay | QBCore | 24/7 Staff | Active Community"
# Longer description shown in the server info panel
sv_projectDesc "Premium FiveM roleplay with custom jobs, economy, and housing."
# Internal project name
sv_projectName "ModForge RP"
# Tags help players find your server — use relevant keywords
sets tags "roleplay, qbcore, economy, housing, active, custom"
# Server language tag
sets locale "en-US"
Tips for sv_hostname:
- Include your framework name (QBCore / ESX) so players know what to expect
- Mention what makes you unique — "custom jobs", "active staff", "24/7"
- Avoid excessive symbols and emojis — they look unprofessional
Player and Connection Settings
# Maximum concurrent players — start at 32 and increase as your server grows
sv_maxclients 64
# Server endpoint — the port your server listens on (default 30120)
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
# OneSync — required for servers with more than 32 players
# Enable early, even before you hit 32 players, to avoid migration later
set onesync on
OneSync modes:
on— standard OneSync (recommended for most servers)legacy— compatibility mode for older scripts that have sync issues
License Key
# Your unique server license key from keymaster.fivem.net
sv_licenseKey "YOUR_LICENSE_KEY_HERE"
Security note: Never commit your server.cfg with a real license key to a public GitHub repository. Use a separate config file that is .gitignored or use environment variable substitution.
Database Connection
The oxmysql connection string must appear before the ensure oxmysql line:
set oxmysql_connection_string "mysql://username:password@localhost/database_name?charset=utf8mb4"
Connection string format:
mysql://USERNAME:PASSWORD@HOSTNAME/DATABASE?charset=utf8mb4
If your password contains special characters, URL-encode them:
@→%40#→%23!→%21%→%25
Variables (set vs setr)
Variables let scripts read configuration from server.cfg without hardcoding values.
set variable_name "value" -- server-side only
setr variable_name "value" -- replicated to clients (both sides can read it)
Common uses:
# Force a specific GTA V game build (check FiveM docs for current recommended build)
set sv_enforceGameBuild 3095
# Custom server variables scripts can read
setr serverVersion "2.1.0"
setr communityName "ModForge Roleplay"
# Discord webhook for ban notifications (server-side only, keep private)
set discord_ban_webhook "https://discord.com/api/webhooks/..."
Game Build
Forcing a specific GTA V game build ensures all players use the same version, which prevents desync caused by version mismatches:
set sv_enforceGameBuild 3095
Always check the FiveM documentation for the current recommended build number — it changes with GTA V updates and FiveM updates. Using an outdated build can cause players to miss content from newer DLCs.
Access Control List (ACL)
The ACL system controls what resources and players can do. Every server needs at minimum these admin permission lines:
# Grant admin group permission to use all commands
add_ace group.admin command allow
add_ace group.admin command.quit allow
add_ace group.admin command.restart allow
add_ace group.admin command.start allow
add_ace group.admin command.stop allow
add_ace group.admin command.sets allow
# Add yourself to the admin group using your Steam hex identifier
# Convert your Steam64 ID to hex at steamid.xyz
add_principal identifier.steam:YOUR_STEAM_HEX_ID group.admin
For additional admin staff, add more add_principal lines:
add_principal identifier.license:abc123def456 group.admin
Resource Load Order
This section is the most critical part of your server.cfg. Resources load from top to bottom. A resource cannot use anything from a resource listed below it.
Correct load order template:
# ── Infrastructure ──────────────────────────────────────────────
ensure oxmysql
# ── Shared Libraries ────────────────────────────────────────────
ensure ox_lib
# ── Framework Core ──────────────────────────────────────────────
ensure qb-core
# ── Framework Base Scripts ──────────────────────────────────────
ensure qb-multicharacter
ensure qb-spawn
ensure qb-hud
ensure qb-menu
ensure qb-input
ensure qb-notify
# ── Inventory (must be before any script that uses items) ────────
ensure ox_inventory
# ── Jobs ────────────────────────────────────────────────────────
ensure qb-policejob
ensure qb-ambulancejob
ensure qb-mechanicjob
# ── Economy & Finance ────────────────────────────────────────────
ensure qb-banking
ensure qb-atm
ensure qb-shops
# ── Housing & Properties ─────────────────────────────────────────
ensure qb-houses
ensure qb-apartments
# ── Vehicles ─────────────────────────────────────────────────────
ensure qb-vehicleshop
ensure qb-garage
ensure qb-vehiclekeys
# ── Custom Interiors (MLOs) ───────────────────────────────────────
ensure mlo-police-station
ensure mlo-hospital
# ── Custom Vehicle Packs ─────────────────────────────────────────
ensure vehicle-pack-sports
ensure vehicle-pack-trucks
Required Default Resources
These ship with cfx-server-data and should always be included:
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
Common server.cfg Mistakes
Wrong: Putting a script before its dependency:
ensure qb-policejob ← will fail, qb-core not loaded yet
ensure qb-core
Right:
ensure qb-core
ensure qb-policejob ← works, qb-core already loaded
Wrong: Missing the connection string before oxmysql:
ensure oxmysql
set oxmysql_connection_string "..." ← too late, already tried to connect
Right:
set oxmysql_connection_string "..." ← must come first
ensure oxmysql
After Making Changes
You do not need to fully restart the server every time you add a new resource to server.cfg. Use the console command:
refresh — tells the server to scan for new resources on disk
ensure new-script-name — starts the newly added resource
For changes to global settings like sv_hostname or sv_maxclients, a full restart is required.
A correctly configured server.cfg is the foundation every script on your server depends on. Find quality verified scripts to fill it out at modforge.xyz.