How to Set Up a FiveM Server on a VPS in 2026 (The Real Way)
I ran a FiveM RP server before I started Galaxy Cloud Solutions. So when I built a one-click FiveM installer for our hosting platform, I thought it would take a few hours. It took most of a night. Not because FiveM is complicated — it's not — but because there are a handful of things that the official docs gloss over that will absolutely wreck you if you don't know about them.
This guide is the result of actually doing it on a fresh Ubuntu 24.04 VPS in 2026. Not copying a tutorial from 2021. Not guessing. Actually doing it, hitting the walls, and figuring out what works.
⚡ Want a FiveM server without the setup? We have a one-click installer — from $10/mo, use code LAUNCH2026 for 50% offWhat You Actually Need
Before anything else, let's get the requirements right because the docs undersell them:
- RAM: 2GB absolute minimum, 4GB recommended. Don't try to run QBCore on 1GB — it won't work.
- CPU: This is the part nobody talks about. FiveM's Linux server build requires x86-64-v2 CPU instructions (specifically POPCNT). If you're running on a KVM hypervisor, make sure your CPU type is set to
hostnotkvm64. kvm64 doesn't expose these instructions and FiveM will refuse to start with a cryptic error message. - OS: Ubuntu 22.04 or 24.04. FiveM's Linux server is built against musl libc in an Alpine Linux proot environment. It works on Ubuntu. It does not work well on Rocky Linux or AlmaLinux without extra work.
- A Cfx.re license key: Free from keymaster.fivem.net. You need this before your server will authenticate.
The CPU Type Problem (Read This First)
This tripped me up for longer than I'd like to admit. FiveM's server binary is compiled to use x86-64-v2 instructions. Most modern CPUs support this. But if you're on a VPS using KVM virtualization, the hypervisor might be presenting a kvm64 CPU type to your VM by default — and kvm64 deliberately omits some of these instruction sets for compatibility reasons.
The fix is simple once you know about it: your hypervisor needs to pass through the host CPU type instead of kvm64. On Proxmox, that's cpu: host in the VM config. On other platforms, look for "CPU type" or "CPU model" in your VM settings and switch it to "host passthrough" or equivalent.
If you skip this and try to run FiveM, you'll get an error like:
The Cfx.re Platform Server requires support for x86-64-v2 instructions (such as POPCNT).
You seem to be running on QEMU/KVM using the 'kvm64' CPU type.
At least that error is descriptive. Some of the other ones aren't.
Step 1 — Install Dependencies
apt update && apt upgrade -y
apt install -y git wget xz-utils mariadb-server curl screen unzip
You also need proot. FiveM's Linux server runs inside an Alpine Linux container using proot. Ubuntu doesn't have proot in its repos (at least not a version that works well), so download the static binary:
curl -L https://proot.gitlab.io/proot/bin/proot -o /usr/local/bin/proot
chmod +x /usr/local/bin/proot
Step 2 — Create a FiveM User
Don't run the server as root. Create a dedicated user:
useradd -m -s /bin/bash fivem
Step 3 — Set Up MariaDB
QBCore needs a database. MariaDB is the standard choice:
systemctl enable mariadb
systemctl start mariadb
mysql -u root -e "CREATE DATABASE fivem CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -u root -e "CREATE USER 'fivemuser'@'localhost' IDENTIFIED BY 'your_strong_password';"
mysql -u root -e "GRANT ALL PRIVILEGES ON fivem.* TO 'fivemuser'@'localhost';"
mysql -u root -e "FLUSH PRIVILEGES;"
Step 4 — Download FiveM Server Artifacts
The recommended version URL is the one to use — it gets you a stable build that Cfx.re actually supports:
mkdir -p /home/fivem/server /home/fivem/server-data
cd /home/fivem/server
DOWNLOAD_URL=$(curl -sL https://changelogs-live.fivem.net/api/changelog/versions/linux/server | python3 -c "import sys,json; print(json.load(sys.stdin)['recommended_download'])")
wget -q "$DOWNLOAD_URL" -O fx.tar.xz
tar xf fx.tar.xz --strip-components=1
rm fx.tar.xz
recommended_download, not latest_download, for better stability.
Step 5 — Install QBCore and oxmysql
QBCore is the most popular FiveM framework. oxmysql is the database connector it requires:
cd /home/fivem/server-data
# Clone QBCore
git clone https://github.com/qbcore-framework/qb-core resources/qb-core
# Download oxmysql release build (not the source repo)
wget -q https://github.com/overextended/oxmysql/releases/latest/download/oxmysql.zip -O /tmp/oxmysql.zip
mkdir -p /tmp/oxmysql_tmp
unzip -q /tmp/oxmysql.zip -d /tmp/oxmysql_tmp
mv /tmp/oxmysql_tmp/oxmysql resources/oxmysql
rm -rf /tmp/oxmysql_tmp /tmp/oxmysql.zip
# Get the default cfx-server-data resources
git clone --quiet https://github.com/citizenfx/cfx-server-data.git /tmp/cfx-data
cp -r /tmp/cfx-data/resources/* resources/
rm -rf /tmp/cfx-data
git clone. The git repo is source code — it doesn't have the compiled dist files that FiveM needs to run it.
Step 6 — Create server.cfg
cat > /home/fivem/server-data/server.cfg << 'EOF'
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
sv_licenseKey "YOUR_LICENSE_KEY_HERE"
sv_maxClients 32
sv_hostname "My QBCore Server"
set mysql_connection_string "mysql://fivemuser:your_password@localhost/fivem?charset=utf8mb4"
sets txAdminServerMode true
EOF
ensure lines for resources here. When you run in txAdmin mode (sets txAdminServerMode true), txAdmin manages which resources start. If you add ensure lines AND run in txAdmin mode, you'll get conflicts.
Step 7 — Create the Systemd Service
Here's where most guides go wrong. The standard advice is to use run.sh +exec server.cfg. Don't do that if you want txAdmin to work. txAdmin needs to be launched without +exec — it manages the server startup itself.
Also, because FiveM runs inside a proot Alpine container, the working directory and binary paths need to be set correctly:
cp -r /home/fivem/server/opt/cfx-server /opt/cfx-server
chown -R fivem:fivem /opt/cfx-server
cat > /etc/systemd/system/fivem.service << 'EOF'
[Unit]
Description=FiveM QBCore Server
After=network.target mariadb.service
[Service]
User=fivem
WorkingDirectory=/opt/cfx-server
ExecStart=/usr/local/bin/proot \
-r /home/fivem/server \
-b /home/fivem/server-data:/server-data \
-b /home/fivem/server-data/resources:/opt/cfx-server/resources \
-b /dev -b /proc -b /sys \
-b /etc/resolv.conf \
-w /opt/cfx-server \
/opt/cfx-server/FXServer \
+set txAdminPort 40120 \
+set txAdminInterface 0.0.0.0 \
+set serverProfile default
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable fivem
systemctl start fivem
Step 8 — Open Firewall Ports
ufw allow 30120/tcp
ufw allow 30120/udp
ufw allow 40120/tcp
Port 30120 is the game port players connect to. Port 40120 is the txAdmin web panel.
Step 9 — Complete txAdmin Setup
Once the service is running, check the logs for the txAdmin PIN:
journalctl -u fivem -f
You'll see something like:
[tx] ╔══════════════════════════════════════╗
[tx] ║ All ready! Please access: ║
[tx] ║ http://your-ip:40120/ ║
[tx] ║ Use the PIN below to register: ║
[tx] ║ 1234 ║
[tx] ╚══════════════════════════════════════╝
Open that URL in your browser, enter the PIN, and txAdmin will walk you through the rest. When it asks for the server data path, enter /server-data/.
Things That Will Break and How to Fix Them
Server won't start — "Ctrl-C pressed in server console"
This happens when txAdmin detects that stdin is closed and interprets it as a shutdown signal. Make sure you're launching with +set txAdminServerMode true in server.cfg and NOT passing +exec on the command line. txAdmin mode and exec mode conflict.
License key rate limiting (HTTP 429)
If your server has been restarting repeatedly, Cfx.re will temporarily rate limit the license key check. Just wait 5-10 minutes before trying again. This usually happens during setup when you're tweaking things and restarting constantly.
"Couldn't find resource qb-core"
Two possible causes: either the QBCore clone failed, or you have ensure [qb-core] with brackets in server.cfg. Brackets in resource names indicate a resource category folder, not the resource itself. Use ensure qb-core without brackets.
oxmysql warning about missing fxmanifest.lua
You cloned the oxmysql source repo instead of downloading the release. The release ZIP contains the compiled dist/ folder with the actual resource files. Always use the release download from GitHub.
My Honest Take on Hosting FiveM Yourself
Running a FiveM server yourself is very doable — I did it before I started this hosting business and it was a good learning experience. The things that will actually take your time aren't the setup steps above. They're the ongoing stuff: keeping QBCore updated when new releases break things, managing the database as it grows, dealing with the occasional server crash at 2am.
If you just want to run an RP server with your friends and don't want to mess with any of this, we have a one-click FiveM QBCore installer at Galaxy Cloud Solutions. It handles everything in this guide automatically — MariaDB setup, QBCore installation, txAdmin configuration, firewall rules. You get an email with your txAdmin URL and PIN when it's done. The Nebula 2 plan at $10/mo is the sweet spot for a small server.
One-click FiveM QBCore from $10/mo
We built a one-click installer that handles everything in this guide automatically. Ubuntu 24.04, MariaDB, QBCore, txAdmin, all configured and running. You get an email with your txAdmin URL and PIN when it's ready. Use code LAUNCH2026 for 50% off your first month.
Get Started