Configuring Your Server with server.cfg
A complete reference for the most important server.cfg directives used to configure FXServer.
Overview
server.cfg is the primary configuration file for FXServer. It lives inside server-data/ and is passed to the binary at startup via +exec. Every directive in this file is processed in order, so placement matters — sv_licenseKey must appear before the server attempts to authenticate, and ensure statements for framework resources must be ordered by dependency.
Minimal Working Configuration
# Networking
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
# Server identity
sv_hostname "My FiveM Server"
sv_projectName "My Project"
sv_projectDesc "A FiveM roleplay server"
sets tags "default, roleplay"
# License
sv_licenseKey "cfxk_xxxxxxxxxxxxxxxxxxxx_xxxxxx"
# Player limit
sv_maxclients 32
# Core resources
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
Networking Directives
Both TCP and UDP must be opened on port 30120. FiveM uses the same port number for both protocols:
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
Binding to 0.0.0.0 listens on all interfaces. Replace with a specific IP if you want to restrict which interface FXServer binds to.
Identity and Metadata
sv_hostname "My FiveM Server"
sv_projectName "My Project"
sv_projectDesc "Server description shown in server info"
sets tags "default, roleplay, economy"
sv_hostname is what players see in the server browser. sets tags controls search filter visibility in the FiveM client.
Player Limit
sv_maxclients 32
The default cap without OneSync is 32. To exceed 32 players, enable OneSync first — see Enabling OneSync for More Than 32 Players.
txAdmin Integration
Modern FXServer builds ship with txAdmin. The following line loads txAdmin's own configuration file:
exec @txAdmin/txAdminServer.cfg
This must come before your ensure statements so txAdmin can register its hooks.
Resource Loading Order
Resources are started with ensure:
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
For framework servers (ESX, QBCore), the framework resource must be ensured before any resource that depends on it. A typical ESX ordering looks like:
ensure oxmysql
ensure es_extended
ensure esx_menu_default
ensure esx_menu_list
# ... additional ESX resources
Convars and Set Variables
Pass configuration values to resources using set or sets:
set mysql_connection_string "mysql://user:password@localhost/fivem"
sets tags "roleplay, economy"
set creates a server-only convar; sets creates a convar visible in server info queries.
Comments
Lines starting with # are comments and are ignored by FXServer.
Applying Changes
Changes to server.cfg require a server restart to take effect. In txAdmin, use the Restart button in the control panel, or run restart from the server console. You do not need to restart the entire panel container — only FXServer.