New: FiveM Analyzer — Find out what's slowing your server down

How to Set Up a FiveM Server in 2025: Complete Beginner Guide

GoodLeaf TeamMarch 1, 202612 min read
How to Set Up a FiveM Server in 2025: Complete Beginner Guide

Setting up a FiveM server can seem overwhelming if you've never done it before — between server artifacts, txAdmin, framework choices, and configuration files, there's a lot to get right. This guide walks you through the entire process from zero to a running, player-ready FiveM server. No prior server administration experience required.

1. Server Requirements

Before you start, you need to make sure your hosting environment meets FiveM's minimum requirements. Running a FiveM server on underpowered hardware is the number one cause of lag, desync, and crashes.

Minimum Hardware Requirements

  • CPU: A modern processor with strong single-core performance. FiveM is single-threaded, so clock speed matters far more than core count. Aim for 4.0 GHz+ boost clocks.
  • RAM: 4 GB minimum for a basic server (32 slots, light scripts). 8-16 GB recommended for QBCore/ESX servers with custom MLOs and heavy scripts.
  • Storage: 30 GB minimum on an SSD or NVMe drive. HDDs will cause asset loading delays and hitching.
  • Network: A stable connection with at least 10 Mbps upload. For 64+ player servers, 100 Mbps+ is recommended.
  • OS: Windows Server 2016+ or a modern Linux distribution (Ubuntu 20.04+, Debian 11+). Linux is recommended for production servers due to lower overhead.
Info

You'll also need a Cfx.re account and a server license key. These are free — register at keymaster.fivem.net and generate a key linked to your server's IP address.

2. Choosing Where to Host

You have three options: host at home, rent a VPS, or get a dedicated server. Hosting at home is fine for testing, but for a public server you'll run into issues with residential IP bans, DDoS vulnerability, and inconsistent upload speeds.

A VPS (Virtual Private Server) is the sweet spot for most new FiveM communities. You get dedicated resources, a static IP, and DDoS protection at a fraction of the cost of a full dedicated server. Look for a provider that uses high-clock-speed CPUs — since FiveM is single-threaded, a VPS on a Ryzen 9 9950X at 5.7 GHz will dramatically outperform one on a budget Xeon.

Tip

GoodLeaf's VDS plans run on AMD Ryzen 9 9950X processors with NVMe Gen5 storage and Path.net DDoS protection — purpose-built for workloads like FiveM where single-core speed is everything. Check the High-End VDS plans if you want the best possible performance.

3. Installing the FiveM Server

FiveM's server software comes in two parts: the server artifacts (the actual server binary) and txAdmin (the web-based management panel). Recent artifact builds bundle txAdmin automatically, so you only need one download.

Step-by-Step Installation (Linux)

  1. Connect to your server via SSH. Create a directory for your FiveM server: mkdir -p /home/fivem/server && cd /home/fivem/server
  2. Download the latest server artifacts from the FiveM artifacts page. Choose the latest recommended build.
  3. Extract the archive: tar -xf fx.tar.xz
  4. Create a data directory for your server config and resources: mkdir -p /home/fivem/server-data
  5. Start the server for the first time: cd /home/fivem/server && bash run.sh

Setting Up txAdmin

When you first launch the server, txAdmin will start and display a URL in the console — typically http://your-ip:40120. Open this in your browser to begin the setup wizard.

  1. Link your Cfx.re account by clicking the provided link and authorizing txAdmin.
  2. Set a backup password for txAdmin access.
  3. Choose a deployment type. For beginners, select "Popular Recipes" and pick one of the default templates (e.g., QBCore or the default CFX template). For a fully custom setup, choose "Remote URL or Save File" and provide a blank server.cfg.
  4. Enter your server license key from keymaster.fivem.net.
  5. Set the server data path to your data directory (e.g., /home/fivem/server-data).
  6. txAdmin will deploy the template and start your server automatically.

4. Configuring server.cfg

The server.cfg file is the heart of your FiveM server configuration. It controls everything from the server name and player limit to which resources load on startup. Here's a breakdown of the essential settings.

