FiveM Dedicated Server Setup Guide 2025
Setting up your own FiveM dedicated server allows you to create a custom GTA V roleplay experience. This guide covers installation, configuration, and optimization for a smooth multiplayer server.
📋 Quick Overview
- Server Requirements: Windows or Linux, 8-64GB RAM depending on player count
- Framework: ESX or QBCore (recommended)
- Management: txAdmin web panel included
- Database: MySQL for persistent player data
- License: Free Cfx.re key for non-commercial use
Prerequisites
Hardware Requirements
| Component | Minimum (32 players) | Recommended (64+ players) |
|---|---|---|
| CPU | 4 cores @ 3.0 GHz | 8 cores @ 3.5 GHz |
| RAM | 8 GB | 32 GB |
| Storage | 100 GB SSD | 200 GB NVMe SSD |
| Network | 100 Mbps upload | 1 Gbps upload |
| OS | Windows 10/11 64-bit | Windows Server 2019/2022 or Ubuntu 22.04 LTS |
Software Prerequisites
- GTA V: Legitimate copy of Grand Theft Auto V (Steam or Epic Games)
- FiveM Account: Free account at Cfx.re Keymaster
- MySQL Server: For player data and economy (optional for testing, required for production)
- Git: For cloning framework repositories
Step 1: Obtain Cfx.re License Key
- Visit Cfx.re Keymaster
- Create a free account or log in
- Navigate to "Servers"
- Click "New Server"
- Enter server name and select "Non-Commercial" (free)
- Copy your Server License Key
Commercial License: For monetized servers, you'll need a commercial license. Follow the licensing guidelines at fivem.net/license.
Step 2: Download FiveM Server Files
Windows Installation
- Download the latest FiveM Artifact from Cfx.re Artifacts
- Extract to a dedicated folder (e.g.,
C:\FiveMServer) - Run
FXServer.exeonce to generate initial files - Close the server when prompted
Linux Installation (Ubuntu/Debian)
# Create server directory
mkdir ~/fivemserver
cd ~/fivemserver
# Download latest FiveM artifact
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/fx.tar.xz
# Extract files
tar -xvf fx.tar.xz
mv fx.tar.xz server/
Step 3: Configure txAdmin
txAdmin is included with FiveM and provides a web-based management panel.
- Navigate to your FiveM server directory
- Locate
txAdminfolder - Edit
txAdmin/data/config.json:
{
"licenseKey": "YOUR_LICENSE_KEY_HERE",
"serverName": "My FiveM Server",
"locale": "en",
"masterAccount": "your_email@example.com"
}
- Start the server:
FXServer.exe - Open browser to
http://localhost:40120 - Complete txAdmin setup wizard
- Set your admin username and password
txAdmin Features
- Server start/stop/restart
- Player management and bans
- Console and log viewer
- Resource management
- Automated backups
- Performance monitoring
Step 4: Install a Roleplay Framework
Option A: ESX Framework (Recommended for Beginners)
# Navigate to resources directory
cd ~/fivemserver/server/resources
# Clone ESX framework
git clone https://github.com/ESX-Org/esx_legacy.git [esx]
# Clone additional ESX resources
git clone https://github.com/ESX-Org/esx_policejob.git [esx]/policejob
git clone https://github.com/ESX-Org/esx_ambulancejob.git [esx]/ambulancejob
Option B: QBCore Framework (Recommended for Advanced Users)
# Navigate to resources directory
cd ~/fivemserver/server/resources
# Clone QBCore framework
git clone https://github.com/qbcore-framework/qb-core.git [qbcore]
# Clone QBCore resources
git clone https://github.com/qbcore-framework/qb-clothing.git [qbcore]/clothing
git clone https://github.com/qbcore-framework/qb-vehicleshop.git [qbcore]/vehicleshop
Step 5: Configure server.cfg
Edit the server.cfg file in your FiveM directory:
# Only change the IP if you're using a VPN
setr sv_hostname "My FiveM Roleplay Server"
set sv_maxplayers 64
set sv_licensekey "YOUR_LICENSE_KEY_HERE"
# Add your framework
ensure [esx]
ensure [qbcore]
# Add essential resources
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure fivem
# Add custom resources
ensure [esx]/esx_policejob
ensure [esx]/esx_ambulancejob
Step 6: Set Up MySQL Database
Windows MySQL Setup
- Download and install MySQL Community Server
- During installation, set root password
- Create a database for FiveM:
mysql -u root -p
CREATE DATABASE fivem CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'fivemuser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON fivem.* TO 'fivemuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Import Database Schema
- Locate your framework's SQL schema file
- For ESX:
[esx]/esx_legacy/database.sql - For QBCore:
[qbcore]/qb-core/database.sql - Import into your database using MySQL Workbench or CLI:
mysql -u fivemuser -p fivem < database.sql
Configure Database Connection
Edit your framework's database configuration file (usually config.lua):
Config.Mysql = {
Host = 'localhost',
Database = 'fivem',
User = 'fivemuser',
Password = 'your_password',
Port = 3306
}
Step 7: Launch the Server
Windows Launch
Create a batch file start_server.bat:
@echo off
cd C:\FiveMServer
start cmd /k FXServer.exe +exec server.cfg
pause
Linux Launch
Create a shell script start_server.sh:
#!/bin/bash
cd ~/fivemserver
./run.sh +exec server.cfg
Start the server and open your browser to http://your-server-ip:40120 to access txAdmin.
Step 8: Configure Firewall & Port Forwarding
Windows Firewall
New-NetFirewallRule -DisplayName "FiveM UDP 30120" -Direction Inbound -LocalPort 30120 -Protocol UDP -Action Allow
New-NetFirewallRule -DisplayName "FiveM TCP 40120" -Direction Inbound -LocalPort 40120 -Protocol TCP -Action Allow
Linux Firewall (UFW)
sudo ufw allow 30120/udp
sudo ufw allow 40120/tcp
sudo ufw allow 3306/tcp # MySQL (if hosting locally)
sudo ufw enable
Router Port Forwarding
| Port | Protocol | Purpose |
|---|---|---|
| 30120 | UDP | Game Port |
| 40120 | TCP | txAdmin Web Panel |
Essential First Steps
- Set Admin Password: In txAdmin, create your first admin account
- Configure Economy: Set starting money and job salaries
- Add Jobs: Configure police, EMS, and civilian jobs
- Set Up Vehicles: Add spawn points for vehicles
- Configure Chat: Set up roleplay chat channels
Optimization Tips
- OneSync: Enable OneSync in server.cfg for better performance with 64+ players
- Stream Distance: Adjust entity streaming distance in framework config
- Resource Management: Remove unused resources to reduce RAM usage
- Database Indexing: Ensure database tables are properly indexed
- Regular Backups: Schedule automated database backups via txAdmin
Next Steps
- View detailed server requirements
- Compare ESX vs QBCore frameworks
- Install essential resources
- Optimize server performance
Need Help? Supercraft offers managed FiveM hosting with txAdmin pre-configured, MySQL database included, and expert support available 24/7.