FiveM ยท Server setup

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.

  1. 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.

  2. 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/ and server.cfg carry over.

  3. 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 shows Started resource sessionmanager and similar lines without errors, the server is up on port 30120.

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.

  1. Sign in at keymaster.fivem.net

    Go to keymaster.fivem.net and sign in with your Cfx.re forum account.

  2. 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".

  3. Paste the key into server.cfg

    Open server.cfg via the panel's file manager or SFTP, find the line:

    sv_licenseKey changeme

    Replace changeme with your actual key (starts with cfxk_). 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.

  1. Stop your server

    Panel โ†’ Stop. Don't edit resources while the server is running.

  2. Create a MySQL database

    Panel โ†’ Databases โ†’ Create Database. Note the host, user, password, and DB name โ€” you'll need them in Step 5.

  3. Download the QBCore resources

    Grab the latest from the official GitHub org: github.com/qbcore-framework. At minimum you need:

    • qb-core โ€” the framework itself
    • qb-target โ€” interaction targeting
    • qb-inventory โ€” inventory system
    • qb-menu and qb-input โ€” UI helpers
    • qb-multicharacter โ€” character selection
    • qb-spawn and qb-apartments โ€” spawning and housing
    • oxmysql โ€” database driver (from overextended/oxmysql)
  4. 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)
  5. 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=utf8mb4 is important for emoji / non-Latin chat support.

  6. Import the QBCore SQL schema

    Open your database in the panel's phpMyAdmin (Databases โ†’ Manage). Import the qb-core.sql schema from the qb-core resource's root directory. This creates tables for players, jobs, vehicles, housing, etc.

  7. Add ensure statements to server.cfg

    Add 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
  8. Start the server and watch the console

    Panel โ†’ Start. You should see each resource Started resource qb-core without 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.

  1. Find your txAdmin URL

    txAdmin listens on port 40120 by default. Your URL is http://YOUR-SERVER-IP:40120. Find the IP in Settings โ†’ Network in the Fatality panel.

  2. 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.

  3. 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.

  4. 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- or esx_ 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

  1. Stop your server (or just the resource you're swapping if you know what you're doing).
  2. Upload the resource folder to resources/[your-category]/ via SFTP.
  3. Check the script's README for required dependencies โ€” most QBCore scripts need qb-core, qb-target, and oxmysql at minimum.
  4. Add ensure your-script-name to server.cfg in the right load order (after its dependencies).
  5. Import any SQL that ships with the script (usually a .sql file in the resource root).
  6. Configure config.lua inside the resource โ€” most scripts expose options for permissions, prices, locations, etc.
  7. 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.

  1. Open the FiveM client

    Launch FiveM. Sign in with your Cfx.re account if prompted.

  2. 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.

  3. 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.

  4. 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 localhost when you should use 127.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_hostname set 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.