# Server identity
sv_hostname "My FiveM Server"
sv_projectName "My RP Community"
sv_projectDesc "A serious roleplay server"
sets sv_projectName "My RP Community"

# License key from keymaster.fivem.net
sv_licenseKey "your_license_key_here"

# Max player slots
sv_maxclients 64

# Steam Web API key (optional, enables Steam identifiers)
set steam_webApiKey "your_steam_api_key"

# Server password (leave blank for public)
#sv_password ""

# RCON password
rcon_password "change_this_to_something_secure"

# Locale
sets locale "en-US"
sets tags "roleplay, serious, qbcore"

# Resources to start
ensure mapmanager
ensure spawnmanager
ensure chat
ensure sessionmanager
ensure hardcap

# Server endpoint
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
Warning

Never share your sv_licenseKey or rcon_password publicly. If your RCON password is compromised, an attacker can execute any server command remotely, including banning all players or stopping the server.

5. Installing a Framework (QBCore or ESX)

A framework provides the foundation for your roleplay server — player management, inventories, jobs, economy, and more. The two most popular options are QBCore and ESX Legacy.

QBCore vs ESX: Which Should You Choose?

  • QBCore is the most popular modern framework. It's actively maintained, has a large ecosystem of free scripts, and is generally better optimized. Best for new servers starting in 2025.
  • ESX Legacy is the long-standing standard with the largest script library. It's been around longer and has more third-party resources available, but some scripts are outdated and unoptimized.
  • Both frameworks require a MySQL database. You'll need to install MariaDB or MySQL and create a database before deploying either framework.

Installing QBCore via txAdmin

The easiest way to install QBCore is through txAdmin's recipe system. During txAdmin setup (or by rerunning the setup wizard), select the QBCore recipe from the popular recipes list. txAdmin will automatically clone all required repositories, set up the database, and configure your server.cfg.

If you prefer manual installation, clone the QBCore GitHub repositories into your resources folder, import the SQL files into your database, and add the appropriate ensure lines to your server.cfg. The QBCore documentation covers this process in detail.

6. Port Forwarding and Firewall Rules

FiveM uses port 30120 by default for both TCP and UDP. If your server is behind a firewall (which it should be), you need to allow traffic on this port.

Linux Firewall (UFW)

# Allow FiveM game traffic
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp

# Allow txAdmin web panel (restrict to your IP in production)
sudo ufw allow 40120/tcp

# Reload firewall
sudo ufw reload

Windows Firewall

On Windows Server, open Windows Defender Firewall with Advanced Security and create two inbound rules: one for TCP 30120 and one for UDP 30120. If you need remote access to txAdmin, add an inbound rule for TCP 40120 as well.

Warning

Restrict access to the txAdmin port (40120) to only your IP address. Leaving it open to the public makes your admin panel a target for brute-force attacks. On a VPS, use ufw allow from YOUR_IP to any port 40120 instead of opening it to everyone.

If you're hosting at home, you'll also need to configure port forwarding on your router. Access your router's admin panel (usually 192.168.1.1) and forward ports 30120 TCP/UDP to your machine's local IP. The exact steps vary by router brand.

7. Adding Resources and Scripts

Resources are the building blocks of your FiveM server — everything from custom cars and maps (MLOs) to job scripts and HUD elements. Here's how to install them properly.

  1. Download the resource and extract it into your server's resources folder. Most resources come as a folder containing a fxmanifest.lua or __resource.lua file.
  2. If the resource has SQL files, import them into your database using a tool like phpMyAdmin, HeidiSQL, or the command line: mysql -u root -p your_database < resource.sql
  3. Add the resource to your server.cfg with: ensure resource_name (the folder name, not the display name).
  4. Restart your server or use the txAdmin console to start the resource live with: ensure resource_name
Info

Always review script code before installing it. Malicious or poorly coded resources can contain backdoors, crash your server, or leak player data. Stick to scripts from trusted sources like the Cfx.re forums, verified GitHub repositories, or established creators on Tebex.

Organizing Resources

As your server grows, you'll accumulate dozens — even hundreds — of resources. Use category folders to keep things organized. Create subfolders inside your resources directory like [vehicles], [jobs], [maps], and [ui]. Folders wrapped in brackets are treated as categories by FiveM and won't be loaded as resources themselves.

