SALE

Up to −19% off all game servers · price already applied, no coupons

Menu
Free trial

Try it free for 24 hours

We keep two servers open, one in Germany and one in Miami. Join from Java or Bedrock, on whatever version you run, and see how they perform before paying for anything.

If after the trial you decide it's not for you, you pay nothing. If you keep it, billing starts the next day at the regular price.

FiveM server.cfg Explained: Essential Lines and Example

What the FiveM server.cfg is, where to find it with txAdmin, the essential lines, a commented example and the most common errors.

15 views Updated 5 Oct 2026

server.cfg is the text file that FXServer reads when it starts: it defines the ports the server listens on, the license key, the number of slots, the game build and which resources are loaded. Each line is a console command or a convar, executed from top to bottom. If you use txAdmin, the file lives in your server data folder and its exact location is set in Settings > FXServer (Server Data Folder and CFG File Path).

Where is server.cfg located?

  • With txAdmin. When you deploy a recipe, txAdmin suggests creating the server inside txData, in a folder named like RecipeName_number.base. server.cfg sits at the root of that folder, next to resources. In Settings > FXServer, Server Data Folder is the folder that contains resources and CFG File Path (advanced options) is the path to the file, absolute or relative to that folder.
  • Without txAdmin (vanilla). It sits in your server-data folder and the server is started from there with +exec server.cfg.

The easiest way to edit it is the CFG Editor page in txAdmin. It validates the file before saving and keeps a copy of the previous version as server.cfg.bkp.

The difference between set, setr and sets

  • set creates a convar that only server scripts can read.
  • setr replicates the convar to clients, so players' game can read it.
  • sets makes it public: it appears in the server list and in http://IP:30120/info.json.

Keys and passwords (license key, Steam key, database connection string) must always go with set or with their own command, never with setr or sets.

The essential server.cfg lines

  • endpoint_add_tcp and endpoint_add_udp: the address and port players connect to. Use the same ip:port for both protocols. The default is 0.0.0.0:30120; only change the IP if the machine has several network interfaces.
  • sv_licenseKey: your server key, created for free on the Cfx.re Portal. Without it the server does not start and shows no license key was specified.
  • sv_hostname, sets sv_projectName and sets sv_projectDesc: name and description in the server list. If either project variable is missing, the server shows an error at startup and may not appear in the list.
  • sv_maxclients: maximum slots, from 1 to 2048. From 32 slots you need OneSync, and above 64 it must be on. More than 48 slots requires the Element Club Argentum subscription or higher on the Cfx.re Portal.
  • set steam_webApiKey: a Steam Web API key, required for the server to return Steam identifiers.
  • sv_enforceGameBuild: the GTA V content version players load. It can only be set at startup. See FiveM artifacts and game builds.
  • onesync: set onesync on in a vanilla server. With txAdmin, choose it in Settings > FXServer > OneSync; txAdmin comments out any onesync line in server.cfg.
  • sets tags and sets locale: comma-separated tags and the main language (en-US, es-ES). The default file uses root-AQ, which you should replace.
  • sv_scriptHookAllowed 0: blocks Script Hook V. The documentation advises against enabling it.
  • ensure resource: starts a resource, or restarts it if it was already running. Order matters: dependencies first (database, framework) and then the scripts that use them.
  • add_ace and add_principal: permissions. add_ace grants a permission to a group and add_principal puts an identifier inside that group.

A minimal commented server.cfg example

# Network: same ip:port for TCP and UDP
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# Server list
sv_hostname "My FiveM Server"
sets sv_projectName "My FiveM Server"
sets sv_projectDesc "Roleplay community"
sets tags "roleplay, english"
sets locale "en-US"
#load_server_icon logo.png   # 96x96 PNG

# Slots and game build
sv_maxclients 48
sv_enforceGameBuild 3095

# OneSync: vanilla only. With txAdmin, set it in Settings > FXServer
set onesync on

# Security
sv_scriptHookAllowed 0

# Keys: always with "set", never setr or sets
set steam_webApiKey ""
sv_licenseKey "cfxk_your_key"

# Database (only if you use oxmysql), before any resource
set mysql_connection_string "mysql://fivem:password@localhost:3306/fivem"

# Resources: dependencies first
ensure oxmysql
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap

# Admin permissions (replace with your FiveM identifier)
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_principal identifier.fivem:123456 group.admin

If you deployed a framework (ESX, QBCore, QBox and others) with a txAdmin recipe, keep the resource order the recipe created and add your scripts after it.

Common server.cfg errors

  • Couldn't find resource X.: the name after ensure does not match the resource folder, or the resource is not inside resources.
  • Could not find dependency X for resource Y.: a dependency is missing or has not been started. Check that it exists and goes before in the list.
  • Resource 'X' can't run: sv_enforceGameBuild needs to be at least N: the resource requires a higher game build. Raise sv_enforceGameBuild and restart.
  • Lines commented out with ## [txAdmin CFG validator]: txAdmin disabled them on purpose. The usual cases are onesync (set it in txAdmin settings) and ensure monitor (txAdmin resources must not be started from the file).
  • the endpoint_add_tcp port 40120 is dedicated for txAdmin: ports 40120 to 40150 are reserved for txAdmin. Use 30120 or another free port.
  • Your config file does not specify a valid endpoints: the endpoint_add_tcp and endpoint_add_udp lines are missing or do not share the same ip:port.
  • The server does not appear in the list: check sv_projectName and sv_projectDesc, make sure the line #sv_master1 "" keeps its # and open http://IP:30120/info.json to confirm the port is reachable.

If your server is hosted with Astrol Nodes, you can paste the console error into Astrol AI, the assistant in the panel, to locate the line that fails.

The managed FiveM server installs in a couple of minutes with txAdmin preinstalled and ESX, QBCore, QBox, vRP or ND_Core available in one click.

Was this article helpful?

Need more help?

Open a ticket and the support team goes through it with you.

Open a ticket