
FiveM transforms Grand Theft Auto V into a platform for collaborative roleplay, custom gamemodes, and community building. Getting a server running correctly requires understanding its unique architecture: FiveM is not a typical game server, it is a custom multiplayer framework with its own resource system.
Prerequisites
Before starting:
- A legal, fully updated copy of GTA V for every player. Cfx.re lists stores such as Steam, the Epic Games Store and Rockstar Warehouse, and FiveM does not work with pirated copies.
- A Cfx.re account (formerly FiveM forums)
- A free server license key from the Cfx Portal. Older guides send you to keymaster.fivem.net, which now redirects to the Portal; our Keymaster guide shows the steps.
Server Installation
Cfx.re builds FXServer for Windows and Linux. It calls the Linux version a courtesy port and says issues are more likely to be fixed on Windows. On a Debian or Ubuntu VPS, create a user for the server and download the build as that user:
# xz-utils unpacks fx.tar.xz; the system user runs FXServer instead of root
sudo apt install xz-utils
sudo adduser --system --group --home /home/fivem fivem
sudo -u fivem mkdir -p /home/fivem/artifacts
# Paste the fx.tar.xz link of the Recommended build from the Server Download page
sudo -u fivem wget -O /home/fivem/artifacts/fx.tar.xz 'PASTE_THE_FX.TAR.XZ_LINK_HERE'
sudo -u fivem tar xf /home/fivem/artifacts/fx.tar.xz -C /home/fivem/artifacts
On 31 October 2026 the Server Download page listed build 35245 as Recommended and 38055 as Latest. Use Recommended for a server people play on, and keep it current; our artifacts guide covers updating.
Framework Selection
A FiveM "framework" is a collection of resources (scripts) that provides the core gameplay systems: jobs, inventory, economy, character creation. Cfx.re's framework overview lists ESX, ND, QBCore, Qbox and vRP for FiveM and recommends deploying them with txAdmin recipes. What txAdmin offers changed on 29 October 2026:
ESX Legacy: in txAdmin's Popular Recipes list. ESX says the project started in 2017.
Qbox: in the list too, where it is described as compatible with QBCore resources. Qbox needs MariaDB 10.9.0 or newer, recommends 12.3 LTS and does not support MySQL. Its FAQ says most QBCore scripts run through its bridge layer without changes; scripts that access QBCore's database tables directly are one of the exceptions.
QBCore: no longer in the list. txAdmin removed the QBCore recipe from its index on 29 October 2026, and the recipes README marks it as deprecated; the commit gives no reason. QBCore still publishes its own recipe, which you can load with txAdmin's Remote URL Template option.
For a new roleplay server, start with a recipe from the list: ESX Legacy or Qbox. Our ESX vs QBCore vs Qbox comparison goes deeper, and the QBCore to Qbox migration guide covers moving an existing QBCore server.
Resource Installation
Resources live in the resources/ folder of your server data. Every folder in there is a resource, except folders in [brackets], which are categories that hold several resources. Each resource folder needs its own fxmanifest.lua (Cfx.re):
resources/
[local]/
my-script/
fxmanifest.lua
my-hud/
fxmanifest.lua
Start them in server.cfg, one resource at a time or a whole category:
ensure my-hud
start [local]
A recipe such as ESX Legacy or Qbox creates this folder and its server.cfg for you.
First Launch Checklist
□ License key from the Cfx Portal in server.cfg (txAdmin's deployer asks for it)
□ Framework resources start without errors (console log)
□ Database connected (MariaDB; Qbox does not support MySQL)
□ Discord bot connected for whitelisting (if applicable)
□ Server name, description and tags filled in on the Cfx Portal
□ Server visible in the FiveM server list (allow up to 8 minutes)
On Space-Node FiveM hosting, txAdmin comes pre-installed, and you add your own Cfx.re license key from the Portal in txAdmin. Ask support which database your server can use before you deploy a recipe that needs one.
What "complete setup" actually involves
A FiveM server has three moving parts: the server artifacts (the FXServer build), txAdmin (the web manager, which has been part of FXServer since early 2020), and, for frameworks like ESX Legacy or Qbox, a MariaDB database for persistent data.
Linux setup, working directories
/home/fivem/
artifacts/ <- the Linux build, with run.sh
txData/ <- created by txAdmin on first start
<server>/ <- suggested deploy folder for server.cfg and resources/
txAdmin keeps its logs, configs and data in txData, which sits in the folder that contains run.sh unless you change it (txAdmin docs). txAdmin also suggests a subfolder of txData as the place to deploy a new server. Run FXServer as its own user, as above, not as root.
First boot
sudo -u fivem bash /home/fivem/artifacts/run.sh
Started without +exec server.cfg, FXServer starts txAdmin on port 40120 and prints a 4-digit PIN in the console (txAdmin, Cfx.re). Open http://localhost:40120 through the SSH tunnel in the Firewall section below (or http://your-ip:40120 while that port is still open), enter the PIN, click Link Account, sign in with your Cfx.re account, set a backup password and register.
In the deployer, choose Popular Recipes. On 31 October 2026 the FiveM templates in the recipe index that this page loads were FiveM Basic Server (CFX Default), ESX Legacy, Qbox, vMenu, StreetKings and WarfareTacticsV. The card on the setup page still says the list includes QBCore, but QBCore has been gone from it since 29 October 2026. Paste your Portal key when the deployer asks for it, run the recipe, then click Save & Run Server. Our txAdmin guide walks through every screen, including Remote URL Template for QBCore's own recipe.
server.cfg essentials
If you set FXServer up by hand instead of with a recipe, these lines follow Cfx.re's example server.cfg, plus sv_endpointPrivacy from the command reference:
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
set onesync on
sv_maxclients 48
sv_endpointPrivacy true
sv_scriptHookAllowed 0
set steam_webApiKey ""
sv_licenseKey "cfxk_xxxxxxxxxxxxxxxxxxxxx_xxxxxx"
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
sv_maxclientstakes 1 to 2048. From 32 slots OneSync must beonorlegacy, above 64 it must beon. OneSync is free up to 48 slots; more needs FiveM Element Club Argentum or higher on the Cfx.re account that owns the key.sv_endpointPrivacy truehides player IP addresses from the public reports the server outputs.sv_scriptHookAllowed 0keeps clients with Script Hook V out. That is the default, and Cfx.re does not recommend allowing it.sv_hostname,sv_projectNameandsv_projectDescare deprecated. Since 21 October 2026 the server list takes the name, description, tags, language and images from the Cfx Portal (announcement), and a server with empty fields shows as "Missing server data (must be configured in Portal)". Our Missing server data fix shows where to fill them in.
Database
sudo apt install mariadb-server
sudo mariadb-secure-installation
sudo mariadb <<'SQL'
CREATE DATABASE fivem CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'fivem'@'127.0.0.1' IDENTIFIED BY 'CHANGE_ME';
GRANT ALL ON fivem.* TO 'fivem'@'127.0.0.1';
FLUSH PRIVILEGES;
SQL
Ubuntu 24.04 and Debian 12 install MariaDB 10.11, which meets Qbox's minimum of 10.9.0. MariaDB's root account logs in through the Unix socket, so sudo mariadb works without a password (MariaDB).
In server.cfg:
set mysql_connection_string "mysql://fivem:CHANGE_ME@127.0.0.1/fivem?charset=utf8mb4"
This is the same format txAdmin's deployer writes for recipes, and oxmysql reads it.
Firewall
sudo ufw allow 22/tcp
sudo ufw allow 30120/tcp comment 'fivem-game'
sudo ufw allow 30120/udp comment 'fivem-game'
sudo ufw deny 40120/tcp comment 'txadmin'
sudo ufw enable
Allow SSH before you run ufw enable, because enabling the firewall can drop open SSH connections (ufw). Incoming traffic is denied by default once ufw is on, so the 40120 rule only makes that explicit.
Keep 40120 closed to the internet and reach txAdmin through an SSH tunnel. Log in with your own SSH user: the fivem system user has no password and no login shell.
ssh -L 40120:127.0.0.1:40120 you@your-server
Then open http://localhost:40120 on your own computer.
What goes wrong on day one
| Symptom | Cause | Fix |
|---|---|---|
| "no license key was specified" | server.cfg was not read (manual setup) | Start FXServer from the folder with server.cfg and add +exec server.cfg |
| "Failed to start resource", no resources found | FXServer started from the wrong folder | cd into the folder with server.cfg, then start it |
| Server missing from the list or marked private | Port forwarding, a firewall, or sv_master1 without its # | Test connect IP:30120 in the F8 console, open TCP and UDP 30120, keep #sv_master1 "" commented out, wait up to 8 minutes |
| "Missing server data (must be configured in Portal)" | Name and description are not set in the Cfx Portal | Fill in the server details in the Portal |
| Server stops at 48 players | No Element Club Argentum on the key's account | Subscribe, use the latest artifact, raise sv_maxclients, restart |
| Console warning "RESOURCE took ...ms to execute a query" | A query at or over oxmysql's 200 ms warning threshold | Index the columns it filters on; see our MariaDB guide for FiveM |
The first five rows come from Cfx.re's vanilla setup and server issues pages, the last one from oxmysql's logger.
Sources
All opened on 31 October 2026:
- Cfx.re docs: Setting up a FiveM server, Setting up a server using txAdmin, Setting up a vanilla FXServer, Server Download, Server commands, OneSync, Frameworks, Introduction to resources, Server issues, Where to buy GTA V
- Cfx.re forum: Portal update: server metadata management
- txAdmin: README, environment configuration, setup page, deployer database string, recipe index and README, indexv4.json, QBCore removal commit
- Frameworks: ESX Legacy, Qbox installation, Qbox FAQ, QBCore txAdmin recipe
- oxmysql: README, config.ts, logger
- MariaDB: Authentication from MariaDB 10.4, mariadb-secure-installation, packages for Ubuntu 24.04 and Debian 12
- Linux: adduser(8), wget(1), tar(1), ufw(8), ssh(1)