How to set up a FiveM server from scratch
Full setup path: deploy an FXServer artifact, get a Cfx.re license key, configure server.cfg, install a framework (ESX / QBCore / QBox), wire up txAdmin, and layer in scripts. Covers the errors you'll actually hit and where to find battle-tested scripts.
What you need first
Before you deploy anything, get these in order:
- An active FiveM plan on Fatality Servers. See our FiveM hosting plans if you haven't signed up yet.
- A Rockstar Social Club account with a legitimate copy of GTA V โ needed to test-connect to your own server.
- A Cfx.re forum account at forum.cfx.re โ needed to generate a server license key.
- The FiveM client installed locally (free, from fivem.net) โ for testing and direct-connect.
- A decision on framework: vanilla FiveM, ESX Legacy, QBCore, or QBox. We'll help you pick in Step 5.
Not sure yet? Start with QBCore โ it's the de facto standard for new RP servers, has the biggest script ecosystem, and is easy to swap out later if you decide vanilla FiveM is better for your gamemode.
Deploy the server (1-click)
Our FiveM template handles the boring bits โ artifact download, directory structure, starter server.cfg, and the txAdmin bootstrap.
-
Pick the FiveM template at checkout
On the FiveM hosting page, pick a plan sized for your slot count (16, 32, 48, 64, 96+ slots). Add to cart, pick the location closest to your playerbase, and check out.
-
Choose an artifact track
After provisioning, the panel asks for your artifact track:
- Recommended โ stable, battle-tested. Use this unless you have a specific reason not to.
- Latest โ bleeding-edge build. Some resources don't support the newest natives yet. Fine for development servers, risky for production.
- Optional โ a middle-ground pinned build. Rarely the right choice.
You can switch tracks later from the panel โ your
resources/andserver.cfgcarry over. -
Wait for the first boot
The panel extracts the artifact, generates a starter
server.cfg, and starts an empty FXServer. Takes about 60 seconds. When the console showsStarted resource sessionmanagerand similar lines without errors, the server is up on port30120.
Get your Cfx.re license key
Without a license key your server runs, but it won't appear in the official server list and it can't be fully validated. For any public server, you need one. They're free.
-
Sign in at keymaster.fivem.net
Go to keymaster.fivem.net and sign in with your Cfx.re forum account.
-
Create a new license key
Click New License Key. Enter your server's public IP (find it in the Fatality panel under Settings โ Network). Name the key something recognizable like "QBCore RP โ Frankfurt".
-
Paste the key into
server.cfgOpen
server.cfgvia the panel's file manager or SFTP, find the line:sv_licenseKey changemeReplace
changemewith your actual key (starts withcfxk_). Save and restart the server.
Don't share your license key publicly. It's tied to your Cfx.re account and your server IP. Anyone with the key can impersonate your server on the list. Treat it like a password.
Configure server.cfg
This is the file FiveM loads first. Our template ships a working default, but the following lines are the ones you'll almost always want to customize:
# Identity
sv_hostname "^5My QBCore RP ^7| ^3Custom Scripts ^7| ^1Active Staff"
sv_projectName "MyRP"
sv_projectDesc "Serious roleplay, 18+ only"
# Slot count โ match your plan
sv_maxclients 64
# License key (from keymaster.fivem.net)
sv_licenseKey cfxk_xxxxxxxxxxxxxxxxxxxxxx_xxxx
# Network endpoints
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
# Hide player endpoints from server list
sv_endpointprivacy true
# Disable native Script Hook (prevents basic cheats)
sv_scriptHookAllowed 0
# Server list tags (filtering)
sets tags "roleplay, qbcore, serious, whitelist"
sets locale "en-US"
sets banner_connecting "https://yourdomain.com/banner.jpg"
sets banner_detail "https://yourdomain.com/banner-detail.jpg"
# Load order for resources (ESSENTIAL first, framework second, scripts last)
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure fivem
ensure hardcap
ensure rconlog
ensure scoreboard
# Your framework resources load here (see Step 6)
# ensure qb-core
# ensure oxmysql
# etc.
Load order matters. Framework resources (qb-core, es_extended) must load before any script that depends on them. If a script expects QBCore:GetPlayer and QBCore hasn't loaded yet, you'll get attempt to index a nil value errors.
Pick a framework โ ESX, QBCore, or QBox
The framework is the base layer your RP scripts sit on top of. Swapping it later is painful, so pick intentionally.
Vanilla FiveM (no framework)
Best for: deathmatch, drift, racing, minigame, and heavily custom gamemodes where you don't need an RP economy / jobs / housing.
ESX Legacy
Best for: large existing script libraries, communities coming from old ESX servers, teams who prefer the older Lua patterns. Still actively used; many premium scripts ship ESX-only.
QBCore (recommended default)
Best for: most new RP servers. Modern code, clean resource structure, huge active community, the biggest share of new free and paid scripts. De facto standard as of 2026.
QBox
Best for: admins who want QBCore's ecosystem but with a faster dev cycle and some performance improvements. Largely drop-in compatible with QBCore resources. Growing but smaller community than QBCore.
Install the framework (QBCore walkthrough)
We'll walk through QBCore since it's what most admins pick. ESX and QBox install similarly โ same SFTP upload + server.cfg ensure pattern.
-
Stop your server
Panel โ Stop. Don't edit resources while the server is running.
-
Create a MySQL database
Panel โ Databases โ Create Database. Note the host, user, password, and DB name โ you'll need them in Step 5.
-
Download the QBCore resources
Grab the latest from the official GitHub org: github.com/qbcore-framework. At minimum you need:
qb-coreโ the framework itselfqb-targetโ interaction targetingqb-inventoryโ inventory systemqb-menuandqb-inputโ UI helpersqb-multicharacterโ character selectionqb-spawnandqb-apartmentsโ spawning and housingoxmysqlโ database driver (from overextended/oxmysql)
-
Upload to
resources/[qb]/Organize them under a folder bracket
[qb]so FiveM groups them visually. SFTP layout:resources/ โโโ [qb]/ โ โโโ qb-core/ โ โโโ qb-target/ โ โโโ qb-inventory/ โ โโโ qb-menu/ โ โโโ ... (rest of QBCore resources) โโโ [standalone]/ โ โโโ oxmysql/ โโโ ... (vanilla FiveM resources) -
Set the oxmysql connection string
In
server.cfg, add:set mysql_connection_string "mysql://USER:PASSWORD@HOST/DATABASE?charset=utf8mb4"Use the credentials from Step 2. The
?charset=utf8mb4is important for emoji / non-Latin chat support. -
Import the QBCore SQL schema
Open your database in the panel's phpMyAdmin (Databases โ Manage). Import the
qb-core.sqlschema from theqb-coreresource's root directory. This creates tables for players, jobs, vehicles, housing, etc. -
Add ensure statements to
server.cfgAdd these after the vanilla ensures, before any script ensures:
# Database first ensure oxmysql # Core framework ensure qb-core # Essential QBCore resources (load order matters) ensure qb-target ensure qb-input ensure qb-menu ensure qb-inventory ensure qb-multicharacter ensure qb-spawn ensure qb-apartments -
Start the server and watch the console
Panel โ Start. You should see each resource
Started resource qb-corewithout errors. If one fails, the line above the failure names the dependency you're missing.
Set up txAdmin
txAdmin is a web-based admin panel โ player admin, live chat monitoring, scheduled restarts, resource manager, script errors, and server console in one UI. It ships with every FXServer artifact since 2022, so there's nothing to install โ just configure it.
-
Find your txAdmin URL
txAdmin listens on port
40120by default. Your URL ishttp://YOUR-SERVER-IP:40120. Find the IP in Settings โ Network in the Fatality panel. -
Link your Cfx.re account
First-time setup walks you through linking your Cfx.re forum account as the first admin. This is the only admin you can't demote, so pick the right account.
-
Add additional admins
From the txAdmin sidebar: Settings โ Admin Manager. Invite by Cfx.re username. Granular permissions โ you can scope admins to chat moderation, player management, or full control.
-
Schedule restarts
Settings โ Server Control โ Restart Schedule. A restart every 6 hours is the FiveM community norm for RP servers โ long enough to let a night session play out, short enough to keep memory leaks from any misbehaving resource under control.
Add FiveM scripts to your server
Scripts are where FiveM goes from "GTA V multiplayer" to "a custom game." Everything visible in-game that isn't vanilla โ custom jobs, housing, heists, vehicles, UIs, dispatch systems, casinos โ is a script. You'll install dozens to hundreds of them for a serious RP server.
Where to find FiveM scripts
- Cfx.re forum (Releases) โ forum.cfx.re/c/development/releases โ the official community forum. Tons of free releases, mixed quality. Good starting point for free scripts.
-
GitHub โ most QBCore / ESX resources are open source. Search
qb-oresx_prefixes. Good for transparent code you can audit. - FiveM Market โ a curated marketplace for premium FiveM scripts. Custom jobs, advanced heists, housing systems, car dealerships, polished UIs, full server starter-packs. The right source when you want something better than the free version โ e.g. a polished drug-dealing system, a car shop with finance and trading, or a ready-to-deploy police system. Paid but saves weeks of dev time.
- Tebex stores โ many individual script creators sell via their own Tebex storefronts (linked from their forum threads or GitHub).
- Custom dev โ for unique gameplay ideas, hire a Lua dev. Starts around $30/hr for experienced FiveM devs; a full custom system might run $500-5,000+.
Buying premium scripts? FiveM Market is a solid one-stop for curated, reviewed scripts โ especially useful when you want a polished system without hunting through forum threads. Community starter packs there can save weeks of integration work on a new RP launch.
How to install a script
- Stop your server (or just the resource you're swapping if you know what you're doing).
- Upload the resource folder to
resources/[your-category]/via SFTP. - Check the script's README for required dependencies โ most QBCore scripts need
qb-core,qb-target, andoxmysqlat minimum. - Add
ensure your-script-nametoserver.cfgin the right load order (after its dependencies). - Import any SQL that ships with the script (usually a
.sqlfile in the resource root). - Configure
config.luainside the resource โ most scripts expose options for permissions, prices, locations, etc. - Start the server and watch the console for errors on boot.
Leaked / cracked scripts are a bad idea. They often ship with obfuscated backdoors that give the original seller admin access to your server. Stick to official releases, GitHub, or reputable paid marketplaces. If a "free" version of a known paid script appears somewhere sketchy, assume it's malware.
Connect and test
Time to actually join your server.
-
Open the FiveM client
Launch FiveM. Sign in with your Cfx.re account if prompted.
-
Direct-connect to your server
Play โ Direct Connect. Enter
YOUR-SERVER-IP:30120. Hit Connect. The client downloads resources (larger on first join of a modded server) then drops you in. -
Favourite the server
Once in, hit F8 to open the console and run
quit. Back in the client, your recent server appears at the top โ favourite it so you don't have to re-type the IP next time. -
Test with a friend
Share your IP with one trusted tester. Watch the console during their connect โ resources downloading, player spawning, framework loading. This is the fastest way to catch a broken script before players do.
Common errors and fixes
"couldn't contact heartbeat server"
License key is missing or doesn't match your server's IP. Check sv_licenseKey in server.cfg, and verify the IP on keymaster.fivem.net matches your server's current public IP.
"attempt to index a nil value (global 'QBCore')"
A script tried to use QBCore before it loaded. Check your ensure order in server.cfg โ qb-core must come before any qb-* script that uses it. oxmysql must come before qb-core.
"MySQL connection failed"
Your mysql_connection_string is wrong. Common causes:
- Wrong password (create a new DB user in the panel, update the string)
- Missing
?charset=utf8mb4โ some oxmysql versions throw without it - Using
localhostwhen you should use127.0.0.1(or the panel's specific DB host)
Server starts but doesn't appear in the server list
Three common causes:
- License key missing or expired
sv_hostnameset to the default placeholder โ the list filters out default names- Server list hasn't caught up yet; direct-connect usually works fine even before the listing appears (can take 5-15 min on first boot)
"sv_scriptHookAllowed is set to true" warning
Script Hook lets players use external trainers โ you do not want this on a real server. Set sv_scriptHookAllowed 0 in server.cfg.
txAdmin locked out / forgot admin password
Panel โ Console, run the FXServer command txAdmin-resetMasterPassword. This regenerates a one-time setup link in the server console output. Use it to reset your admin account.
Players get kicked right after connect
Usually an anti-cheat (EasyAdmin, WASABI, or custom) rejecting them, or a resource timing out during load. Check logs/ in the file manager, and have the player share their F8 console output. txAdmin's player detail page shows the exact kick reason.
Stuck on something specific? Email support with your server IP, your framework (QBCore / ESX / QBox / vanilla), and the last 50 lines of your FXServer console โ we'll usually have an answer within the hour. For broader FiveM questions, see the FAQ's Games section.