How to Set Up a FiveM Server (GTA 5 RP)
FiveM is the most popular multiplayer modification framework for Grand Theft Auto V, powering thousands of roleplay, racing, and custom game mode servers worldwide. This guide walks you through setting up your own FiveM server from scratch — from getting a license key to installing a roleplay framework and going live.
What is FiveM?
FiveM is a modification framework for GTA V that lets you play on custom multiplayer servers with modded experiences — primarily roleplay (RP) servers. Unlike GTA Online (Rockstar's official multiplayer), FiveM servers are community-run and can have completely custom game modes, scripts, vehicles, maps, and rules.
Popular FiveM server types include:
- Roleplay (RP) — The most popular type. Players take on fictional characters (police, criminals, medics, business owners) and interact in a persistent city.
- Drift/Racing — Custom tracks, tuned vehicles, and competitive racing.
- Freeroam — Open sandbox with custom vehicles, weapons, and game modes.
- PvP/Deathmatch — Competitive combat servers.
Server Requirements
FiveM servers are more CPU and network intensive than many other game servers. Here's what you'll need:
| Resource | Small (8-16 players) | Medium (32-64 players) | Large (64-128 players) |
|---|---|---|---|
| CPU | 2 cores | 4 cores | 6+ cores |
| RAM | 4 GB | 8 GB | 16+ GB |
| Storage | 30 GB SSD | 50 GB SSD | 80+ GB NVMe |
| Network | 10 Mbps | 25 Mbps | 50+ Mbps |
| OS | Linux (Ubuntu 22.04+) or Windows Server | ||
Note: FiveM servers with heavy RP frameworks (QBCore/ESX with 100+ resources) use significantly more RAM and CPU. A basic server with few resources runs fine on 4 GB RAM, but a fully featured RP server needs 8-16 GB.
Before You Start: Get a FiveM License Key
Every FiveM server requires a free license key from Cfx.re (the organization behind FiveM):
- Go to keymaster.fivem.net
- Log in with your Cfx.re account (create one if needed)
- Click "Register a new server"
- Enter a server name, your server's IP address, and select the server type
- Copy the generated license key — you'll need this later
The key is free and tied to your IP address. If you change servers or IPs, you'll need to update or create a new key.
Method 1: Game Hosting Panel (Easiest)
Using a game hosting provider with Pterodactyl panel makes FiveM setup much simpler:
Step 1: Select FiveM Egg
In your Pterodactyl panel, the FiveM egg is pre-configured with the correct startup command, ports, and file structure. Select it when creating your server.
Step 2: Set Your License Key
In the Startup tab of your panel, find the FIVEM_LICENSE variable and paste your license key from Cfx.re Keymaster.
Step 3: Start and Configure
Start the server. It will download the FiveM server artifacts and create the default configuration. You can then install txAdmin (usually included automatically) and add resources through the file manager.
Method 2: Manual Setup on a VPS
Step 1: Prepare the System
# Update system
sudo apt update && sudo apt upgrade -y
# Install dependencies
sudo apt install git wget curl xz-utils -y
# Create a dedicated user
sudo useradd -m -s /bin/bash fivem
sudo su - fivem
Step 2: Download FiveM Server Artifacts
FiveM server artifacts are the core server files. Download the latest recommended build:
# Create server directory
mkdir -p ~/fivem-server && cd ~/fivem-server
# Download latest Linux server artifacts
# Check https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/ for latest
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/LATEST_BUILD_URL_HERE/fx.tar.xz
# Extract
tar xf fx.tar.xz
Replace LATEST_BUILD_URL_HERE with the actual URL from the FiveM artifacts page. Always use the latest recommended build, not optional builds.
Step 3: Create the Server Configuration
Create your server.cfg file:
nano ~/fivem-server/server.cfg
Basic configuration:
# Server identity
sv_hostname "My FiveM Server"
sv_projectName "My RP Server"
sv_projectDesc "A custom GTA 5 roleplay server"
sv_maxclients 32
sv_licenseKey "YOUR_LICENSE_KEY_HERE"
# Server password (leave empty for public)
# sv_password ""
# RCON password (for remote admin)
rcon_password "your-secure-rcon-password"
# Game type and map
gametype "roleplay"
mapname "fivem-map-skater"
# txAdmin (web-based management panel)
exec resources/[managers]/[txadmin]/txadmin.cfg
# Start default resources
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
ensure baseevents
# OneSync (required for 32+ players)
set onesync on
# Voice chat
voice_useNativeAudio true
voice_useSendingRangeOnly true
# Connection settings
sv_endpointprivacy true
sv_scriptHookAllowed 0
Step 4: Start the Server
cd ~/fivem-server
./run.sh +exec server.cfg
On first launch, FiveM will start txAdmin — a web-based server management panel. It will display a URL (typically http://your-ip:40120) and a PIN code in the console. Open the URL in your browser and enter the PIN to set up txAdmin.
Step 5: Set Up as a systemd Service
sudo nano /etc/systemd/system/fivem.service
[Unit]
Description=FiveM Server
After=network.target
[Service]
Type=simple
User=fivem
WorkingDirectory=/home/fivem/fivem-server
ExecStart=/home/fivem/fivem-server/run.sh +exec server.cfg
Restart=always
RestartSec=15
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable fivem
sudo systemctl start fivem
Understanding txAdmin
txAdmin is FiveM's built-in web panel for server management. After the initial setup, it provides:
- Server dashboard — Monitor players, performance, and resource usage
- Player management — Kick, ban, warn, and message players
- Resource management — Start, stop, and restart individual resources
- Live console — Execute server commands in real-time
- Scheduled restarts — Automatic restarts at set times
- Server deployer — One-click recipe deployment for popular frameworks
Access txAdmin at http://your-server-ip:40120.
Choosing a Framework: ESX vs QBCore
For roleplay servers, you need a framework — a collection of core scripts that handle the economy, jobs, inventory, and player systems. The two dominant choices are:
ESX (es_extended)
- The original RP framework — Established, massive community, thousands of free resources
- Pros: Most resources available, well-documented, large community support
- Cons: Legacy code can be less optimized, some resources are outdated
- Best for: Servers that want the widest selection of pre-made scripts and addons
QBCore
- The modern alternative — Built with performance and clean code in mind
- Pros: Better performance, cleaner codebase, active development, growing resource ecosystem
- Cons: Fewer total resources than ESX (but growing fast), ESX resources aren't compatible
- Best for: New servers that want a clean, modern foundation with good performance
Our recommendation: If you're starting a new server in 2026, go with QBCore. It's more actively maintained, better optimized, and the resource ecosystem has matured significantly. Use txAdmin's server deployer to install it with one click.
Installing a Framework with txAdmin
txAdmin includes a Recipe Deployer that can install popular frameworks automatically:
- Open txAdmin (
http://your-ip:40120) - Go to Setup → Recipe Deployer
- Select QBCore or ESX from the available recipes
- Follow the prompts — it will download and configure everything including the database
- Restart the server when prompted
This sets up the framework, a MySQL database, and essential scripts like jobs, inventory, and phone systems.
Database Setup
Both ESX and QBCore require a MySQL database. If not set up by the recipe deployer:
# Install MariaDB
sudo apt install mariadb-server -y
sudo mysql_secure_installation
# Create database and user
sudo mysql -u root -p
CREATE DATABASE fivem;
CREATE USER 'fivem'@'localhost' IDENTIFIED BY 'your-db-password';
GRANT ALL PRIVILEGES ON fivem.* TO 'fivem'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Add the connection string to your server.cfg:
set mysql_connection_string "mysql://fivem:your-db-password@localhost/fivem?charset=utf8mb4"
Firewall Configuration
# FiveM game port (TCP + UDP)
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp
# txAdmin web panel
sudo ufw allow 40120/tcp
# SSH (if not already allowed)
sudo ufw allow ssh
Performance Tips
- Enable OneSync — Required for 32+ player slots and improves entity synchronization (
set onesync on) - Audit your resources — Each resource adds overhead. Remove unused ones. Use
resmon 1in the console to see per-resource CPU usage - Optimize database queries — Poorly written SQL queries in resources are the #1 cause of server lag. Use
oxmysqlover older MySQL wrappers - Use NVMe storage — FiveM server artifacts and resources benefit from fast I/O
- Schedule restarts every 6-12 hours — FiveM servers accumulate memory over time. txAdmin has built-in scheduled restart support
- Stream assets wisely — Custom vehicles and maps increase RAM usage. Compress textures and limit total streamed assets
Connecting to Your Server
- Open FiveM client on your PC
- Press F8 to open the console, or use the server browser
- In the console, type:
connect your-server-ip:30120 - Or search for your server name in the FiveM server browser
Ready to Launch Your FiveM Server?
Running a GTA 5 FiveM server is one of the most rewarding community projects — building a city, creating jobs, and watching a roleplay community grow around your server. For the easiest setup, our game hosting includes FiveM with Pterodactyl panel and txAdmin pre-configured. If you prefer full manual control, our VPS plans give you root access to build exactly the server you want.