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 legitimate GTA V licence (Steam or Rockstar Games Launcher)
- A Cfx.re account (formerly FiveM forums)
- A server licence key from keymaster.fivem.net
Server Installation
# Create server directory
mkdir -p /home/fivem/server-data
# Download FiveM server artifact (Alpine Linux build recommended)
wget https://artifacts.fivem.net/server/
# Extract
tar -xzf fx.tar.xz -C /home/fivem/
# Create configuration
cat > /home/fivem/server-data/server.cfg << 'EOF'
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
set steam_webApiKey "none"
sv_licenseKey "your_license_key_here"
sv_hostname "Your Server Name"
sv_maxclients 32
set sv_projectName "Your Server"
set sv_projectDesc "Your Description"
onesync on
EOF
Framework Selection
A FiveM "framework" is a collection of resources (scripts) that provides the core gameplay systems - jobs, inventory, economy, character creation. The two dominant frameworks in 2026:
QBCore - Modern, actively maintained, currently the most popular framework for new servers. Better architecture than ESX, more plugins available in 2026.
ESX (ESX Legacy) - The original dominant framework. Larger plugin ecosystem historically, but much of its script library is unmaintained. Still viable for servers with existing ESX infrastructure.
For new servers in 2026, start with QBCore. The ecosystem is healthier.
Resource Installation
Resources are installed to /home/fivem/server-data/resources/:
resources/
[core]/
fxmanifest.lua # Core framework
[qb]/
qb-core/
qb-inventory/
qb-jobs/
Add to server.cfg:
ensure qb-core
ensure qb-inventory
ensure qb-jobs
First Launch Checklist
□ server.cfg has valid licence key
□ Framework resource loads without errors (console log)
□ Database connected (MariaDB/MySQL)
□ Discord bot connected for whitelisting (if applicable)
□ Server visible in FiveM server list
Space-Node's FiveM hosting plans include one-click QBCore and ESX framework installation with preconfigured database connections.
Launch your FiveM server on Space-Node
What "complete setup" actually involves
A FiveM server has four moving parts: the server binaries (fxserver), the artifacts (server build), txAdmin (web manager), and a database (MySQL/MariaDB) for persistent data via frameworks like ESX or QBCore.
Linux setup, working directories
/home/fivem/
artifacts/ <- linux build
server-data/
resources/ <- your scripts, MLOs, vehicles
server.cfg
txData/ <- created on first boot
cache/
Run fxserver as a non-root user, never root.
First boot
adduser --system --group --home /home/fivem fivem
sudo -u fivem mkdir -p /home/fivem/{artifacts,server-data}
cd /home/fivem/artifacts
sudo -u fivem wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/<latest>/fx.tar.xz
sudo -u fivem tar -xf fx.tar.xz
cd /home/fivem/server-data
sudo -u fivem /home/fivem/artifacts/run.sh +set serverProfile default
txAdmin will print a one-time PIN. Open http://your-ip:40120, enter the PIN, log in with Cfx.re, and run a recipe (qb-core or esx-recipe-build).
server.cfg essentials
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
sv_hostname "My RP Server"
sv_maxClients 64
sv_endpointPrivacy true
sv_scriptHookAllowed 0
sv_authMaxVariance 1
sv_authMinTrust 5
sv_licenseKey "cfxk_xxxxxxxxxxxxxxxxxxxx_xxxxxx"
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
sv_endpointPrivacy true blocks scrapers from harvesting player IPs through the public CFX server list API.
Database
sudo apt install mariadb-server
sudo mysql_secure_installation
mysql -u root -p <<'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
In server.cfg:
set mysql_connection_string "mysql://fivem:CHANGE_ME@127.0.0.1/fivem?charset=utf8mb4"
Firewall
ufw allow 30120/tcp comment fivem-game
ufw allow 30120/udp comment fivem-game
ufw allow 22/tcp
ufw deny 40120/tcp # txAdmin: tunnel via SSH only
ufw enable
Never expose 40120 directly. Tunnel:
ssh -L 40120:127.0.0.1:40120 fivem@your-server
What goes wrong on day one
| Symptom | Cause | Fix |
|---|---|---|
| txAdmin won't accept PIN | clock drift on VPS | timedatectl set-ntp true |
| Server invisible in CFX list | wrong license key or NAT | check sv_licenseKey, open UDP 30120 |
| Players ping 999 | endpoint_add_tcp on wrong IP | bind 0.0.0.0, not 127.0.0.1 |
| MariaDB "too many connections" | one bad script opens per query | switch to oxmysql / mysql-async pool |
