How to set up a FiveM server on a VPS with txAdmin (2026)

Install FXServer with txAdmin on a Debian or Ubuntu VPS: download, MariaDB, a systemd service, ports in UFW and the PIN. Plus Windows Server.

EliteStarHosting Team4 December 20265 min read
FiveM server hosting from €5 a month: view the plans

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

  1. Follow the log with sudo journalctl -u fivem -f. Below Use the PIN below to register: you see a PIN.
  2. Open http://YOUR_VPS_IP:40120 with your VPS's IP address, enter the PIN and click Link Account to sign in with your Cfx.re account.
  3. Choose a password and a recipe under Popular Recipes, as in ESX, QBCore or Qbox.
  4. Paste your license key in Server Registration Key. Under Show/Hide Database options (advanced), fill in Database Host 127.0.0.1 (not localhost: the user only exists for that address), Database Username fivem, Database Password and Database Name fivem. Keep the key and password secret, also in screenshots.
  5. 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

  1. Connect with Remote Desktop and install 7-Zip, plus MariaDB from mariadb.org if you use a framework.
  2. On the Server Download page, choose Windows, download server.7z and unpack it into C:\FXServer\server.
  3. 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.
  4. 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 fivem that the service runs, and with sudo ufw status that 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 30120 opens both.
  • Database error during the recipe, such as ER_ACCESS_DENIED_ERROR: check the user and password, and use 127.0.0.1 as 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.

The Tx Admin button at the top of your server page

Your own server for this? FiveM server hosting from €5 a month.

Online within minutes, DDoS protection included, no contract.