Halloween Edition36 maps, limited runlimited runShop the drop
Chapter 04 of 17The Server Handbook for FiveM

server.cfg, line by line

In short

server.cfg is a list of console commands run at startup. Endpoints and convars go first, resources start in dependency order, and secrets live in a separate file.

server.cfg — a production-style example
# Network: players connect on 30120, TCP and UDP
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# How the server appears in the server list
sv_hostname "Night City RP"
sets sv_projectName "Night City RP"
sets sv_projectDesc "Serious roleplay with custom jobs, housing and a player-run economy."
sets tags "roleplay, serious, economy, jobs"
sets locale "en-US"
load_server_icon logo96.png
sets banner_detail "https://example.com/banner-detail.png"
sets banner_connecting "https://example.com/banner-connecting.png"

# Game settings (startup only)
set onesync on
sv_maxclients 48
sv_enforceGameBuild 3258

# Security basics (see the Security chapter)
sv_scriptHookAllowed 0
sv_endpointPrivacy true
sv_pureLevel 1

# Database for oxmysql
set mysql_connection_string "mysql://fivem:[email protected]/fivem?charset=utf8mb4"

# Base resources, then libraries, then framework, then everything else
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure hardcap
ensure oxmysql
ensure ox_lib
ensure [framework]
ensure [jobs]
ensure [maps]
ensure [ui]

# Permissions
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_principal identifier.fivem:1 group.admin

# Keys and tokens live in a file you never share
exec secrets.cfg
secrets.cfg — kept out of screenshots, Git and support tickets
sv_licenseKey "your-server-key"
set steam_webApiKey ""
set discord_bot_token "..."
LineWhy it matters
endpoint_add_tcp / endpoint_add_udpThe port players connect on; both protocols are needed
sets sv_projectName / sv_projectDescRequired for the server list — if either is missing the server shows an error on startup and may not be listed
sets tags / sets localeServer list filters and language; replace the default root-AQ with a real locale
load_server_iconThe server list icon — a 96×96 PNG
set onesync onRequired above 64 slots; enables server-side entities and routing buckets
sv_maxclients1–2048 slots; more than 48 needs a Cfx.re subscription (Element Club Argentum or higher)
sv_enforceGameBuildGame build for every player; only read at startup
ensureStarts a resource, or restarts it if it is running; order = dependency order
execRuns another cfg file — perfect for secrets and per-server overrides
set / sets / setrset is a normal convar, sets also publishes it to the server list, setr replicates it to clients

The Server Handbook for FiveM

This chapter is one of 17. The handbook also carries the console command and convar cheat sheets, a glossary and the official references every chapter is checked against.

Open the handbook