How to Set Up a FiveM Server: Step-by-Step Guide
Complete FiveM server setup guide on REXE VDS: installation, txAdmin configuration, port settings, and performance optimization tips for GTA V roleplay servers.
Table of Contents
Introduction
FiveM is a modification framework for GTA V that allows you to run custom multiplayer servers. This guide covers the complete FiveM server setup process on your REXE VDS server, including txAdmin configuration and optimization.
Minimum recommended specs for a FiveM server: 4 CPU cores, 8GB RAM, 50GB NVMe SSD.
Prerequisites
- A REXE VDS server with Linux (Ubuntu 22.04 recommended)
- SSH access to your server
- A Cfx.re account and license key
- Path Panel firewall rules configured
Step 1: System Preparation
# Update system
sudo apt update && sudo apt upgrade -y
# Install required packages
sudo apt install -y wget git curl xz-utils screen
# Create FiveM user
sudo adduser fivem --disabled-password --gecos ""
sudo su - fivem
Step 2: Download FiveM Server
# Create server directory
mkdir -p ~/fxserver
cd ~/fxserver
# Download latest FiveM server build
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/latest/fx.tar.xz
# Extract
tar -xf fx.tar.xz
rm fx.tar.xz
Step 3: txAdmin Setup
txAdmin is the built-in web-based management panel for FiveM servers.
# Start the server for first-time txAdmin setup
cd ~/fxserver
./run.sh
After starting, txAdmin will display a PIN code in the console. Open your browser and navigate to:
http://SERVER_IP:40120
- Enter the PIN code displayed in the console
- Log in with your Cfx.re account
- Follow the setup wizard to configure your server
- Enter your Cfx.re license key when prompted
Save your txAdmin credentials securely. You'll use them to manage your server through the web interface.
Step 4: Port Configuration
FiveM requires the following ports:
| Port | Protocol | Purpose |
|---|---|---|
| 30120 | TCP + UDP | Game server |
| 40120 | TCP | txAdmin web panel |
Path Panel Rules
Create the following rules in the REXE Path Panel:
# Game server port
Protocol: UDP
Destination Port: 30120
Filter: Grand Theft Auto (if available)
Comment: "FiveM game port"
# Game server TCP
Protocol: TCP
Destination Port: 30120
Filter: -
Comment: "FiveM TCP port"
# txAdmin panel (restrict to your IP)
Protocol: TCP
Destination Port: 40120
Filter: -
Comment: "txAdmin panel access"
Restrict txAdmin port (40120) to your IP address only. Do not open it globally.
Step 5: Server Configuration
Edit your server.cfg file:
# Server name
sv_hostname "My REXE FiveM Server"
# Max players
sv_maxclients 64
# License key
sv_licenseKey "your_license_key_here"
# Server tags
sets tags "roleplay, custom"
# OneSync (recommended for 32+ players)
set onesync on
Step 6: Running as a Service
Create a systemd service for automatic startup:
sudo nano /etc/systemd/system/fivem.service
[Unit]
Description=FiveM Server
After=network.target
[Service]
Type=simple
User=fivem
WorkingDirectory=/home/fivem/fxserver
ExecStart=/home/fivem/fxserver/run.sh
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable fivem
sudo systemctl start fivem
Performance Optimization
- Enable OneSync for better performance with many players
- Use server-side resource loading where possible
- Monitor RAM usage — FiveM can be memory-intensive
- Use NVMe SSD for faster resource loading
- Regularly update server artifacts
For servers with 64+ players, we recommend at least 8GB RAM and 6 CPU cores.
Related Articles
How to Set Up a Minecraft Server: Paper Installation Guide
Complete Minecraft server setup guide on REXE VDS: Paper/Spigot installation, Java configuration, plugin management, and performance optimization for stable gameplay.
How to Set Up a CS2 Dedicated Server: Complete Guide
Complete CS2 dedicated server setup guide on REXE VDS: SteamCMD installation, GSLT token, server configuration, game modes, and DDoS protection with Path Panel.
How to Set Up a Rust Server: Oxide Plugin Guide
Complete Rust dedicated server setup guide on REXE VDS: SteamCMD installation, Oxide/uMod plugin system, server configuration, performance tuning, and wipe management.