TutorialServer SetupBeginner

How to Set Up a FiveM Roleplay Server in 2026

The complete beginner's guide to setting up a FiveM roleplay server from zero. Licensing, hosting, installation, framework setup, database, essential scripts, testing, and launch — everything explained.

March 3, 2026·18 min read·RARX Network

You want to run your own FiveM roleplay server. Maybe you've been playing on other servers and think "I can do better." Maybe you want a private server for your friend group. Maybe you're building a community and need a home base. Whatever your reason, this guide will take you from zero to a running server.

This isn't a quick-start guide. This is the comprehensive version — every decision explained, every common mistake covered, every step detailed enough that you can follow along even if this is your first time. By the end, you'll have a fully functional FiveM roleplay server that players can connect to.

Let's build something.

Step 1: Get Your FiveM Server License

Every FiveM server needs a license key from Cfx.re (the company behind FiveM). This is free and takes about 5 minutes.

  1. Go to keymaster.fivem.net
  2. Log in with your Cfx.re account (create one if you don't have one)
  3. Click "Register a new server"
  4. Fill in the form:
    • Server name: The name that will appear in the server list
    • Server IP: If you know it, enter it. If not, you can update this later
  5. Click Generate and save your license key somewhere safe
Important: Your license key is tied to your Cfx.re account. Don't share it publicly or commit it to Git. If it's compromised, anyone can run a server with your identity.

Step 2: Choose Your Hosting

This decision significantly impacts your server's performance, cost, and the effort required to maintain it. Let's look at all options honestly:

Option A: VPS or Dedicated Server (Recommended)

You rent a virtual or physical server from a hosting provider and install everything yourself. This gives you complete control over performance, configuration, and installed software.

Recommended providers:

ProviderStarting priceBest forNotes
Hetzner~€10/mo (VPS)Best valueEuropean datacenters, excellent hardware
OVH Game~€20/moGaming-optimizedAnti-DDoS included, high clock speeds
Contabo~€5/mo (VPS)BudgetGood specs for the price, variable performance
Dedicated (any)~€40/mo+64+ playersBest performance, full hardware access

Minimum specs for a serious server:

  • 4+ CPU cores @ 3.5GHz or higher
  • 8GB RAM (16GB recommended)
  • SSD storage (NVMe preferred), at least 50GB
  • Unmetered or high bandwidth
  • Linux (Ubuntu 22.04 recommended) or Windows Server

Option B: FiveM Game Hosting

Companies like ZAP-Hosting and others offer pre-configured FiveM servers. You get a control panel where you can install frameworks and scripts through a web interface.

Pros: Easy setup, managed backups, web-based control panel
Cons: Less control, potentially higher cost, limited customization, shared resources

This is a valid choice for beginners who want to learn the basics before investing in a VPS. However, most serious servers eventually migrate to self-hosted solutions for better performance and control.

Option C: Home Hosting

Running a server on your own computer or a spare machine at home.

Pros: Free (aside from electricity), full control, great for development and testing
Cons: Your home internet likely has limited upload speed, dynamic IP addressing, port forwarding challenges, and the server stops when your PC turns off.

Home hosting works for development and small friend groups but isn't viable for public servers.

Step 3: Install the FiveM Server Software

We'll cover both Linux (recommended for production) and Windows. If you're using a game hosting provider, skip this step — they handle installation for you.

Linux Installation (Ubuntu/Debian)

Connect to your VPS via SSH and run:

# Update your system
sudo apt update && sudo apt upgrade -y

# Install required packages
sudo apt install -y git wget curl xz-utils screen

# Create a user for the server (don't run as root)
sudo adduser fivem
sudo su - fivem

# Create directory structure
mkdir -p ~/fxserver
cd ~/fxserver

# Download the latest server build
# Go to https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/
# Copy the URL of the latest recommended build
wget [paste-url-here]
tar xf fx.tar.xz
rm fx.tar.xz

# Download the default server data
git clone https://github.com/citizenfx/cfx-server-data.git server-data

Windows Installation

  1. Download the latest Windows server build from FiveM Artifacts
  2. Create a folder: C:\FXServer\server
  3. Extract the downloaded archive into that folder
  4. Download the server data: git clone https://github.com/citizenfx/cfx-server-data.git C:\FXServer\server-data

Step 4: First Boot with txAdmin

txAdmin is the server management panel that comes with FiveM. It provides a web interface for managing your server, viewing logs, restarting resources, and more.

Starting the server for the first time

Linux:

cd ~/fxserver
screen -S fivem
bash run.sh

Windows:

cd C:\FXServer\server
FXServer.exe

The console will display a URL and a PIN code. Open the URL in your browser (usually http://YOUR_IP:40120) and enter the PIN to set up txAdmin.

txAdmin Setup Wizard

  1. Create your admin account: Choose a strong password. This is the master account for your server.
  2. Choose a deployment type: Select "Recipe" for an automated framework setup, or "Existing server data" if you already have server files.
  3. Pick a recipe: If you chose "Recipe", select your preferred framework:
    • QBCore: Our recommended choice for new servers (read our framework comparison)
    • ESX: The established standard with the largest ecosystem
  4. Follow the prompts: The recipe will download and configure the framework automatically. This takes 5-10 minutes.
  5. Enter your license key: The key you got from Step 1.

Step 5: Database Setup

Most frameworks and scripts need a MySQL or MariaDB database. If you're on a VPS, you'll need to install it yourself.

Installing MariaDB on Linux

# Install MariaDB
sudo apt install -y mariadb-server

# Secure the installation
sudo mysql_secure_installation
# Set a root password, remove anonymous users, disable remote root login

# Create a database for FiveM
sudo mysql -u root -p

CREATE DATABASE fivem;
CREATE USER 'fivem'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL PRIVILEGES ON fivem.* TO 'fivem'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Configuring the connection

In your server.cfg, add the database connection string:

set mysql_connection_string "mysql://fivem:your_strong_password@localhost/fivem?charset=utf8mb4"

If you used a txAdmin recipe, this was likely configured automatically. Check your server.cfg to verify.

Step 6: Configure server.cfg

Your server.cfg is the central configuration file. Here's a well-commented template:

# ══════════════════════════════════════════════
# SERVER IDENTITY
# ══════════════════════════════════════════════
sv_hostname "My Awesome RP Server"
sets sv_projectName "My Awesome RP"
sets sv_projectDesc "The best roleplay experience"
sv_maxclients 64

# ══════════════════════════════════════════════
# AUTHENTICATION
# ══════════════════════════════════════════════
sv_licenseKey "YOUR-LICENSE-KEY-HERE"
set steam_webApiKey "YOUR-STEAM-API-KEY"

# ══════════════════════════════════════════════
# ONESYNC (required for 32+ players)
# ══════════════════════════════════════════════
set onesync on

# ══════════════════════════════════════════════
# SECURITY
# ══════════════════════════════════════════════
set sv_scriptHookAllowed 0
set sv_pureLevel 1

# ══════════════════════════════════════════════
# DATABASE
# ══════════════════════════════════════════════
set mysql_connection_string "mysql://fivem:password@localhost/fivem?charset=utf8mb4"

# ══════════════════════════════════════════════
# RESOURCES
# ══════════════════════════════════════════════
# Core (loads first)
ensure oxmysql
ensure [qb]         # or [esx]

# Your custom resources load after the framework
# ensure [scripts]
# ensure [maps]
# ensure [vehicles]

Getting a Steam API key

Some features require a Steam API key for player identification. Get one free at steamcommunity.com/dev/apikey.

Step 7: Install Essential Scripts

With your framework running, it's time to add the scripts that make your server a real roleplay experience. Check our detailed guide on best FiveM scripts for 2026 for in-depth recommendations.

At minimum, your server needs:

  1. Inventory system — How players manage their items. This is one of the most-used features.
  2. HUD — Health, armor, hunger, thirst, vehicle speedometer. The player's window into the game world.
  3. Phone system — Communication, social media, banking, and more.
  4. Vehicle system — Garage, keys, fuel, persistent damage.
  5. Police/EMS jobs — Core government jobs that enable law enforcement roleplay.
  6. Civilian jobs — Mechanic, taxi, delivery, and other income sources.
  7. Housing — Player homes with storage and customization.
  8. Admin tools — Player management, anti-cheat, logging.

Follow our script installation guide for step-by-step instructions on installing each resource.

Step 8: Testing Before Launch

Do not open your server to the public without thorough testing. Here's a testing checklist:

Solo testing

  • Create a character and go through the full new-player experience
  • Test every job: can you clock in, perform duties, get paid?
  • Test the economy: buy items, sell items, transfer money
  • Test vehicles: spawn, drive, park, retrieve from garage
  • Test inventory: pick up items, use them, drop them, trade them
  • Test phone: make calls, send messages, use banking app
  • Test housing: buy a property, store items, give keys

Group testing

  • Invite 3-5 friends to help test
  • Test player-to-player interactions (trading, handcuffs, medical treatment)
  • Test voice chat range and quality
  • Check for desync issues during vehicle pursuits
  • Verify that admin tools work correctly
  • Stress test with multiple players in the same area

Performance testing

  • Run resmon 1 and check for high-CPU resources
  • Verify server tick rate stays at 64 during normal gameplay
  • Check client FPS in areas with MLOs and custom vehicles
  • Monitor memory usage over a 2-hour session — look for leaks

Step 9: Launch and Grow

Your server is tested and ready. Now you need players. Here's how to build a community:

Create a Discord server

Discord is the hub for every FiveM community. Create channels for:

  • Announcements and server rules
  • Application forms (whitelisted servers)
  • Support tickets
  • General chat and roleplay discussion
  • Suggestions and feedback

Promote your server

  • FiveM server lists: Your server appears automatically in the FiveM server browser. Make sure your name and description are compelling.
  • Social media: Create accounts on Twitter, TikTok, and YouTube. Post clips of amazing roleplay moments.
  • FiveM forums: Post a server advertisement with screenshots and a feature list
  • Reddit: r/FiveM and r/FiveMServers for community engagement
  • Word of mouth: The best advertising is players telling their friends

Retain players

  • Listen to feedback and implement popular suggestions
  • Keep the server updated with new features and content
  • Build a fair, consistent staff team
  • Host events (races, tournaments, story arcs)
  • Maintain server performance — nothing kills a community faster than lag

What's Next?

You have a running server, but building a great server is an ongoing process. Here are your next steps:

  • Read our optimization guide to keep performance smooth as you grow
  • Explore MLO interiors to make your server's locations unique
  • Browse the RARX Store for premium scripts with 24/7 support and free lifetime updates
  • Join our Discord to connect with other server owners

Building a FiveM server is a marathon, not a sprint. Take your time, make thoughtful decisions, and focus on creating an experience players want to come back to. Good luck.

RARX Network

Ready to upgrade your server?

Browse premium FiveM scripts, vehicles, and MLOs with free updates and 24/7 support.

Browse Store