Skip to main content

D-SERV Refresh promotion: 15% OFF

Claim now →
D-SERV

Guide to your FiveM server.cfg — everything you need to know

Networking, security, exploit protection, metadata, licences, oxmysql, start order and ACE permissions — line by line.

8 min readGame Hosting

Your server.cfg is the first file FXServer reads. It decides how players connect, how strictly clients are checked, how your server appears in the server list and in which order resources start. This guide walks through a production-ready config section by section — copy the blocks, then adjust the values marked in comments.

Note:

On a D-SERV VPS the file normally lives in your txData folder (e.g. /home/fivem/txData/default/server.cfg). Restart FXServer after every change.

1. Network & connectivity

These lines bind the server to its port, cap concurrent players and set the network players see while connecting.

server.cfg
# Listen on all interfaces (default FiveM port)endpoint_add_tcp "0.0.0.0:30120"endpoint_add_udp "0.0.0.0:30120" # Maximum concurrent players (licence-dependent)sv_maxclients 48 # Shown while players are connectingload_server_icon logo.pngsets banner_detail "https://example.com/banner-detail.png"sets banner_connecting "https://example.com/banner-connecting.png"

2. Security & environment integrity

Pure mode rejects modified client files, and disabling ScriptHook blocks most external mod menus.

server.cfg
# 0 = off, 1 = block modified audio/graphics, 2 = block all modified filessv_pureLevel 1 # Block ScriptHook-based menussv_scriptHookAllowed 0 # Enforce the latest game build your resources supportsv_enforceGameBuild 3095

3. Exploit protection & anti-troll

Most griefing relies on clients taking control of entities they don’t own or spamming networked effects. Lock those paths down:

server.cfg
# Only the server may create networked entities (strict)sv_entityLockdown strict # Filter client-triggered events and particle effectssv_enableNetworkedSounds falsesv_enableNetworkedPhoneExplosions falsesv_filterRequestControl 4
Warning:

sv_entityLockdown strict breaks resources that spawn networked entities client-side. If a script stops working, try relaxed and update that resource.

4. Identity & discovery (metadata)

How your server appears in the FiveM server browser. Keep the hostname readable — colour codes and emoji spam hurt more than they help.

server.cfg
sv_hostname "My RP City | Serious RP | Custom Jobs"sets sv_projectName "My RP City"sets sv_projectDesc "Serious roleplay with custom jobs and a friendly staff team"sets tags "roleplay, serious, economy, jobs"sets locale "en-GB"

5. Licences & tokens (your IDs)

A Cfx.re licence key is required for the server to start. Other keys are only needed by the services that use them.

server.cfg
# Get yours at keymaster.fivem.net — never share itsv_licenseKey "cfxk_XXXXXXXXXXXXXXXXXXXXXXXX" # Steam Web API key (only if a resource needs Steam identifiers)set steam_webApiKey "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Never commit these values to a public repository. If a key leaks, regenerate it straight away.

6. Database integration (oxmysql)

oxmysql reads its connection string from a convar. Point it at your MySQL/MariaDB database and enable the slow-query warning so you can spot heavy scripts.

server.cfg
set mysql_connection_string "mysql://fivem:[email protected]:3306/fivem?charset=utf8mb4" # Log queries slower than 150 msset mysql_slow_query_warning 150

Need phpMyAdmin on your VPS? We can install and configure it for €5.00 — see the pricelist.

7. Resource start order

server.cfg
ensure oxmysqlensure ox_libensure es_extended   # or qb-coreensure [standalone]ensure [jobs]

8. ACE permissions

server.cfg
add_ace group.admin command allowadd_ace group.admin command.quit denyadd_principal identifier.fivem:1234567 group.admin

Still stuck?

Our engineers configure servers every day — we're here to help.

Ask a human
All guides

Planning a migration or a new project?

Tell us what you run today. We’ll propose a setup and a fixed monthly price — and migrate your servers, sites and mailboxes for free.