8. Server Optimization Tips

A poorly optimized FiveM server will stutter, desync, and bleed players. Here are the most impactful things you can do to keep performance tight.

  • Monitor server performance with txAdmin. The built-in performance chart shows tick time (how long each server frame takes). If your tick time consistently exceeds 20ms, you're dropping below the target tick rate and need to optimize.
  • Use resmon to find slow resources. Type resmon 1 in your server console to see per-resource CPU usage. Identify resources consuming more than 2-3ms and look for optimized alternatives or fix them.
  • Reduce entity counts. Every vehicle, ped, and object synced across players consumes server ticks. Limit parked vehicle spawns, clean up abandoned vehicles regularly, and avoid scripts that spawn excessive NPCs.
  • Optimize database queries. Poorly written SQL queries are a common cause of server hitching. Use oxmysql instead of the legacy mysql-async, add proper indexes to frequently queried columns, and avoid running queries inside tick loops.
  • Use OneSync Infinity. For servers with more than 32 players, enable onesync in your server.cfg with set onesync on. OneSync handles entity synchronization across large player counts far more efficiently than the default networking.
  • Keep artifacts updated. Newer FiveM builds include performance improvements and bug fixes. Update your server artifacts regularly, but test on a staging server first.

Hosting hardware matters just as much as script optimization. No amount of Lua tuning will fix a server running on a slow CPU. If you're seeing tick times above 15ms with a reasonable resource count (under 200), it's likely a hardware limitation. GoodLeaf's Ryzen 9 9950X VDS plans are specifically built for this kind of workload, delivering the single-threaded performance FiveM demands.

9. Going Live: Final Checklist

Before opening your server to the public, run through this checklist to avoid common launch-day problems.

  • Set a strong rcon_password and restrict txAdmin access to your IP.
  • Test all jobs, inventories, and scripts with at least 2-3 players to catch synchronization issues.
  • Configure automatic restarts in txAdmin (every 6-8 hours is standard for heavy RP servers).
  • Set up automatic backups of your database and server-data folder.
  • Verify your server appears on the FiveM server list by checking servers.fivem.net.
  • Set up a Discord server with channels for announcements, support, and suggestions.
  • Write clear server rules and display them during the loading screen or on first join.

Frequently Asked Questions

How much does it cost to run a FiveM server?+

It depends on your player count and script complexity. A small server (32 slots, light scripts) can run on a VPS starting at $10-15/month. Mid-size servers (64-128 players, QBCore/ESX with custom content) typically need $30-60/month in hosting. Large communities with 200+ players should budget $80-150/month for a high-performance VDS or dedicated server.

Do I need to know how to code to run a FiveM server?+

Not necessarily. With txAdmin's recipe system, you can deploy a fully functional QBCore or ESX server without writing a single line of code. However, basic knowledge of Lua scripting and SQL databases will help you customize your server, troubleshoot issues, and install resources that require configuration. Most server owners pick up these skills gradually.

Can I run a FiveM server on my home PC?+

Technically yes, but it's not recommended for public servers. Home internet connections have limited upload bandwidth, dynamic IP addresses, no DDoS protection, and your server goes offline whenever your PC is off or restarts. For testing and development, it's fine. For a public community, use a proper VPS or dedicated server with a static IP and reliable uptime.

Why does my FiveM server lag even though my CPU usage is low?+

FiveM is single-threaded, so overall CPU usage can look low while one core is completely maxed out. Check your per-core utilization rather than total CPU usage. Additionally, lag can be caused by poorly optimized scripts (use resmon to identify them), slow database queries, or insufficient network bandwidth. Upgrading to a host with strong single-core performance like a Ryzen 9 9950X often resolves persistent lag issues.

© 2017-2026 GoodLeaf Hosting & Development LLC. All rights reserved.

GoodLeaf Hosting & Development LLC is an independent provider of server infrastructure. We are not affiliated with GoodLeap financing or GoodLeaf vertical farming. We focus exclusively on High-Performance Game Hosting and Enterprise VPS solutions.