Back to all guides
Game Servers

How to Set Up a FiveM (GTA V) Server on Linux

5 read2026-04-10

FiveM is the most popular multiplayer modification framework for GTA V, enabling custom roleplay and freeroam servers. This guide covers a clean setup with the built-in txAdmin web panel.

Recommendation: Since FiveM servers are frequent targets of DDoS attacks and demand maximum single-core clock speeds, we recommend hosting on a Prepaid Gaming KVM Server with AMD Ryzen 9 9950X. Equipped with our surgical SmartNet & PletX DDoS protection, your server remains online even during volumetric attacks.

1. System Requirements

  • Minimum: 4 GB RAM, 2 vCPU cores, 30 GB SSD
  • Recommended: 8 GB RAM, 4 cores for 32+ player slots
  • A valid Cfx.re license key (free, linked to your server IP)

2. Install Dependencies

bash
sudo apt update
sudo apt install xz-utils curl git -y
sudo useradd -r -m -d /opt/fivem -s /bin/bash fivem

3. Download FiveM Server Artifacts

bash
sudo su - fivem
mkdir server && cd server
# Get the latest recommended Linux build from https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/
curl -O https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/LATEST_BUILD_URL_HERE
tar -xf fx.tar.xz

Important: Visit the artifacts page and copy the URL of the latest recommended build.

4. First Start with txAdmin

txAdmin is FiveM's built-in web-based server management panel. Start the server binary:

bash
./run.sh

The console will output a URL like http://YOUR_IP:40120 and a PIN code. Open that URL in your browser, enter the PIN, and follow the setup wizard:

  1. Link your Cfx.re account.
  2. Choose a server template (e.g., "CFX Default" for freeroam or a roleplay base like QBCore/ESX).
  3. Set your license key from keymaster.fivem.net.
  4. Define the server data folder path.

5. Firewall Rules

bash
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp
sudo ufw allow 40120/tcp

Port 30120 is for player connections, 40120 is for the txAdmin web panel.

6. Keep Running with PM2

bash
exit  # back to root
sudo npm install pm2 -g
sudo -u fivem pm2 start /opt/fivem/server/run.sh --name fivem
sudo -u fivem pm2 save
sudo env PATH=$PATH:/usr/bin pm2 startup systemd -u fivem --hp /opt/fivem
KVM Game VPS

Ready for your own game server?

Launch your own gaming project on our high-performance KVM VPS with maximum AMD Ryzen single-core power, ultra-fast NVMe storage, and real Layer 3/4/7 DDoS protection (PletX & SmartNet). 100% prepaid with no contract lock-in.

AMD Single-Core Power
Datacenter NVMe SSD
4+ Tbps DDoS Protection
100% Prepaid (No Contract)