How to Set Up a FiveM (GTA V) Server on Linux
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
sudo apt update
sudo apt install xz-utils curl git -y
sudo useradd -r -m -d /opt/fivem -s /bin/bash fivem3. Download FiveM Server Artifacts
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.xzImportant: 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:
./run.shThe 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:
- Link your Cfx.re account.
- Choose a server template (e.g., "CFX Default" for freeroam or a roleplay base like QBCore/ESX).
- Set your license key from keymaster.fivem.net.
- Define the server data folder path.
5. Firewall Rules
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp
sudo ufw allow 40120/tcpPort 30120 is for player connections, 40120 is for the txAdmin web panel.
6. Keep Running with PM2
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/fivemReady 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.