LOS SANTOS HQ ๐Ÿ”ฅ Flash Sale: 20% Off All In-House Assets โ€” Code: LOS_SANTOS_20 • 0.00ms Resmon Standard
Discord HQ
Server Hosting & txAdmin โ˜… STUDIO MASTERCLASS

The Ultimate Guide to Setting Up a FiveM Server on Ubuntu 24.04 LTS (txAdmin & MariaDB)

โœ๏ธ By RolePlay.ly DevOps Lead (Senior FiveM Developer) • ๐Ÿ“… July 17, 2026 • โฑ๏ธ 10 min read • ๐Ÿ‘๏ธ 2,514 views
The Ultimate Guide to Setting Up a FiveM Server on Ubuntu 24.04 LTS (txAdmin & MariaDB)

Deploying a production FiveM roleplay server on Linux (Ubuntu 24.04 LTS) offers significant performance improvements over Windows Server, including lower memory overhead, reduced kernel latency, and vastly superior uptime. In this comprehensive guide, we walk you through provisioning your server from a clean terminal to a live FiveM server running txAdmin.

1. Server Hardware & Operating System Prerequisites

Before installing server dependencies, ensure your dedicated server or VPS satisfies the minimum production requirements for a 64+ player community:

  • CPU: 4+ Cores with high single-thread clock speed (AMD Ryzen 5800X / 7900X or Intel Core i7/i9 13th+ Gen recommended).
  • RAM: 16 GB DDR4/DDR5 minimum (32 GB recommended for servers running 200+ resource streams).
  • Storage: NVMe SSD with at least 80 GB available space for assets, cache, and daily SQL backups.
  • Network: 1 Gbps uplink with built-in Layer 4/Layer 7 DDoS protection.
Studio Pro-Tip: Never run your FiveM server as the root user. Always create a dedicated unprivileged user (e.g. fivem) with its own home directory to isolate game server processes.

2. Updating System Packages & Installing Core Dependencies

Connect to your server via SSH and execute the following system update and dependency installation commands:

# Update package index and system components
sudo apt update && sudo apt upgrade -y

# Install essential network, build and archive utilities
sudo apt install -y curl git wget tar htop screen libunwind8 libssl-dev software-properties-common

# Create a dedicated non-root user
sudo useradd -m -s /bin/bash fivem
sudo passwd fivem
sudo usermod -aG sudo fivem

3. Installing & Hardening MariaDB 11 for High-Concurrency FiveM

Most modern frameworks (QBCore, ESX Legacy, Qbox) rely heavily on oxmysql. MariaDB 11 provides native async query caching and exceptional connection pool performance.

# Install MariaDB Server
sudo apt install -y mariadb-server mariadb-client

# Run security hardening script
sudo mysql_secure_installation

# Create FiveM database and dedicated user
sudo mysql -u root -p

Inside the MySQL terminal prompt, execute the following configuration:

CREATE DATABASE fivem_server CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'fivem_user'@'127.0.0.1' IDENTIFIED BY 'YourUltraSecurePassword2026!';
GRANT ALL PRIVILEGES ON fivem_server.* TO 'fivem_user'@'127.0.0.1';
FLUSH PRIVILEGES;
EXIT;

4. Downloading FiveM Server Artifacts & txAdmin

Switch to the fivem user and retrieve the latest recommended FiveM server artifacts from the official Cfx.re build directory:

su - fivem
mkdir -p ~/fivem-server/alpine
cd ~/fivem-server/alpine

# Download latest recommended artifact (Check runtime.fivem.net for latest build)
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/latest_recommended.tar.xz
tar -xvf latest_recommended.tar.xz
rm latest_recommended.tar.xz

5. Creating the Systemd Auto-Restart Service

To guarantee your server boots automatically after host reboots and restarts if unexpected crashes occur, create a systemd service file at /etc/systemd/system/fivem.service:

[Unit]
Description=FiveM Dedicated Roleplay Server with txAdmin
After=network.target mariadb.service

[Service]
Type=simple
User=fivem
WorkingDirectory=/home/fivem/fivem-server
ExecStart=/home/fivem/fivem-server/alpine/run.sh
Restart=on-failure
RestartSec=10s
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target

Enable and start the service with systemctl:

sudo systemctl daemon-reload
sudo systemctl enable fivem.service
sudo systemctl start fivem.service
Caution: Make sure port 40120 (txAdmin Web Portal) and port 30120 (FiveM Server TCP & UDP) are opened in your firewall (ufw allow 30120 && ufw allow 40120/tcp).

6. Completing the txAdmin Web Setup Wizard

Open your browser and navigate to http://YOUR_SERVER_IP:40120/. Look up the initial 4-digit PIN generated in the terminal logs via journalctl -u fivem -f. Follow the on-screen setup wizard to connect your Cfx.re account, select your recipe (QBCore or CFX Default), and configure your database string.

Conclusion

Your Linux FiveM server is now running on a rock-solid, production-grade foundation. In the next chapter of this series, we will examine tuning server.cfg network buffer convars to eliminate voice lag and desync.

V

Written by RolePlay.ly DevOps Lead

Senior engineering lead at RolePlay.ly Studios. Specializing in FiveM server architecture, 0.00ms resmon optimization, and QBCore/ESX framework bridges.

← Back to All Guides
Recommended Next Guides

Related FiveM Tutorials

Continue mastering Server Hosting & txAdmin with our companion articles

All Server Hosting & txAdmin Guides