On a VPS you install and maintain FXServer, FiveM's server software, yourself: here on Debian or Ubuntu with txAdmin and MariaDB, and briefly on Windows Server 2022. Cfx.re offers the Linux version as a courtesy port: problems are more likely to get fixed on Windows.
First connect with SSH and follow Secure your new Linux VPS, so you work as a user with sudo and UFW is on.
Download FXServer
A separate user keeps a bad script away from the rest of your VPS:
sudo apt update
sudo apt install curl xz-utils
sudo useradd --system --create-home --home-dir /opt/fivem --shell /bin/bash fivem
sudo -iu fivem
mkdir server && cd server
On the Server Download page, choose FiveM / RedM, Linux and Recommended, right-click Download and copy the link. In December 2026, build 38435 is the recommended version, with txAdmin 8.1.2:
curl -O https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/38435-5c3065c261fb3ba82032fee6803f247198fec221/fx.tar.xz
tar xf fx.tar.xz
exit
A database with MariaDB
sudo apt install mariadb-server
sudo mariadb
Create a database and a user with a long password of only letters and digits:
CREATE DATABASE fivem CHARACTER SET utf8mb4;
CREATE USER 'fivem'@'127.0.0.1' IDENTIFIED BY 'YourLongPassword';
GRANT ALL PRIVILEGES ON fivem.* TO 'fivem'@'127.0.0.1';
exit
MariaDB only listens on the VPS itself, so keep port 3306 closed. Qbox needs MariaDB 10.9 or newer. Ubuntu 22.04 ships 10.6, Debian 12 and Ubuntu 24.04 ship 10.11.
A systemd service
Create the file with sudo nano /etc/systemd/system/fivem.service:
[Unit]
Description=FiveM server with txAdmin
After=network.target mariadb.service
[Service]
User=fivem
WorkingDirectory=/opt/fivem
Environment=TXHOST_DATA_PATH=/opt/fivem/txData
ExecStart=/bin/bash /opt/fivem/server/run.sh
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Without +exec server.cfg, FXServer starts txAdmin, which keeps everything in /opt/fivem/txData. Turn on the service and open the ports:
sudo systemctl enable --now fivem
sudo ufw allow 30120 comment 'FiveM'
sudo ufw allow from YOUR_HOME_IP to any port 40120 proto tcp comment 'txAdmin'
30120 is the game port (TCP and UDP). txAdmin on 40120 uses plain HTTP, so open that port only for your own IP address at home: fill it in where it says YOUR_HOME_IP. See also UFW.
Setting up txAdmin
- Follow the log with
sudo journalctl -u fivem -f. BelowUse the PIN below to register:you see a PIN. - Open
http://YOUR_VPS_IP:40120with your VPS's IP address, enter the PIN and click Link Account to sign in with your Cfx.re account. - Choose a password and a recipe under Popular Recipes, as in ESX, QBCore or Qbox.
- Paste your license key in Server Registration Key. Under Show/Hide Database options (advanced), fill in Database Host
127.0.0.1(notlocalhost: the user only exists for that address), Database Usernamefivem, Database Password and Database Namefivem. Keep the key and password secret, also in screenshots. - Click Run Recipe, then Next and Save & Run Server.
Players connect with connect YOUR_VPS_IP:30120 in the F8 console.
Updating FXServer
Run sudo systemctl stop fivem and sudo rm -rf /opt/fivem/server, repeat the download step from sudo -iu fivem with the newest link and run sudo systemctl start fivem. Your server stays in txData.
Windows Server 2022 in short
- Connect with Remote Desktop and install 7-Zip, plus MariaDB from mariadb.org if you use a framework.
- On the Server Download page, choose Windows, download
server.7zand unpack it intoC:\FXServer\server. - Double-click
FXServer.exe. txAdmin opens in your browser with the PIN filled in: click Link Account and continue as above, with your own MariaDB details. - Open port 30120 for TCP and UDP in Windows Firewall, as in the Remote Desktop guide.
You open txAdmin on the VPS itself at http://localhost:40120, so 40120 stays closed. After a VPS restart, start FXServer.exe again.
Troubleshooting
- txAdmin doesn't open: check with
sudo systemctl status fivemthat the service runs, and withsudo ufw statusthat the rule for 40120 still has your current home IP address. That address can change. - No PIN in the log: an admin already exists in
txData. Log in with your Cfx.re account or your txAdmin password. - Players can't connect: port 30120 must be open for TCP and UDP.
sudo ufw allow 30120opens both. - Database error during the recipe, such as
ER_ACCESS_DENIED_ERROR: check the user and password, and use127.0.0.1as the host. - The service keeps restarting: read the last lines with
sudo journalctl -u fivem -n 100. See also FiveM server errors in the console.
When our FiveM hosting is easier
On a VPS, updates, security, backups and FXServer versions are your job. Rather not do that yourself? Our FiveM server hosting starts at €5 a month: txAdmin is ready behind the Tx Admin button, you create a database under Databases and you pick a new FXServer version under Artifacts. A VPS fits if you want full control or several services on one machine, such as a website or Discord bot.
