Tutorial
How to install a FiveM server on a Linux VPS
Published on · updated on · 2 min read
What is FiveM?
FiveM is a multiplayer framework for GTA V allowing you to create roleplay servers. It's the most popular platform for GTA V RP, with millions of active players.
Prerequisites
- A Linux VPS with at least 4 GB of RAM (8 GB recommended for an RP server)
- Root SSH access
- Free FiveM license from keymaster.fivem.net
- A legal copy of GTA V
Step 1: SSH connection and update
Connect to your VPS:
ssh root@YOUR_IPUpdate the system:
apt update && apt upgrade -y
apt install -y curl wget git xz-utils screenStep 2: Create a dedicated user
Never run FiveM as root:
useradd -m -s /bin/bash fivem
su - fivem
mkdir -p ~/FiveM/server-data
cd ~/FiveMStep 3: Download FiveM artifacts
On the runtime.fivem.net/artifacts/fivem/build_proot_linux/master page, copy the link of the latest recommended build, then:
wget -O fx.tar.xz COPIED_LINK
tar xf fx.tar.xz
rm fx.tar.xzStep 4: Download cfx-server-data
cd server-data
git clone https://github.com/citizenfx/cfx-server-data.git .Step 5: Create server.cfg
nano server.cfgBasic content:
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
start mapmanager
start chat
start spawnmanager
start sessionmanager
start basic-gamemode
start hardcap
sv_scriptHookAllowed 0
sv_hostname "My FiveM Server - VexCloud"
sv_maxclients 32
sv_licenseKey "YOUR_LICENSE_KEY"Replace YOUR_LICENSE_KEY with the key from keymaster.fivem.net.
Step 6: Open firewall port
ufw allow 30120/tcp
ufw allow 30120/udp
ufw enableStep 7: Start the server
cd ~/FiveM
bash run.sh +exec server-data/server.cfgTo run in background (survives SSH disconnection):
screen -S fivem bash run.sh +exec server-data/server.cfgDetach with Ctrl+A then D. Resume with screen -r fivem.
Join your server
In FiveM on your PC, press F8 and type:
connect YOUR_IP:30120Recommended RP resources
- ESX or QBCore: complete roleplay framework
- oxmysql: MySQL database connection
- ox_lib: utility library
- dpemotes: animations and emotes
Recommended VexCloud configuration
For around thirty players with a few resources: VPS SSD-04 (2 vCPU, 4 GB, NVMe). For an RP server with ESX or QBCore and many scripts: VPS SSD-08 (4 vCPU, 8 GB) or more. A ready-made FiveM filter (port 30120) is available in the DDoS panel, included on every VPS: see DDoS protection for game servers.