How To Configure Your FiveM Server
Learn how to configure your FiveM dedicated server using server.cfg.
FiveM server configuration is handled through the server.cfg file. Here is an overview of the key settings.
Using Startup Settings
Open the Startup Page
Log in to the XGamingServer Panel and select your FiveM server. In the sidebar, click Startup.
Adjust Settings
The Startup page provides fields for common settings including license key, server name, max players, and more.
Restart Your Server
After making changes, restart from the Console page.
Editing server.cfg
Open Files
In the sidebar, click Files and open server.cfg.
Edit the Configuration
Here is an example of common server.cfg settings:
# Server Identity
sv_hostname "My FiveM Server"
sv_projectName "My Server Project"
sv_projectDesc "A custom FiveM server"
# License Key
sv_licenseKey "your_license_key_here"
# Network Settings
sv_maxclients 32
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
# OneSync (improved player synchronization)
onesync on
# Security
sv_scriptHookAllowed 0
# Resources
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
# Permissions
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_principal identifier.steam:110000xxxxxxxxx group.adminSave and Restart
Save the file and restart your server.
Key Settings Explained
| Setting | Description |
|---|---|
sv_hostname | Server name in the browser |
sv_maxclients | Maximum player count |
sv_licenseKey | Your cfx.re license key |
onesync | Enables improved sync for higher player counts |
sv_scriptHookAllowed | Allow ScriptHook (0 = disabled, 1 = enabled) |
ensure | Starts a resource when the server boots |
⚠️ Warning: Keep
sv_scriptHookAllowedset to0unless you specifically need it. Enabling it allows clients with modding tools to potentially exploit your server.
📝 Note: The
ensurecommand loads resources in order. Make sure dependencies are loaded before resources that require them.
How is this guide?