Back to Blog
Server Setup 10 min read April 2, 2025

FiveM Server.cfg Complete Guide: Every Setting Explained (2026)

The definitive reference for FiveM server.cfg — every directive explained with real examples. Network settings, player limits, OneSync, resource loading, database configuration, and security.

server.cfg fivem configuration fivem settings server setup fivem guide

What Is server.cfg?

The server.cfg file is the central configuration file for every FiveM server. It controls everything from your server's name and player limit to which resources load and in what order. Understanding this file is essential for every server owner in 2026.

This guide covers every important directive, organized by category, with real explanations of what each setting does.


Network Configuration

These settings define how players connect to your server:

endpoint_add_tcp "0.0.0.0:30120" — Defines the TCP endpoint. The IP 0.0.0.0 means the server listens on all network interfaces. Port 30120 is the FiveM default.

endpoint_add_udp "0.0.0.0:30120" — Same as above but for UDP traffic. Both TCP and UDP must use the same port.

If you are running multiple servers on the same machine, use different ports for each (e.g., 30120, 30121, 30122).


Server Identity

These settings control how your server appears in the FiveM server list:

  • sv_hostname "My Roleplay Server" — The name displayed in the server browser. Keep it descriptive and include keywords players might search for
  • sets sv_projectName "My Server" — The project name shown in the server detail view
  • sets sv_projectDesc "A serious roleplay server" — A short description of your server
  • sets tags "roleplay, esx, serious, custom" — Comma-separated tags that help players find your server when filtering
  • sets locale "en-US" — The locale of your server, used for language-based filtering
  • load_server_icon server.png — The server icon displayed in the server list. Must be a 96x96 PNG file in your server-data root

Player Settings

  • sv_maxclients 48 — The maximum number of players who can connect simultaneously. Common values are 32, 48, 64, or 128. Higher counts require more resources and OneSync
  • sv_endpointPrivacy true — Hides player IP addresses from other connected clients. Always enable this for player privacy
  • sv_scriptHookAllowed 0 — Controls whether clients with ScriptHookV can connect. Set to 0 to block them — this prevents most single-player mod menus from working on your server

License and Authentication

  • sv_licenseKey "your_key_here" — Your server license key from keymaster.fivem.net. Required for every FiveM server
  • sv_master1 "" — Setting this to empty disables server list listing, making your server unlisted. Useful for development or private servers

OneSync Configuration

OneSync is FiveM's advanced synchronization system for higher player counts and better entity management:

  • set onesync on — Enables OneSync. Recommended for all servers in 2026 and required for player counts above 32
  • set onesync_enableInfinity 1 — Enables OneSync Infinity mode, supporting up to 2048 players with server-side entity ownership

Resource Loading

Resources are loaded using the ensure command:

ensure mapmanager

ensure chat

ensure spawnmanager

ensure sessionmanager

ensure hardcap

ensure baseevents

Load order matters. Dependencies must be loaded before the resources that need them. A typical order is:

  1. Core FiveM resources (mapmanager, chat, hardcap)
  2. Database resource (oxmysql)
  3. Framework (es_extended, qb-core, or qbox-core)
  4. Framework dependencies
  5. Gameplay scripts (inventory, phone, vehicles, jobs)

You can organize resources into folders and load them with bracket syntax:

ensure [core]

ensure [framework]

ensure [gameplay]


Database Configuration

Most frameworks require a MySQL database connection:

set mysql_connection_string "mysql://user:password@localhost/fivem?charset=utf8mb4" — The connection string for oxmysql. Replace user, password, and database name with your actual values.


Splitting Configuration

For large servers, split your config into multiple files using exec:

exec permissions.cfg

exec resources.cfg

This is useful for separating ACE permissions and organizing resources into categories.


Security Best Practices

  • Always set sv_scriptHookAllowed to 0 in production
  • Enable sv_endpointPrivacy to protect player IPs
  • Keep your license key out of public repositories
  • Use rcon_password only if needed, and make it strong
  • Never share your server.cfg publicly if it contains sensitive credentials

Common Mistakes

  • Wrong port — Make sure your firewall allows both TCP and UDP on your server port
  • Missing ensure lines — If a resource isn't loading, check that its ensure line exists and is in the correct order
  • Database connection errors — Double-check the host, username, password, and database name in your connection string
  • Loading resources before dependencies — Framework scripts must load after the framework itself

Your Configuration Foundation

A well-organized server.cfg is the foundation of a stable FiveM server. Take the time to understand each setting, organize your resource loading order, and separate concerns into multiple config files as your server grows.

→ Browse Premium FiveM Scripts at Alone Studios

Ready to Transform Your Server?

FiveM Job Creator eliminates every problem discussed in this article. 0.00ms resmon. No-code configuration. ESX & QBCore native.

Get Job Creator on Tebex — €29.99