Article Background
Back to Knowledgebase

How to Install a FiveM Server with txAdmin on an Ubuntu VPS

VPS
Cubes Support
July 20, 2026

Hosting a FiveM GTA V multiplayer or Roleplay (RP) server on a Cubes Hosting Ubuntu VPS gives you full root control, high single-core CPU performance, custom resource limits, and complete access to txAdmin—the official web-based server management panel for FiveM.

This step-by-step guide will walk you through installing FXServer artifacts, setting up a MariaDB database, opening firewall ports, and configuring txAdmin on Ubuntu 22.04 or 24.04 LTS.


Prerequisites

Before starting, ensure you have:

  • A Cubes Hosting Linux VPS running Ubuntu 22.04 LTS or 24.04 LTS.
  • An SSH client (Terminal, PowerShell, or PuTTY) with root or sudo access.
  • A free Cfx.re License Key from Cfx.re Keymaster.

Step 1: Update System Packages & Install Dependencies

Connect to your VPS via SSH and run the following command to update your system packages and install required dependencies:

sudo apt update && sudo apt upgrade -y
sudo apt install -y curl git jq screen tar xz-utils mariadb-server ufw

Step 2: Configure MariaDB (MySQL Database)

Most FiveM frameworks (like QBCore or ESX Legacy) require a MySQL database to store player inventories, vehicles, and character data.

1. Secure MariaDB Installation:

sudo mysql_secure_installation

(Press Enter for current password, set a root password, and answer Y to all security prompts).

2. Create the FiveM Database & User:

Log in to the MariaDB terminal:

sudo mysql -u root -p

Execute the following SQL commands:

CREATE DATABASE fivem_db;
CREATE USER 'fivem_user'@'localhost' IDENTIFIED BY 'YourStrongPassword123!';
GRANT ALL PRIVILEGES ON fivem_db.* TO 'fivem_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

(Replace YourStrongPassword123! with a secure password).


Step 3: Download and Extract FiveM Server Artifacts (FXServer)

  1. Create a dedicated directory for your FiveM server files:
    mkdir -p /home/fivem/server && cd /home/fivem/server
    
  2. Visit the FiveM Linux Artifacts Repository to copy the URL of the latest Recommended build.
  3. Download and extract the FXServer build:
    # Download FXServer artifacts (replace URL with latest recommended build)
    wget https://runtime.fivem.net/artifacts/fivem/build_progen_linux/master/latest/fx.tar.xz
    
    # Extract the archive
    tar -xvf fx.tar.xz
    

Step 4: Open Firewall Ports (UFW)

FiveM requires specific TCP and UDP ports opened in the firewall for players and txAdmin to connect:

# Allow FiveM game server ports
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp

# Allow txAdmin web panel port
sudo ufw allow 40120/tcp

# Enable UFW firewall if not already active
sudo ufw enable

Step 5: Launch FXServer & Initial txAdmin Setup

  1. Start FXServer from your server directory:
    cd /home/fivem/server && ./run.sh
    
  2. Look at your terminal output. You will see a message similar to:
    [txAdmin] Initialization PIN: 1234
    [txAdmin] Open http://YOUR_VPS_IP:40120/ in your browser to configure txAdmin.
    
  3. Open a browser and navigate to: http://YOUR_VPS_IP:40120/
  4. Enter the 4-digit PIN displayed in your terminal.
  5. Click Link Account to log in with your Cfx.re Forum account.
  6. Set a master password for txAdmin and follow the setup wizard:
    • Server Name: Enter your community server title.
    • Deployment Type: Choose Popular Template (e.g. QBCore Framework, ESX Legacy, or CFX Default).
    • Database Settings: Enter the database details created in Step 2 (Database Name: fivem_db, User: fivem_user, Password: YourStrongPassword123!).
    • License Key: Paste your key from Cfx.re Keymaster.
  7. Click Save & Run Server!

Step 6: Run FiveM 24/7 in the Background (Systemd Service)

To ensure your FiveM server remains online 24/7 and restarts automatically if your VPS reboots:

  1. Stop the current running console session (CTRL + C).
  2. Create a systemd service file:
    sudo nano /etc/systemd/system/fivem.service
    
  3. Paste the following service configuration:
    [Unit]
    Description=FiveM FXServer with txAdmin
    After=network.target mariadb.service
    
    [Service]
    Type=simple
    User=root
    WorkingDirectory=/home/fivem/server
    ExecStart=/home/fivem/server/run.sh
    Restart=on-failure
    KillMode=process
    
    [Install]
    WantedBy=multi-user.target
    
  4. Save and close (CTRL + O, Enter, CTRL + X).
  5. Reload systemd daemon, enable, and start FiveM:
    sudo systemctl daemon-reload
    sudo systemctl enable fivem
    sudo systemctl start fivem
    
  6. Check FiveM server status:
    sudo systemctl status fivem
    

Conclusion

Your FiveM server and txAdmin panel are now running 24/7 on your Cubes Hosting Ubuntu VPS! Access your txAdmin web panel at http://YOUR_VPS_IP:40120 to manage resources, add scripts, inspect player logs, and configure your GTA RP community!

Special Offer

Ready to Start Your Server?

Get 10% OFF your first month on any server with promo code CUBES10 at checkout!

24/7 Assistance

Need Help With Your Server?

Already a Cubes Hosting customer and couldn't find your answer? Our dedicated support team is available 24/7.