The FiveM Server Handbook
setup to launch, in one place.
Everything you need to run a FiveM server, in one place: choosing hardware, installing FXServer with txAdmin, writing server.cfg, opening the right ports, organising resources, connecting a database, OneSync and slots, streaming maps and vehicles, finding lag, hardening security, managing staff and keeping the server alive with restarts and backups. Each chapter gives you the working commands and config, explains why they matter, and links to a detailed guide when you need to go deeper.
- 17chapters
- 55 minreading time
- 45commands & convars
- 41glossary terms
Who this handbook is for
- First-time owners setting up a FiveM server from zero
- Owners moving from a game host to a VPS or dedicated server
- Staff who handle restarts, backups, permissions and moderation
- Developers who want to understand the server they deploy to
Updated 11 September 2026 · checked against the official Cfx.re documentation.
A running server in fifteen minutes
- Create a server key on portal.cfx.re (free).
- Download the recommended server build from the Server Download page —
server.7zon Windows,fx.tar.xzon Linux. - Extract it to
C:\FXServer\server(or~/FXServer/server) and runFXServer.exe(or./run.sh). - txAdmin opens on port 40120: enter the PIN, link your Cfx.re account and set the panel password.
- Pick a recipe (CFX Default needs no database), paste your server key and click Save & Run Server.
- Open port 30120 TCP and UDP in the firewall and set
sv_projectNameandsv_projectDesc. - Connect from the F8 console with
connect your-ip:30120; the server list can take up to 8 minutes to show you.
#How a FiveM server works
A FiveM server is FXServer — the Cfx.re server program — running a folder of resources and a server.cfg. Knowing which part does what makes every later chapter easier.
| Part | What it is | Where it lives |
|---|---|---|
| Artifacts | The FXServer build itself, published by Cfx.re | C:\FXServer\server or ~/FXServer/server |
| Server data | Your resources, server.cfg and cache | server-data/ (with txAdmin: the folder you choose) |
| Resources | Folders with an fxmanifest.lua: scripts, maps, vehicles, UI | server-data/resources/ |
| server.cfg | Startup commands: endpoints, name, slots, resources, permissions | server-data/server.cfg |
| txAdmin | Web panel bundled with the artifacts | Port 40120, data in txData/ |
| Server key | Links the server to your Cfx.re account | sv_licenseKey in server.cfg |
| Database | Where frameworks store players, money and items | MariaDB/MySQL through oxmysql |
Players connect to your IP on port 30120. The server tells each client which resources to download — scripts, streamed models and textures, UI files — then runs server scripts on the server and client scripts on every player’s PC. The server also sends a heartbeat to the Cfx.re server list, which is how players find you.
Scripts come in halves. Server scripts are authoritative: they can read the database, secrets and every player. Client scripts run on each player’s PC: they draw the world, read input and show UI. Anything that runs on a player’s PC can be modified, so money, items and permissions are always decided on the server — see security hardening.
#Hardware and hosting
The FXServer main thread does most of its work on one core, so the speed of a single CPU core matters more than the number of cores. Choose hardware and a host around that.
| Server size | Players | CPU | RAM | Storage |
|---|---|---|---|---|
| Test / friends | Up to ~10 | Any modern 4-core | 8 GB | SSD |
| Small community | 32–64 | High single-thread, 4–6 cores | 16 GB | NVMe |
| Busy roleplay | 100–200+ | The fastest single-thread CPU you can get | 32 GB+ | NVMe, database tuned or separate |
Starting points, not guarantees — scripts matter more than player count. Measure with txAdmin and the profiler.
| Option | Good for | Watch out for |
|---|---|---|
| Home PC | Development, a few friends | Upload speed, exposing your home IP, uptime |
| Game-server host | A first public server without admin skills | Shared CPUs, limited database and file access |
| VPS | Full control at a low price | Oversold CPUs (steal time); you manage security |
| Dedicated server | Large, busy servers | Cost; you manage everything |
- Ask which CPU model you get and whether cores are shared.
- Ask for game-aware (UDP) DDoS filtering, not only web protection.
- Pick a data centre close to most of your players.
- Make sure you can open 30120 TCP/UDP and restrict 40120 to your IP.
- Check whether backups are included and whether you can restore them yourself.
#Installing FXServer and txAdmin
The official quick route is txAdmin: download the artifacts, run them, and txAdmin sets up the rest in your browser. The vanilla route — cfx-server-data plus your own server.cfg — still works and shows what txAdmin does for you.
- Create
C:\FXServer\serverand download the recommended Windows build (server.7z) from the Server Download page. - Extract it into that folder with 7-Zip or WinRAR.
- Double-click
FXServer.exe. txAdmin opens in your browser — check that the PIN is filled in and click Link Account. - Log in with your Cfx.re account, allow access, and create the admin panel password.
- Name the server, choose Popular Recipes and pick one. CFX Default needs no database; framework recipes (ESX, QBCore, Qbox) do.
- Run the recipe deployer, enter your server key from portal.cfx.re, then click Save & Run Server.
Add-MpPreference -ExclusionPath 'C:\FXServer\'Linux. Cfx.re calls the Linux build a courtesy port — Windows receives fixes first — but many large servers run on Linux without trouble. You need xz-utils to unpack the build.
sudo apt install -y xz-utils curl git
mkdir -p ~/FXServer/server && cd ~/FXServer/server
wget "<recommended fx.tar.xz URL from the Server Download page>"
tar xf fx.tar.xz
./run.sh # starts txAdmin on port 40120git clone https://github.com/citizenfx/cfx-server-data.git ~/FXServer/server-data
cd ~/FXServer/server-data
# create server.cfg (see the next chapter), then:
bash ~/FXServer/server/run.sh +exec server.cfg- Server key created on portal.cfx.re
- Recommended artifacts extracted
- txAdmin master account linked to your Cfx.re account
- Recipe deployed or server data folder selected
- Server starts without red errors in the console
#server.cfg, line by line
server.cfg is a list of console commands run at startup. Endpoints and convars go first, resources start in dependency order, and secrets live in a separate file.
# Network: players connect on 30120, TCP and UDP
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
# How the server appears in the server list
sv_hostname "Night City RP"
sets sv_projectName "Night City RP"
sets sv_projectDesc "Serious roleplay with custom jobs, housing and a player-run economy."
sets tags "roleplay, serious, economy, jobs"
sets locale "en-US"
load_server_icon logo96.png
sets banner_detail "https://example.com/banner-detail.png"
sets banner_connecting "https://example.com/banner-connecting.png"
# Game settings (startup only)
set onesync on
sv_maxclients 48
sv_enforceGameBuild 3258
# Security basics (see the Security chapter)
sv_scriptHookAllowed 0
sv_endpointPrivacy true
sv_pureLevel 1
# Database for oxmysql
set mysql_connection_string "mysql://fivem:[email protected]/fivem?charset=utf8mb4"
# Base resources, then libraries, then framework, then everything else
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure hardcap
ensure oxmysql
ensure ox_lib
ensure [framework]
ensure [jobs]
ensure [maps]
ensure [ui]
# Permissions
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_principal identifier.fivem:1 group.admin
# Keys and tokens live in a file you never share
exec secrets.cfgsv_licenseKey "your-server-key"
set steam_webApiKey ""
set discord_bot_token "..."| Line | Why it matters |
|---|---|
endpoint_add_tcp / endpoint_add_udp | The port players connect on; both protocols are needed |
sets sv_projectName / sv_projectDesc | Required for the server list — if either is missing the server shows an error on startup and may not be listed |
sets tags / sets locale | Server list filters and language; replace the default root-AQ with a real locale |
load_server_icon | The server list icon — a 96×96 PNG |
set onesync on | Required above 64 slots; enables server-side entities and routing buckets |
sv_maxclients | 1–2048 slots; more than 48 needs a Cfx.re subscription (Element Club Argentum or higher) |
sv_enforceGameBuild | Game build for every player; only read at startup |
ensure | Starts a resource, or restarts it if it is running; order = dependency order |
exec | Runs another cfg file — perfect for secrets and per-server overrides |
set / sets / setr | set is a normal convar, sets also publishes it to the server list, setr replicates it to clients |
#Ports, firewall and connecting
When players cannot connect, or the server is missing from the list, the cause is almost always ports, the firewall or two missing convars.
| Port | Protocol | Purpose | Open to |
|---|---|---|---|
| 30120 | TCP + UDP | Game connections and the HTTP endpoints (info.json) | Everyone |
| 40120 | TCP | txAdmin web panel (TXHOST_TXA_PORT changes it in txAdmin 8+) | Only your IP, a VPN or a proxy |
| 3306 | TCP | MariaDB / MySQL | Nobody — bind to localhost |
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp
sudo ufw allow from YOUR.HOME.IP to any port 40120 proto tcp
sudo ufw allow OpenSSH
sudo ufw enableNew-NetFirewallRule -DisplayName "FiveM TCP" -Direction Inbound -Protocol TCP -LocalPort 30120 -Action Allow
New-NetFirewallRule -DisplayName "FiveM UDP" -Direction Inbound -Protocol UDP -LocalPort 30120 -Action Allow- Open
http://your-ip:30120/info.jsonin a browser — it should return JSON describing the server. - In FiveM press F8 and run
connect your-ip:30120. If this fails, port forwarding or the firewall is wrong. - Check that
sv_master1is commented out. - Confirm
sv_projectNameandsv_projectDescare set. - Wait — a new server can take up to 8 minutes to appear in the list.
- Behind a NAT or gateway that rewrites UDP source ports, the server may not list; check your router or firewall documentation.
#Resources, fxmanifest.lua and start order
Every feature on a FiveM server is a resource: a folder with an fxmanifest.lua. Organised folders and a clear start order prevent most “it worked yesterday” problems.
resources/
[base]/ mapmanager, chat, spawnmanager, sessionmanager, hardcap
[libs]/ oxmysql, ox_lib, ox_target
[framework]/ qbx_core or es_extended and its core resources
[jobs]/ police, ambulance, mechanic
[maps]/ MLOs and ymaps
[vehicles]/ add-on cars
[ui]/ hud, loading screen, minimapfx_version 'cerulean'
game 'gta5'
lua54 'yes'
name 'nc_garage'
version '1.2.0'
shared_scripts { '@ox_lib/init.lua', 'config.lua' }
client_scripts { 'client/*.lua' }
server_scripts { '@oxmysql/lib/MySQL.lua', 'server/*.lua' }
ui_page 'web/dist/index.html'
files { 'web/dist/**' }
dependencies { 'oxmysql', 'ox_lib' }| Command | What it does |
|---|---|
ensure name | Starts the resource, or restarts it if it is running |
start name / stop name | Start or stop; also works on categories such as start [cars] |
restart name | Restarts a running resource |
refresh | Rescans the resources folder so new resources can be started |
exec file.cfg | Runs commands from another file, including @resource/file.cfg |
- Bracket folders such as
[jobs]are categories:ensure [jobs]starts everything inside. - Start libraries before anything that uses them: oxmysql and ox_lib, then the framework, then jobs and UI.
- After copying in a new folder on a running server:
refresh, thenensure name. - Leave the default cfx-server-data resources unedited unless you must — updates become painful.
- Delete what you do not use. Every client script costs frame time on every player’s PC.
#Database: MariaDB and oxmysql
Frameworks keep players, money, items and vehicles in MariaDB (or MySQL) through oxmysql. The database is the most valuable thing on the machine — set it up properly and back it up from the first day.
sudo apt install -y mariadb-server
sudo mariadb-secure-installation
sudo mariadbCREATE DATABASE fivem CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'fivem'@'127.0.0.1' IDENTIFIED BY 'a-long-random-password';
GRANT ALL PRIVILEGES ON fivem.* TO 'fivem'@'127.0.0.1';
FLUSH PRIVILEGES;set mysql_connection_string "mysql://fivem:[email protected]/fivem?charset=utf8mb4"
set mysql_slow_query_warning 200
ensure oxmysql- Use a dedicated user with rights on one database only — never
root. - Keep 3306 closed to the internet; manage the database over an SSH tunnel.
- Import the framework’s SQL file before the first start.
- oxmysql prints a warning for queries slower than
mysql_slow_query_warning(200 ms by default). Treat each one as a bug: add an index or move the query out of a loop. - Index columns you search by — identifiers, citizen IDs, plates.
Schema tips for developers: FiveM database design.
#Frameworks and the core stack
A framework gives every script the same idea of a character, a job, money and an inventory. Choose one before you buy scripts — most resources are written for a specific framework.
| Framework | Style | Notes |
|---|---|---|
| ESX Legacy | Long-running, very large catalogue | es_extended; works with ox_inventory |
| QBCore | Popular, large script market | qb-core; qb-inventory by default |
| Qbox | QBCore-compatible on a modern ox stack | qbx_core; ox_inventory and ox_lib built in |
| ox_core | Minimal and developer-focused | By Overextended; ox_inventory native |
| Standalone / vMenu | Freeroam, racing, drift | No character or economy system |
The Overextended stack — oxmysql, ox_lib, ox_inventory, ox_target, ox_doorlock — is shared across frameworks; ox_inventory officially supports ox_core, ESX, Qbox and ND_Core. A full comparison: ESX vs QBCore vs Qbox.
- Start from the framework’s txAdmin recipe, then add scripts one at a time.
- Buy scripts that support your framework (or bridge several) and read their dependency list first.
- Never run two frameworks on one server.
- Keep a list of every resource, its version and where it came from.
#OneSync, player slots and game builds
OneSync makes the server aware of every entity. It is required for large slot counts and unlocks server-side entity natives, entity lockdown, state bags and routing buckets.
| `onesync` value | Meaning |
|---|---|
on | Full state awareness and server-determined entity routing — use this |
legacy | Compatibility mode for scripts that expect every player on every client; not recommended |
off | Standard GTA peer-to-peer networking; the server is only a relay |
| Slots (`sv_maxclients`) | Requirement |
|---|---|
| From 32 | OneSync on or legacy |
| Above 64 | OneSync on |
| Above 48 | Element Club Argentum subscription or higher on the key owner’s account |
| Maximum | 2048 |
-- move a player into their apartment instance
SetPlayerRoutingBucket(source, 1000 + source)
SetRoutingBucketPopulationEnabled(1000 + source, false)
-- back to the normal world
SetPlayerRoutingBucket(source, 0)
-- synced data on the player
Player(source).state:set('duty', true, true)| Build | Update |
|---|---|
| 2189 | Cayo Perico Heist |
| 2802 | Los Santos Drug Wars |
| 2944 | San Andreas Mercenaries |
| 3095 | The Chop Shop |
| 3258 | Bottom Dollar Bounties |
| 3407 | Agents of Sabotage |
| 3570 | Money Fronts |
| 3751 | A Safehouse in the Hills |
| 3889 | The Kortz Center Heist |
`sv_enforceGameBuild <number>` — startup only; each build includes everything before it.
#Streaming maps, MLOs, vehicles and clothing
Anything that adds or replaces game content — maps, MLOs, vehicles, clothing, props, the minimap — is streamed: the files sit in a resource’s stream/ folder and players download them on join.
| File | Contains | Used for |
|---|---|---|
.yft | Fragment model | Vehicles, some weapons and props |
.ydr | Drawable model | Props, weapons |
.ydd | Drawable dictionary | Clothing, peds, minimap geometry |
.ytd | Texture dictionary | Textures for everything |
.ybn | Collision bounds | Maps and MLOs |
.ymap | Placements | Where entities sit in the world |
.ytyp | Archetype definitions | New props and interiors |
.meta | Data files | Vehicles, handling, weapons, peds |
fx_version 'cerulean'
game 'gta5'
files {
'data/vehicles.meta',
'data/handling.meta',
'data/carvariations.meta',
'data/carcols.meta',
}
data_file 'HANDLING_FILE' 'data/handling.meta'
data_file 'VEHICLE_METADATA_FILE' 'data/vehicles.meta'
data_file 'CARCOLS_FILE' 'data/carcols.meta'
data_file 'VEHICLE_VARIATION_FILE' 'data/carvariations.meta'- Assets above 16 MiB of physical memory trigger the oversized-asset warning. Downscale 4K textures to 2K or 1K and compress them with mipmaps.
- Maps and MLOs need
this_is_a_map 'yes'; new props need a.ytypdeclared withdata_file 'DLC_ITYP_REQUEST'. - Two resources streaming the same file name conflict — only one wins. This is the usual cause of a broken minimap.
- Very large asset counts can exceed game pools such as
TxdStore; raise them withincrease_pool_sizewithin Cfx.re’s limits (see the performance chapter). - Check the Cfx.re Portal for any subscription requirement before streaming custom clothing.
#Performance: server lag, FPS and texture loss
Measure before you change anything. Server lag, client FPS drops and texture loss have different causes and different tools.
| Symptom | Tool | Usual cause |
|---|---|---|
| Everyone rubber-bands at once | Hitch warnings in the console, profiler | A resource blocking the server thread |
| One player lags | Their ping, their F8 console | Their connection or PC |
| Low FPS for everyone | resmon 1 in F8 | Client scripts working every frame, heavy NUI |
| Textures pop or go missing | Oversized-asset warnings | Too many large textures |
| Server slows over hours | Entity counts, memory in resmon | Leaks: entities never deleted, growing tables |
profiler record 500
profiler view- Client loops: sleep when nothing is near (
Wait(500)or more); useWait(0)only while drawing or reading controls. - Replace polling with events, state bags and ox_lib points or zones.
- Database: asynchronous queries, indexes, and never a query inside a loop over players.
- Lower AI population with density multipliers, or
set onesync_population falseif you need none. - Delete entities when a job ends, when a resource stops and when a player drops.
| Pool | Max increase (FiveM) |
|---|---|
TxdStore | 26000 |
AnimStore | 20480 |
EntityDescPool | 20480 |
Building | 20000 |
FragmentStore | 14000 |
CWeaponComponentInfo | 2048 |
Object | 2000 |
fragInstGta | 2000 |
Set with `increase_pool_size "TxdStore" 6000` at startup; inspect pools in F8 → Tools → Streaming → Pool Monitor.
#Security hardening
FiveM security comes down to two things: server convars that shut whole classes of abuse, and scripts that never trust the client.
| Convar / command | Suggested | Effect |
|---|---|---|
sv_scriptHookAllowed | 0 | Refuses clients running Script Hook V |
sv_pureLevel | 1 or 2 | Blocks modified game files (level 1 allows audio and known graphics mods) |
sv_entityLockdown | strict or relaxed, after testing | strict: clients cannot create entities; relaxed: client-created script entities are blocked |
sv_filterRequestControl | 1–4 | Blocks control requests for entities controlled by players |
sv_enableNetworkedSounds | false | Stops routing NETWORK_PLAY_SOUND_EVENT, a common abuse vector |
sv_enableNetworkedPhoneExplosions | false (default) | Keep phone explosion events disabled |
sv_enableNetworkedScriptEntityStates | false if unused | Stops routing SCRIPT_ENTITY_STATE_CHANGE_EVENT |
setr sv_stateBagStrictMode | true | Only the server can change state bags on networked entities |
sv_endpointPrivacy | true | Hides player IPs from public server output |
rcon_password | unset | RCON stays disabled |
block_net_game_event | Events you never use | Drops a game event on the server |
In scripts, validate every server event: who sent it (source), whether they may do it (job, ACE, distance), whether the values make sense (types, ranges) and how often they call it. Never accept money, prices or item counts from the client. Patterns and code: secure server events.
- Keep the server key, webhooks, bot tokens and store secrets in an
exec’d file or server-only convars — never in client files. - Restrict txAdmin to known IPs and give every staff member their own account.
- Update artifacts and resources; old versions have publicly known exploits.
- Buy from reputable sellers — leaked resources often ship with backdoors.
- Log admin actions and economy changes somewhere staff cannot edit.
#Admins, ACE permissions and moderation
Two permission systems run side by side: txAdmin permissions for the web panel and in-game admin menu, and ACE permissions for commands and scripts.
# groups
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_ace group.mod command.kick allow
add_principal group.admin group.mod
# people
add_principal identifier.fivem:1 group.admin
add_principal identifier.discord:123456789012345678 group.mod
# check from the console
test_ace group.mod command.kickRegisterCommand('kickidle', function(source)
if source ~= 0 and not IsPlayerAceAllowed(source, 'command.kick') then return end
-- ...
end, false)| Identifier | Always there? | Notes |
|---|---|---|
license | Yes | Rockstar licence — the stable key for players |
license2 | Usually | Second licence (for example Steam users) |
discord | If Discord is running | Needed for Discord roles and whitelists |
fivem | If logged in to Cfx.re | Used by txAdmin |
steam | Only with steam_webApiKey | And Steam running |
ip | Yes | Changes; never use alone |
- One txAdmin account per staff member with only the permissions their role needs.
- txAdmin bans store identifiers and hardware tokens and log who banned and why.
- Write down punishments and an appeal route, and link them from Discord.
- Separate moderation powers from infrastructure access (files, database, host).
#Restarts, backups and updates
Stable servers are boring on purpose: fixed restart times, automatic backups, a test server for updates and a written rollback plan.
| When | Routine |
|---|---|
| Every restart | Save player data in txAdmin’s restart and shutdown events |
| Daily | Database dump, compressed and copied off the machine |
| Weekly | Disk space, txAdmin diagnostics, resmon on a busy evening |
| Every update | Test on a dev server, back up, deploy in a quiet hour, keep the old version |
| Monthly | Restore a backup to a spare database to prove it works |
AddEventHandler('txAdmin:events:scheduledRestart', function(data)
if data.secondsRemaining == 60 then
-- save everything that is not saved yet
end
end)
AddEventHandler('txAdmin:events:serverShuttingDown', function()
-- final save
end)txAdmin announces a scheduled restart 30, 15, 10, 5, 4, 3, 2 and 1 minutes before it happens, and restarts crashed servers automatically.
#!/bin/sh
STAMP=$(date +%F-%H%M)
mariadb-dump --single-transaction fivem | gzip > /backups/fivem-$STAMP.sql.gz
tar --exclude='server-data/cache' -czf /backups/server-data-$STAMP.tar.gz -C /home/fivem server-data
find /backups -type f -mtime +14 -delete- Read the artifact changelog, then update the test server first.
- Keep the previous artifact folder — rolling back is switching folders.
- Update one resource at a time and watch the console after each.
- Copy backups off the machine; a backup on the same disk dies with it.
#Map, minimap and world settings
The map is what players look at most. Minimap, blips, weather, traffic, wanted level and interiors are all yours to configure.
| You want | How |
|---|---|
| A themed or branded minimap | Stream one minimap resource — install a custom minimap |
Postal codes and /postal | A postal map plus a nearest-postal script using the same data — postal codes |
| Map blips | AddBlipForCoord with a sprite and colour — blips |
| Synced weather and time | One sync resource on the server — weather and time |
| Less traffic and fewer peds | Density multipliers every frame, or onesync_population false — traffic |
| No wanted level or AI police | SetMaxWantedLevel(0) and dispatch off — wanted level |
| GTA Online interiors | RequestIpl or bob74_ipl — interiors and IPLs |
| Cayo Perico | Game build 2189+ and the island natives — Cayo Perico |
CreateThread(function()
SetMaxWantedLevel(0)
for i = 1, 15 do
EnableDispatchService(i, false)
end
SetCreateRandomCops(false)
end)The minimap is on screen for the whole session, so a map in your server’s colours — with or without postal codes, or with your logo on it — is one of the most visible upgrades you can make. Browse ready-made minimaps or brand one in the studio.
#Troubleshooting common problems
Most server problems follow a handful of patterns. Find the symptom, check the likely cause, then open the linked guide.
| Symptom | Likely cause | First thing to try |
|---|---|---|
| Not in the server list | Ports, active sv_master1, missing project name/description, or just started | info.json test, direct connect, wait up to 8 minutes |
| “Failed to start resource” | Started from the wrong folder, or no fxmanifest.lua | Start from server-data; check the manifest |
| Stuck downloading on join | Huge or broken streamed files | Check oversized-asset warnings; remove the last resource added |
| Only 48 slots | No subscription on the key owner’s account | Element Club Argentum or higher, then raise sv_maxclients |
| Hitch warnings during play | A resource blocking the server thread | profiler record while it happens |
| Missing minimap or texture loss | Conflicting minimap resources, oversized textures | Keep one minimap resource; compress textures |
| Slow startup on Windows | Defender scanning FXServer files | Add a Defender exclusion |
| Crash on join | A broken streamed asset or game build mismatch | Read the crash dump; remove recent assets |
| Desync and rubber-banding | Server hitches, bad connections, client-only state | Profile the server; sync state through the server |
#The launch checklist
Before you advertise anywhere, go through this list. Every item is something a real server discovered on launch day.
The first minute decides whether a new player stays — loading screen, spawn, minimap and HUD all count. Read the first sixty seconds, and for the marketing side use the server launch checklist.
- Recommended artifacts, tested on a dev server
-
sv_projectName,sv_projectDesc, tags, locale and a 96×96 icon set - Server list banners and a loading screen that match your brand
- Ports 30120 TCP/UDP open; 40120 and 3306 closed to the public
- OneSync on and
sv_maxclientsmatching your subscription - Security convars set and tested
- Secrets moved to an
exec’d file - Staff accounts in txAdmin with the right permissions
- ACE groups for admin commands
- Scheduled restarts with save handlers
- Daily off-machine database backups — and one test restore
- resmon checked with 20+ players on the test server
- No oversized-asset warnings in the console
- Rules, appeal route and support channel in Discord
- A rollback plan for the first update
Cheat sheets
The commands, convars and paths you will look up again and again.
Server console commands
Type these in the server console or the txAdmin live console.
| Command | What it does |
|---|---|
ensure name | Start a resource, or restart it if running |
start name / stop name | Start or stop a resource or [category] |
restart name | Restart a running resource |
refresh | Rescan the resources folder |
exec file.cfg | Run commands from a file (also @resource/file.cfg) |
quit "reason" | Stop the server with a message to players |
status | List players with ID, identifier, endpoint and ping (rconlog) |
clientkick id reason | Kick a player by server ID (rconlog) |
say message | Chat message as console (chat resource) |
add_ace / remove_ace | Add or remove a permission entry |
add_principal / remove_principal | Add or remove group inheritance |
test_ace principal object | Check whether a permission is allowed |
load_server_icon file.png | Load a 96×96 PNG server icon |
profiler record 500 / profiler view | Record and inspect server performance |
con_addChannelFilter filter action | Silence noisy console channels |
svgui | Open or close the server debug GUI |
Core convars
The settings almost every server uses.
| Convar | Example | Notes |
|---|---|---|
sv_hostname | "Night City RP" | Server-specific host name |
sets sv_projectName | "Night City RP" | Required for the list; a name, not tags |
sets sv_projectDesc | "Serious roleplay…" | Required for the list; one sentence |
sets tags | "roleplay, economy" | Comma-separated tags |
sets locale | "en-US" | Primary language |
sv_maxclients | 48 | 1–2048 |
set onesync | on | on / legacy / off |
sv_enforceGameBuild | 3258 | Startup only |
sv_licenseKey | "…" | From portal.cfx.re |
sets sv_appearAllowlisted | true | Lock icon in the server list |
sets sv_allowlistInstructions | "Apply on discord.gg/…" | Shown with the lock icon |
sv_lan | false | true = LAN only, not listed |
set steam_webApiKey | "…" | Enables Steam identifiers |
set sv_forceIndirectListing | true | Do not advertise the real IP |
sv_kvsName | default | KVP database file name; startup only |
OneSync convars
Defaults are right for most servers; change them only with a reason.
| Convar | Default | What it does |
|---|---|---|
onesync_enableInfinity | true | Large-scale entity sync; startup only |
onesync_population | true | AI peds and traffic |
onesync_forceMigration | true | Move entity ownership when the owner leaves |
onesync_distanceCulling | true | Stop syncing far-away entities |
onesync_distanceCullVehicles | false | Apply culling to vehicles too |
onesync_radiusFrequency | true | Update near entities more often |
sv_useAccurateSends | true | Send updates by relevance and distance |
Where things live
Paths you will need sooner or later.
| What | Path |
|---|---|
| Server build | C:\FXServer\server · ~/FXServer/server |
| Resources and server.cfg | server-data/ |
| Server cache (safe to delete when stopped) | server-data/cache |
| txAdmin data (admins, bans, history) | txData/ |
| txAdmin admins | txData/admins.json |
| Client cache | %localappdata%\FiveM\FiveM.app\data\cache |
| Client game build data (keep) | %localappdata%\FiveM\FiveM.app\data\game-storage |
Glossary
Every term this handbook uses, in one line each.
- ACE
- Access Control Entry — a permission rule added with
add_ace, checked withIsPlayerAceAllowed. - Artifacts
- The FXServer builds Cfx.re publishes; “recommended” for live servers, “latest” for testing.
- Cfx.re
- The company and platform behind FiveM and RedM, now part of Rockstar Games.
- Cfx.re Portal
- portal.cfx.re — where you create server keys and manage subscriptions; replaced Keymaster.
- Convar
- A console variable such as
sv_maxclients, set withset,setsorsetr. - Deferrals
- The
playerConnectingAPI for holding a connecting player: checks, messages, adaptive cards. - Element Club
- Cfx.re subscriptions; Argentum or higher unlocks more than 48 slots.
- Entity lockdown
sv_entityLockdown— controls whether clients may create entities.- ESX
- A long-running roleplay framework (
es_extended). - fxmanifest.lua
- The manifest every resource needs: scripts, files, dependencies, data files.
- FXServer
- The server program that runs FiveM and RedM servers.
- Game build
- The GTA V update a server enforces with
sv_enforceGameBuild. - Hitch warning
- A console warning that the server thread was blocked for a number of milliseconds.
- Identifier
- A player ID such as
license:…,discord:…orfivem:…. - IPL
- A named map chunk switched on with
RequestIpl, often used for interiors. - MLO
- A custom interior streamed as a map resource.
- Native
- A game or Cfx.re function callable from scripts, listed at docs.fivem.net/natives.
- NUI
- The in-game browser layer used for HUDs, menus and loading screens.
- OneSync
- Server-side state awareness; required above 64 slots.
- oxmysql
- The standard MySQL/MariaDB connector resource for FiveM.
- ox_lib
- A shared library of UI, callbacks, zones and helpers used by many resources.
- Pool
- A fixed-size game store (textures, objects…) that can be raised with
increase_pool_size. - Principal
- A group or player identity that ACE rules apply to, such as
group.admin. - Qbox
- A QBCore-compatible framework built on the ox stack (
qbx_core). - QBCore
- A popular roleplay framework (
qb-core). - Recipe
- A txAdmin template that deploys a complete server.
- resmon
- The in-game resource monitor (F8 →
resmon 1) showing CPU time and memory per resource. - Resource
- A folder with an fxmanifest.lua — one feature, map, vehicle or UI.
- Routing bucket
- A separate instance of the world; bucket 0 is the normal world.
- server.cfg
- The startup config: endpoints, convars, resources and permissions.
- State bag
- Synced key/value data attached to players, entities or the global state.
- Stream folder
- A resource’s
stream/folder; files there are sent to clients as game assets. - sv_pureLevel
- Blocks modified client game files at level 1 or 2.
- txAdmin
- The web panel bundled with FXServer for setup, restarts, players and bans.
- txData
- txAdmin’s data folder: admins, bans, settings and history.
- YDD
- Drawable dictionary — clothing, peds and minimap geometry.
- YDR
- A single drawable model, such as a prop or weapon.
- YFT
- A fragment model, mainly vehicles.
- YMAP
- A placement file listing entities in the world.
- YTD
- A texture dictionary.
- YTYP
- Archetype definitions for new props and interiors.
Questions server owners ask
How do I make a FiveM server?
Is it free to host a FiveM server?
Which ports does FiveM use?
What does txAdmin do?
Why is my server not showing in the server list?
sv_master1 line, or missing sv_projectName/sv_projectDesc. New servers can take up to 8 minutes to appear.How many players can a FiveM server have?
on, and above 48 you need a Cfx.re subscription.Should I use Windows or Linux?
What is the best CPU for a FiveM server?
How do I give someone admin on FiveM?
add_principal identifier.fivem:ID group.admin.What does OneSync do?
What game build should my server use?
sv_enforceGameBuild; newer builds unlock newer vehicles, weapons and map content.How do I fix lag on my FiveM server?
How do I secure a FiveM server?
How often should I restart a FiveM server?
How do I back up a FiveM server?
mariadb-dump --single-transaction, archive server-data and txData, and copy everything off the machine.What is increase_pool_size?
How do I add cars, maps or clothes?
ensure the resource. Keep textures small to avoid oversized-asset warnings.Which framework should I choose?
Where do I get help?
How do I change the minimap on my server?
Official references
Primary sources this handbook is checked against. When in doubt, they win.
Official Cfx.re documentation
- FiveM documentation — Home of the official docs
- Setting up a server — All setup routes
- Setting up with txAdmin — The recommended route
- Vanilla FXServer setup — Windows and Linux without txAdmin
- Server commands and convars — Every command and convar
- Proxy setup — Hiding the server IP
- Server issues — Server list, slots, slow startup
- Client issues — Player-side problems
- Resource manifest — fxmanifest.lua reference
- OneSync — Server-side state awareness
- State bags — Synced key/value data
- Net game events — Names for block_net_game_event
- Natives reference — Every game and Cfx.re native
Downloads and accounts
- Server download — Recommended and latest builds
- Windows artifacts — All Windows builds
- Linux artifacts — All Linux builds
- Cfx.re Portal — Server keys and subscriptions
- cfx-server-data — Default resources
- txAdmin on GitHub — Source, issues and releases
- MariaDB downloads — Database server
Frameworks and libraries
- oxmysql — Database connector
- Overextended docs — ox_lib, ox_inventory, ox_target
- ESX documentation — ESX Legacy
- Qbox documentation — qbx_core
- QBCore documentation — qb-core
Community
- Cfx.re forum — Releases, help and announcements
The FiveM Handbook series
Four free handbooks, one per part of the job. Read them in any order.
Give your server a map players remember
36 ready-made FiveM minimaps — with or without postal codes — or brand one with your logo in the studio.