A FiveM server needs a licence key from the Cfx.re keymaster, and the key is issued to you rather than to your host. It records the address the server runs on, which is why moving a server means editing the key rather than copying it across. Everything else - the resources, the framework, the slots, the sync model - is server.cfg and txAdmin, and almost every performance complaint you will ever read about FiveM turns out to be a resource rather than a machine.
This guide is the whole path: the key, installing FXServer, the first txAdmin run, the config lines that matter and the ones that quietly break things, ports, permissions, and how to find the script that is costing you your frame time.
What FXServer is and what it needs#
FXServer is the Cfx.re server binary. It does not contain a game: it hosts resources, which are folders of Lua, JavaScript or C# with an fxmanifest.lua describing them, and it tells connected GTA V clients which ones to download and run. A bare FXServer is an empty map with nothing on it. What people mean by "a FiveM server" is FXServer plus a framework - ESX, QBCore, Qbox - plus a hundred or so resources on top.
Two consequences follow immediately. The first is that your server's performance is mostly other people's code: a badly written script you installed because it looked good on a forum is the single most likely cause of a server that stutters. The second is that updating is not one thing. There is the FXServer build, the framework version, each resource, and the GTA V build the server pins clients to, and they move independently.
What you need before you start:
- A licence key from
keymaster.fivem.net. Free, and tied to your Cfx.re account. - A machine or a plan. 2-4 GB for a small server, 6-12 GB for a populated roleplay server. One fast core carries the main thread.
- One port, open as both TCP and UDP. The default is
30120. - A database, if you are running any framework at all. ESX and QBCore both need one.
- Disk for streamed assets. Custom vehicles and interiors are the bulk of a large server, and every byte is downloaded by every new player.
The Cfx.re licence key#
Sign in at keymaster.fivem.net, create a server key, and give it the IP address the server will run on and a label you will recognise later. You get a long key that goes into server.cfg as sv_licenseKey.
The rules around it are short and they are all about ownership:
- One key per server. Two servers on one key is a licensing error on the second one, not a clever saving.
- The key remembers its address. If the server moves to a different IP, edit the key in keymaster or issue a new one. A key whose address no longer matches fails at startup rather than degrading quietly. Moving a server without losing players covers the rest of that job.
- The key is yours and it can be revoked. Cfx.re revokes keys for servers that break their terms - selling access to game content is the usual reason - and the revocation follows the account, not the machine.
- It is a credential. It belongs in
server.cfgand nowhere else. Not in a screenshot of your console, not in a Discord message, not in a public Git repository along with the rest of your server-data folder.
Installing FXServer and the first txAdmin run#
FXServer builds come from the Cfx.re artifacts server at runtime.fivem.net/artifacts/fivem/. There is a Linux path and a Windows path, and each lists builds marked recommended and latest. Take the recommended one unless a framework you need explicitly asks for something newer; "latest" exists so that people can test breakage, and they do find it.
The conventional layout keeps the binary and your content apart, so that updating one does not disturb the other:
/home/fivem/ server/ the extracted artifacts - replaced wholesale on update server-data/ your resources, your server.cfg - the thing you back up resources/ server.cfg$ cd /home/fivem/server-data$ bash /home/fivem/server/run.sh +exec server.cfgStart it with no arguments at all and you get txAdmin instead, which is the recommended way to set a server up from nothing. txAdmin ships inside the artifacts - there is nothing to install - and it starts a web interface on port 40120 and prints a one-time PIN into the console. Open http://your-address:40120, enter the PIN, and create the admin account.
From there the deployer will build a server for you from a recipe: a plain cfx-default server, or a full ESX or QBCore install with its resources fetched and its database schema imported. For a first server that is genuinely the fastest correct route, because the recipe wires up the parts that are tedious to connect by hand. Choosing a FiveM framework covers which recipe you actually want, and it is a decision worth ten minutes before you run one.
server.cfg, line by line#
# Listen on one port as both TCP and UDPendpoint_add_tcp "0.0.0.0:30120"endpoint_add_udp "0.0.0.0:30120"# Resources - order matters, dependencies firstensure mapmanagerensure chatensure spawnmanagerensure sessionmanagerensure hardcap# What the server list showssv_hostname "Longship RP | Serious roleplay | EU"sets tags "roleplay, esx, eu"sets locale "en-GB"set sv_projectName "Longship RP"# Slots and syncsv_maxclients 48set onesync onset onesync_population true# Pin the DLC level clients must be onsv_enforceGameBuild 2699# Securitysv_scriptHookAllowed 0set sv_entityLockdown "strict"set sv_endpointPrivacy trueexec secrets.cfgThe lines that people get wrong, in the order they get them wrong:
`ensure` versus `start`. ensure starts a resource, or restarts it if it is already running. start only starts it. Use ensure for everything; the difference shows up when you reload the config and half your resources do not come back.
`set`, `sets` and `setr`. Three different scopes for a convar. set is server-only. sets writes it into the server's information block so it appears in the server list. setr replicates it to clients so scripts can read it there. A framework that tells you to use setr means it; using set instead produces a resource that behaves differently on the client for no visible reason.
`sv_maxclients` and OneSync. Without OneSync the hard ceiling is 32. With set onesync on you are into the Infinity implementation and the ceiling becomes a very large number, which is not the same as your server being able to use it. The real limit on a roleplay server is the scripts, not the flag.
`sv_enforceGameBuild`. This pins the DLC level clients must be on. Get it wrong and players are told to change their game build before they can join, which they read as your server being broken. Build numbers change with every GTA Online update, so take the current one from the Cfx.re documentation rather than from a two-year-old tutorial.
`sv_entityLockdown`. The values are inactive, relaxed and strict. On a OneSync server, strict stops clients creating entities the server did not authorise, and it is the single most effective anti-cheat line in the file. It also breaks badly written resources that spawn things client-side, which is a reasonable filter to apply to your resource list.
RCON. FiveM's rcon_password is a legacy, unencrypted remote console and there is no good reason to enable it when txAdmin exists. Leave it unset. If you want the general argument, using RCON safely makes it for every game.
Permissions are a separate system from txAdmin's admin list, and confusing the two is a rite of passage:
add_ace group.admin command allowadd_ace group.admin command.quit denyadd_principal identifier.license:1a2b3c4d5e group.adminadd_principal identifier.discord:123456789012345678 group.modAn ace is a permission, a principal is a person or a group, and add_principal joins the two. txAdmin's own admins are stored in txAdmin and govern the web panel; aces govern in-game commands and resource permissions. Somebody who is a txAdmin admin is not automatically anything in game. Every line of server.cfg takes the rest of the file apart, including the convars frameworks expect you to set.
Ports, endpoints and connecting#
| Port | Protocol | Purpose |
|---|---|---|
30120 | UDP | Game traffic |
30120 | TCP | HTTP endpoint: list registration, asset downloads, /info.json |
40120 | TCP | txAdmin web interface |
The same number carries two different protocols and they fail differently, which makes this the most useful thing to know when a FiveM server misbehaves. UDP open and TCP closed gets you a server that does not appear in the list and that nobody can finish joining, because the initial handshake and the asset download go over HTTP. TCP open and UDP closed gets you players who connect, download everything, and then sit on a black screen.
Players join with connect your-address:30120 in the F8 console, through the server list, or with a cfx.re/join link. You can put a name on the address instead of an IP - connecting a domain to a game server has the A record - though the licence key still cares about the address underneath. Game server ports explained covers testing a port from outside properly, which is worth doing before blaming the config.
txAdmin in daily use#
The first-run deployer is the part people meet, but the daily value is elsewhere.
- Scheduled restarts with in-game warnings at intervals you set. FXServer instances degrade over long uptimes and so do the frameworks running on them; a restart every six or twelve hours is normal practice. Restart schedules that help covers picking the hour.
- Crash and hang handling. txAdmin watches the server's main thread and restarts it if it stops responding, which is the difference between a two-minute outage at 3am and a six-hour one.
- The player manager. Every connection is recorded against its identifiers - licence, Steam, Discord, IP - so a ban follows a person rather than a name. Warnings, ban reasons and ban templates all live here, and the history is what you read when somebody appeals.
- Whitelisting, by admin approval, by Discord role or by guild membership. For a serious roleplay server this is the feature that makes the rest of the moderation work.
- The live console, which is the same output you would get from the terminal, plus a command line. Reading the console is about knowing which lines in that wall of text matter.
- The performance chart, which is the subject of the next section and the reason to have txAdmin running before you think you need it.
Most lag is a resource, not the machine#
A roleplay server that stutters at forty players almost never needs a bigger plan. It needs someone to read the resource monitor.
FXServer runs your server-side scripts on one main thread. Every resource's work in a tick happens in sequence on that thread, so one script doing something expensive delays everything else - including the sync that players experience as rubber-banding. Adding memory does nothing for this. Adding cores does very little, because the thread that matters cannot be split.
txAdmin's performance chart buckets how long the server's main thread took on each tick. A healthy server spends nearly all its ticks in the fastest bucket. A server with one bad resource grows a tail: a small but steady fraction of ticks taking far longer than they should, which is precisely what players feel as periodic stutter rather than constant lag.
To find the resource:
- On the client, press F8 and run
resmon 1. This lists every resource with its per-frame CPU time and memory on that client. It only shows client-side cost, but client-side cost is half the problem and the easiest half to fix. - On the server, use the profiler:
profiler record 500to capture five hundred ticks, thenprofiler saveorprofiler viewto look at where the time went. - Bisect. Stop half your non-essential resources, watch the chart, put them back. Crude, fast, and it always works.
The patterns that cause it are consistent:
- A thread with
Citizen.Wait(0)- every single frame - doing work that only needs doing once a second. This is the most common performance bug in the entire FiveM ecosystem. - Distance checks looping over every player on every frame, instead of over nearby players on a timer.
- Database queries inside a loop. Set
mysql_slow_query_warningto something like 150 and read what oxmysql prints. - Events firing far more often than the thing they represent happens.
Streaming assets are a separate problem that looks similar. Custom vehicles and interiors are disk and bandwidth, not CPU: a slow first join is players downloading hundreds of megabytes over your TCP endpoint, and no amount of CPU changes it. Trim the stream folders, or accept the wait and tell people about it.
Sizing: memory, cores, database and disk#
| Server | RAM | vCPU | Notes |
|---|---|---|---|
| Freeroam or drift, up to 32 slots | 2-3 GB | 1-1.5 | Few resources, little state |
| ESX or QBCore roleplay, 48-64 | 4-6 GB | 2 | The common case |
| Large roleplay, 64-128 slots | 8-12 GB | 2.5-3.5 | Hundreds of resources |
Memory tracks the number of resources and the state they hold rather than the number of players, so a half-empty server with two hundred scripts uses more than a full one with forty. CPU is about the main thread, which means clock speed over core count; extra cores help with asset serving and resource loading rather than with tick time.
Every framework needs a database, and on RE:NODE every FiveM plan includes a database slot created from the panel with a generated host, user and password, plus an "Open in phpMyAdmin" button that signs you in with a one-use token. The connection string goes in the config the same way it would anywhere else:
set mysql_connection_string "mysql://user:password@host:3306/database?charset=utf8mb4"The database and oxmysql covers the schema import, slow queries and backing the thing up - which matters more on a roleplay server than anywhere else in this catalogue, because the database is the characters and losing it is losing the server.
FiveM plans on RE:NODE run from 2 GB to 12 GB, from $9 a month, with two port allocations, txAdmin available, and your own Cfx.re key entered on the Setup tab. Backup slots come with every plan and the Schedules tab can run a nightly one.
Troubleshooting#
"Couldn't load resource X". A manifest error or a missing dependency. The line immediately above it in the console names the real problem; the resource name is just where it surfaced.
The server does not appear in the list. Licence key first, TCP 30120 reachable from outside second. Test by fetching http://your-address:30120/info.json from another network - if that fails, nothing else will work either.
Players are told to change their game build. sv_enforceGameBuild does not match what their client is on. Set it to a current build, or remove it if you use no DLC content.
Stuck on "awaiting scripts" or a black loading screen. A resource erroring during startup, or spawnmanager and sessionmanager missing from the ensure list. Read the console from the top, not the bottom.
txAdmin keeps reporting a hang and restarting. Something is blocking the main thread for seconds at a time. Profile it before raising the timeout; raising the timeout hides the symptom and keeps the cause.
Players connect but cannot see each other. OneSync off on a server with more than 32 slots, or sv_entityLockdown set to strict with resources that spawn entities client-side.
The first join takes five minutes. Streamed assets. Check the total size of your stream folders; most servers are carrying vehicles nobody drives.
FAQ#
Do I need my own FiveM licence key?
Yes. Keys are issued per server to a Cfx.re account and cannot be shared or supplied by a host. Creating one is free and takes about a minute at keymaster.fivem.net.
What happens to the key if I move the server?
The key records the address it was created for, so update it in keymaster or generate a new one. A key that does not match the address it is used from stops the server at startup with a licensing error.
Is txAdmin something I have to install?
No. It has shipped inside the FXServer artifacts for years. Start the server with no config and txAdmin comes up on port 40120 with a one-time PIN in the console.
How many players can a FiveM server hold?
Thirty-two without OneSync. With OneSync enabled the engine ceiling is far higher, but the practical limit is your resources: most serious roleplay servers run 48 to 128 and the constraint is script time on the main thread, not slots.
Will more RAM fix my stuttering server?
Almost never. Stutter on FiveM is main-thread time, and that is a resource problem. Read txAdmin's performance chart and the client's resmon output before changing plan.
Can I run ESX or QBCore without a database?
No. Both store characters, inventories and money in a database, and the framework will not start without a working connection string.




Comments
Completely anonymous: no account, no email, no cookie. We store the name you type, the text and the time - nothing else. Links are limited and markup is not rendered.