← Back to Blog
By Azion Cloud Team · July 2026 · 14 min read

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:

Server Requirements

FiveM servers are more CPU and network intensive than many other game servers. Here's what you'll need:

ResourceSmall (8-16 players)Medium (32-64 players)Large (64-128 players)
CPU2 cores4 cores6+ cores
RAM4 GB8 GB16+ GB
Storage30 GB SSD50 GB SSD80+ GB NVMe
Network10 Mbps25 Mbps50+ Mbps
OSLinux (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):

  1. Go to keymaster.fivem.net
  2. Log in with your Cfx.re account (create one if needed)
  3. Click "Register a new server"
  4. Enter a server name, your server's IP address, and select the server type
  5. 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:

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)

QBCore

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:

  1. Open txAdmin (http://your-ip:40120)
  2. Go to SetupRecipe Deployer
  3. Select QBCore or ESX from the available recipes
  4. Follow the prompts — it will download and configure everything including the database
  5. 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

Connecting to Your Server

  1. Open FiveM client on your PC
  2. Press F8 to open the console, or use the server browser
  3. In the console, type: connect your-server-ip:30120
  4. 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.