Edit the server.cfg that your active FXServer or txAdmin profile actually loads. Keep a working copy, change only the setting you need and verify startup plus a real player connection. The configuration tool below can help draft settings; review its output against your installed resources and the official reference.
These server.cfg examples target FiveM for GTA V Legacy; check Cfx.re’s Legacy-to-Enhanced changes before using them on an Enhanced server.
Find the active configuration
In txAdmin, inspect the selected server profile and configured server-data/configuration path. For a manual installation, inspect the startup command and its +exec argument. The file does not have to sit beside the FXServer executable. Editing an unused copy changes nothing.
Back up the file and any included files before editing. Keep your license key, database connection string and other secrets in protected server-side configuration. Never include them in screenshots or client/shared scripts.
Understand set, sets and setr
set defines a server convar. sets publishes server information, and setr replicates a value to clients. Use the form required by the documented setting. Never use a public or replicated setting for credentials.
A small configuration example
These lines illustrate network and public identity settings. They are not a complete framework installation: retain the valid server registration key, installed recipe’s requirements and explicit resource list in your private configuration.
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
sv_hostname "My Roleplay Server"
sets sv_projectName "My Roleplay Server"
sets sv_projectDesc "English roleplay with a guided start"
sets locale "en-US"
sv_maxclients 8
Use the port assigned by your host and allow its required TCP/UDP traffic. Set the slot limit according to your entitlement and tested capacity. A higher number adds neither processing power nor slot entitlement.
Core server.cfg settings at a glance
As of 24 November 2026, the Cfx.re server command reference, the vanilla server guide, the convar documentation and the resource manifest reference describe these settings as follows.
| Setting | What the documentation says |
|---|
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120" | Bind the TCP and UDP endpoint. Address and port must be valid and not already in use. The sample configuration says to change the IP only on a server with several network interfaces, otherwise only the port. FiveM for GTA V Enhanced supports only a single endpoint for each of the two commands. |
sv_licenseKey | The license key of the server; the reference points to portal.cfx.re to get one. With sv_lan true the server is LAN-only, does not appear in the public server list and the license key check is skipped. |
sv_maxclients | Maximum number of clients, an integer from 1 to 2048. From 32 on, onesync must be on or legacy; above 64 it must be on. |
set onesync on | on: full state awareness and server-determined entity routing. off: the standard GTA/RAGE peer-to-peer model, the server only relays. legacy: compatibility mode for scripts that expect all players to exist on each client; not recommended because of performance issues and graphical glitches. |
sv_enforceGameBuild | Selects the game build for clients. It can only be set at startup, not at runtime. Examples from the reference for Legacy: h4, mptuner, 3407; every build includes the content of the builds before it. FiveM for GTA V Enhanced supports only the latest build, which loads by default; sv_enforceGameBuild 1 loads the base game without DLCs. |
sv_hostname
sets sv_projectName
sets sv_projectDesc | The reference marks all three as deprecated and says to set the server hostname, project name and project description in the Portal instead. The example above still shows these lines. |
ensure resourceName | Starts the resource, or restarts it if it was already started. A resource manifest can declare a dependency, which the manifest reference describes as requiring the specified resource to load before the current resource. |
set mysql_connection_string "..." | Not a Cfx.re setting: a convar read by the oxmysql resource (see below). Set it with set, not setr: replicated convars can be read by client scripts. |
Create the key in the Cfx.re Portal and set it with sv_licenseKey. The post on the server license key and the Portal covers creating it and fixing key errors.
The vanilla server guide’s common issues include these start problems. If no resources are found and “Failed to start resource” appears, you did not change to the right folder. If no resources start and you cannot connect (“timed out” or “connection refused”), you did not add +exec. “no license key was specified” can come from either mistake.
oxmysql reads mysql_connection_string, not FXServer itself. Its source code accepts a mysql://user:password@host:port/database URI (the port is optional) or key=value pairs separated by semicolons, and falls back to mysql://root@localhost when the convar is empty. The oxmysql documentation lists characters to avoid in the connection string, so keep the password simple. Use one of the two forms:
set mysql_connection_string "mysql://user:password@localhost/database"
set mysql_connection_string "user=user;password=password;host=localhost;database=database"
Put this line before the ensure line of oxmysql and of every resource that uses it. To move an old resource from mysql-async to the new driver, see how to migrate mysql-async resources to oxmysql.
If you start from a ready-made FiveM server pack, compare the configuration it comes with against this table before the first start, and replace the license key and database credentials with your own.
Start dependencies before their users
Follow your framework recipe and each resource’s manifest. For example, a resource using oxmysql must load after that driver and after its connection string is set. Include a separate resource list with exec resources.cfg if that helps keep configuration readable.
Avoid copying another server’s entire resource list. Every ensure must name something intentionally installed. The step-by-step guide to installing a FiveM script shows where a new resource and its ensure line go. Retain any startup-only settings in the supported startup/configuration location and perform a full restart when required.
Keep game build and artifacts separate
FXServer artifacts are the server runtime. sv_enforceGameBuild selects GTA content required by resources. Choose a supported value from the Cfx.re server command reference when necessary, and test dependent maps/vehicles. It is not a universal crash-prevention switch.
Keep legacy RCon disabled unless you need and secure it. Assign only the necessary ACE permissions to the intended identifiers. Verify allowed and denied cases with ordinary player accounts. A hidden command or UI element is not an authorization check.
Do not use copied Source-engine rate settings or unknown “optimization” flags. Check each setting against current documentation or runtime source. Player endpoint privacy is separate from hiding a server’s network origin and provides no DDoS protection.
Verify each change
- Save the configuration and restart through the existing server manager during a suitable window.
- Read the first startup errors and resolve missing included files, resource dependencies or invalid arguments. For “Couldn't start resource” and similar messages, see how to fix a FiveM resource that won't start.
- Connect using the actual endpoint, then check the public name and description separately in the server list.
- Test the behavior you changed and a relevant denied/error case.
- If the change fails, restore the known-good configuration and restart through the same manager.
When a setting appears ineffective
Confirm the active profile and search included configuration files for another assignment. Check whether the setting is read only at startup, requires setr, or belongs to a resource that is not running. Use the owning resource’s source/documentation instead of adding several similar-looking keys.
Reference documentation
Cfx.re: setting up a vanilla server · Cfx.re: setting up a txAdmin server
How to Set Up a FiveM Server with txAdmin