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.
# 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.cfgsv_licenseKey "your-server-key"
set steam_webApiKey ""
set discord_bot_token "..."| Line | Why it matters |
|---|---|
endpoint_add_tcp / endpoint_add_udp | The port players connect on; both protocols are needed |
sets sv_projectName / sv_projectDesc | Required for the server list — if either is missing the server shows an error on startup and may not be listed |
sets tags / sets locale | Server list filters and language; replace the default root-AQ with a real locale |
load_server_icon | The server list icon — a 96×96 PNG |
set onesync on | Required above 64 slots; enables server-side entities and routing buckets |
sv_maxclients | 1–2048 slots; more than 48 needs a Cfx.re subscription (Element Club Argentum or higher) |
sv_enforceGameBuild | Game build for every player; only read at startup |
ensure | Starts a resource, or restarts it if it is running; order = dependency order |
exec | Runs another cfg file — perfect for secrets and per-server overrides |
set / sets / setr | set is a normal convar, sets also publishes it to the server list, setr replicates it to clients |