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
rootorsudoaccess. - 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)
- Create a dedicated directory for your FiveM server files:
mkdir -p /home/fivem/server && cd /home/fivem/server - Visit the FiveM Linux Artifacts Repository to copy the URL of the latest Recommended build.
- 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
- Start FXServer from your server directory:
cd /home/fivem/server && ./run.sh - 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. - Open a browser and navigate to:
http://YOUR_VPS_IP:40120/ - Enter the 4-digit PIN displayed in your terminal.
- Click Link Account to log in with your Cfx.re Forum account.
- 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.
- 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:
- Stop the current running console session (
CTRL + C). - Create a systemd service file:
sudo nano /etc/systemd/system/fivem.service - 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 - Save and close (
CTRL + O,Enter,CTRL + X). - Reload systemd daemon, enable, and start FiveM:
sudo systemctl daemon-reload sudo systemctl enable fivem sudo systemctl start fivem - 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!
