Logo

Deploy a FiveM server with txAdmin from scratch

Deploy a FiveM server with txAdmin from scratch

Complete guide to install a FiveM server (GTA V Roleplay) with the txAdmin admin panel on a VeryCloud Linux VPS. Covers artifact installation, license creation, MySQL configuration and security.

Introduction

FiveM is the most popular multiplayer mod for GTA V, used by 90% of Roleplay servers. txAdmin is the official web interface that lets you administer the server, manage resources, monitor players and deploy backups in one click.

This guide installs a standalone FiveM server on a Linux VPS (recommended: Ryzen VPS with 4-8 GB RAM).

Prerequisites

  • Debian 12 or Ubuntu 22.04+ VPS at VeryCloud
  • Minimum 4 GB RAM, 8 GB recommended for 32+ players
  • Root access via SSH
  • A Cfx.re license (free, created below)
  • Stable DNS connection

Step 1: Update and dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install -y xz-utils curl wget screen git unzip mariadb-server

Step 2: Create a dedicated user

Never run FiveM as root:

sudo useradd -m -s /bin/bash fivem
sudo passwd fivem
sudo su - fivem

Step 3: Download FiveM artifacts

Go to https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/ and copy the URL of the latest recommended build.

mkdir -p ~/server && cd ~/server
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/XXXX-XXXX/fx.tar.xz
tar xf fx.tar.xz
rm fx.tar.xz

Replace XXXX-XXXX with the build number (e.g. 8761-abc123def).

Step 4: Create the server-data folder

mkdir -p ~/server-data
cd ~/server-data
git clone https://github.com/citizenfx/cfx-server-data.git .

This repo contains the default resources needed by the server (chat, sessionmanager, spawnmanager, etc.).

Step 5: Configure the database

Switch back to root and configure MariaDB:

sudo mysql_secure_installation

Answer the questions (MariaDB root password, remove anonymous users, etc.).

Create the database and user:

sudo mysql -u root -p
CREATE DATABASE fivem CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'fivem'@'localhost' IDENTIFIED BY 'SecurePassword!';
GRANT ALL PRIVILEGES ON fivem.* TO 'fivem'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 6: Get a Cfx.re license

Go to: https://keymaster.fivem.net

Log in (Discord account or FiveM Forum), then + New Server Key:

  • Server Hostname: my-server.com or your VPS IP
  • Server Type: Server-side (most cases)

You get a key like XXXXXXXX.XXXXXXXX.XXXXXXXX.XXXX. Keep it safe.

Step 7: First launch with txAdmin

Switch back to the fivem user:

sudo su - fivem
cd ~/server-data
~/server/run.sh

txAdmin displays in the console with a temporary config URL, like:

http://YOUR_VPS_IP:40120/addMaster/pin?pin=XXXX

Open it in your browser. If you're behind a firewall, open port 40120:

sudo ufw allow 40120/tcp
sudo ufw allow 30120/tcp  # default FiveM port
sudo ufw allow 30120/udp

Step 8: Configure txAdmin via the browser

The interface guides you:

  1. PIN: enter the one shown in the console
  2. Cfx.re account: log in (recommended) or create a local account
  3. New server:
    • Name: MyServer RP
    • Template: choose qbcore or esx depending on the framework, or vMenu for minimalist freeroam
  4. Server data folder: /home/fivem/server-data
  5. License key: paste the Cfx.re key from step 6
  6. Database: localhost, port 3306, user fivem, password, database fivem

txAdmin automatically downloads and configures the chosen framework's resources.

Step 9: Start the server

In the txAdmin interface: click Start Server. The server boots in 30-60 seconds.

You see live logs. The server is now accessible:

  • F8 in GTA V: connect YOUR_VPS_IP
  • Or via the public list if enabled

Step 10: Configure the systemd service

So FiveM auto-starts and auto-restarts on crash, create a systemd service:

sudo nano /etc/systemd/system/fivem.service

Content:

[Unit]
Description=FiveM Server (txAdmin)
After=network.target mariadb.service

[Service]
Type=simple
User=fivem
WorkingDirectory=/home/fivem/server-data
ExecStart=/home/fivem/server/run.sh
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

Enable:

sudo systemctl daemon-reload
sudo systemctl enable --now fivem
sudo systemctl status fivem

Step 11: Secure txAdmin

Port 40120 is publicly exposed by default. Restrict it to your fixed IP:

sudo ufw delete allow 40120/tcp
sudo ufw allow from YOUR_FIXED_IP to any port 40120

Or expose it behind an Nginx reverse proxy with SSL:

server {
    listen 80;
    server_name admin.my-server.com;

    location / {
        proxy_pass http://127.0.0.1:40120;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
}

Then add SSL with Certbot (see Nginx Proxy Manager guide).

Step 12: Back up regularly

Create a backup script:

sudo nano /usr/local/bin/backup-fivem.sh
#!/bin/bash
BACKUP_DIR=/backup/fivem
DATE=$(date +%F_%H%M)
mkdir -p $BACKUP_DIR

# Backup data + resources
tar -czf $BACKUP_DIR/server-data-$DATE.tar.gz /home/fivem/server-data

# Backup database
mysqldump -u fivem -p'SecurePassword!' fivem | gzip > $BACKUP_DIR/db-$DATE.sql.gz

# Keep 7 days
find $BACKUP_DIR -mtime +7 -delete
sudo chmod +x /usr/local/bin/backup-fivem.sh
sudo crontab -e
0 4 * * * /usr/local/bin/backup-fivem.sh

Troubleshooting

"Couldn't load resource: chat / spawnmanager / etc."

The server-data folder is incomplete. Re-clone:

cd ~/server-data
git pull origin master

"MySQL connection refused" error

Check MariaDB status:

sudo systemctl status mariadb

And credentials in txAdmin config.

Server not visible in public list

Check server.cfg:

sets sv_listingHostOverride "PUBLIC_IP:30120"
sv_lan false

Cfx.re 401 (License invalid)

Check that the license matches the VPS IP (on keymaster.fivem.net). Otherwise, create a new key with the correct IP.

Useful commands

# Service status
sudo systemctl status fivem

# Live logs
sudo journalctl -u fivem -f

# Restart
sudo systemctl restart fivem

# Update FiveM artifacts
cd ~/server
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/XXXX-XXXX/fx.tar.xz
tar xf fx.tar.xz && rm fx.tar.xz
sudo systemctl restart fivem

# txAdmin live console
# (via web panel → Live Console)

# List installed resources
ls ~/server-data/resources/[local]

Conclusion

Your FiveM server is now operational with txAdmin. Typical next steps:

  • Install Roleplay resources (qb-core, ESX, vMenu, etc.)
  • Configure Discord whitelist for access control
  • Set up an anti-cheat (BadgerLogs, FiveGuard)
  • Optimize performance with OneSync enabled for 32+ players

For turn-key installations with support, VeryCloud offers dedicated FiveM Gaming plans with pre-installed txAdmin on panel.verycloud.fr.

Resources

Join our Discord community server

For any questions, suggestions, or just to chat with the community, join us on Discord!

900+Members