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.
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
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.