Guide Β· Server Setup

How to Set Up a FiveM Server (Full Setup Guide)

End-to-end walkthrough for launching a FiveM server from scratch β€” picking hosting, getting a Cfx.re license key, installing the server artifact, configuring server.cfg, choosing a framework, and adding your first scripts, MLOs, vehicles, and weapons.

What You're Building

By the end of this guide you'll have a working FiveM server that players can connect to, running a framework (ESX or QBCore), with at least a few scripts, an MLO or two, and some custom vehicles installed. It's the foundation every FiveM community starts from β€” the specifics of which content you run on top is what makes one server different from another.

The total first-time setup takes about 60–90 minutes of focused work if you're using managed hosting, or 2–3 hours if you're self-hosting on a VPS and doing everything by hand. Subsequent servers take you 10 minutes because you'll reuse the same server.cfg and resource set.

Pick Your Path First

The single biggest decision is where the server actually runs. Your three options:

  • Managed FiveM hosting (easiest) β€” a provider runs the server artifact for you behind a web dashboard. Upload files via a file manager, click Start, you're live. See the Hosting marketplace for options.
  • VPS (middle ground) β€” rent a virtual private server and install the FiveM artifact yourself. More control, a bit of Linux/Windows admin required. See VPS plans.
  • Dedicated server (high performance) β€” rent physical hardware for maximum throughput. Best for 64+ concurrent players, heavy MLO loads, or multi-server setups. See dedicated plans.

Running it on your home PC to test briefly is fine; running a live community off your home connection is not (you'll be IP-exposed and bandwidth-limited). This guide assumes you'll pick one of the three options above for anything you want players on.

πŸ’‘ First-time operators: use managed hosting A managed cloud host removes about 70% of the work in this guide β€” the artifact, txAdmin, and database are pre-installed. You skip straight to the "configure server.cfg" step. Save yourself the headache on your first server.

What You'll Need

  • A server / host β€” managed, VPS, or dedicated (see above).
  • A Cfx.re / Keymaster account β€” free signup at keymaster.fivem.net. You'll generate a license key for the server.
  • A MySQL database β€” bundled with most managed hosts; on VPS/dedicated you'll install MariaDB or MySQL yourself.
  • A text editor β€” VS Code, Sublime, or Notepad++ for server.cfg and resource configs.
  • Roughly 60–90 minutes of uninterrupted setup time if it's your first.

1Choose & Provision Hosting

Capacity-wise, here's what to pick based on your target player count:

  • ≤ 32 players, testing a build, small friends-only community β€” entry-tier managed cloud hosting. Usually enough RAM and CPU, one-click artifact install, no Linux needed.
  • 32–64 players, active RP community β€” mid-tier managed cloud or an 8-16 GB VPS. You start caring about CPU per-thread performance here.
  • 64+ players, flagship community, streamers as regulars β€” a dedicated server. Single-thread CPU performance matters more than core count for FiveM β€” look for high clock speed on modern Ryzen or Xeon.

Order the plan, get your control panel credentials in the welcome email, and move on. Most managed hosts will have a "Create FiveM Server" button that does steps 2–4 of this guide automatically β€” if yours does, skip ahead.

πŸ“ Location matters Pick a datacenter close to the majority of your players. A 30 ms ping difference is the gap between "feels instant" and "noticeable lag" for vehicle physics and shootouts. If your community is split across regions, pick the region with the most active players, not the middle-ground compromise.

2Get a Cfx.re License Key

Every FiveM server needs a license key tied to its IP address. The key is free β€” it's how Cfx.re's server list identifies your server.

  1. Go to keymaster.fivem.net and sign in (create an account if you don't have one).
  2. Click "Register a new server."
  3. Enter your server's IP address (or hostname). Choose the tier that matches what you're running:
    • Standalone / Dedicated β€” if you're on a VPS or dedicated box.
    • Shared Hosting β€” for most managed cloud hosts where you don't own the IP exclusively.
  4. Copy the generated license key β€” it looks like cfxk_XXXXXXXXXXXX_YYYYY. You'll paste this into server.cfg in step 4.
⚠️ Keep the key private Don't commit it to a public GitHub repo, don't paste it in a Discord screenshot, don't post it on the forums asking for help. If the key leaks, regenerate a new one in Keymaster β€” the old one becomes invalid, and anyone who copied it can't impersonate your server anymore.

3Install the FiveM Server Artifact

On managed hosting

Your provider handles this. The control panel usually has a "Version" dropdown where you pick the artifact β€” choose the latest stable recommended build (not optional, and not an old pinned version unless you have a reason). Click Install, wait a minute, done.

On a Linux VPS (Ubuntu / Debian)

Install dependencies, create the server directory, download the latest artifact, and extract:

sudo apt update
sudo apt install -y xz-utils curl wget screen

mkdir -p ~/fivem/server ~/fivem/server-data
cd ~/fivem/server

# Grab the latest recommended artifact from the FiveM downloads page
# Replace the URL with the latest from https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/
wget "https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/ARTIFACT/fx.tar.xz"

tar xf fx.tar.xz
rm fx.tar.xz

Clone the cfx-server-data template for the baseline resource set:

cd ~/fivem
git clone https://github.com/citizenfx/cfx-server-data.git server-data-template
cp -r server-data-template/* server-data/
rm -rf server-data-template

On a Windows VPS / dedicated

Download the latest Windows artifact from the FiveM downloads page, extract to C:\fivem\server\, and grab the cfx-server-data template into C:\fivem\server-data\ the same way.

4Configure server.cfg

The server.cfg file lives in server-data/ and controls everything about your server β€” name, slot count, password, license key, and which resources are loaded. The template ships with a starter version; open it and replace the defaults:

# server.cfg

# Basic info
sv_hostname "My FiveM Roleplay Server"
sv_projectName "My RP"
sv_projectDesc "Serious roleplay, ESX-based, 18+"
sv_maxclients 64
sets locale "en-US"
sets tags "roleplay, esx, economy, serious"

# Your Cfx.re license key from step 2
sv_licenseKey "cfxk_XXXXXXXXXXXX_YYYYY"

# Endpoints (usually fine as-is)
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# Database (fill in your MySQL details)
set mysql_connection_string "mysql://user:password@localhost:3306/database?charset=utf8mb4"

# Load essential system resources (from the template)
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure fivem
ensure hardcap
ensure rconlog
ensure scoreboard

# Your framework and scripts will go here once installed (step 5+)

# Server owner permissions (replace with your Steam ID or license)
add_ace group.admin command allow
add_principal identifier.steam:YOUR_STEAM_HEX group.admin

Key directives to understand:

  • sv_hostname β€” what players see on the server list. Keep it descriptive; the server list scanner ranks by activity, not cleverness.
  • sv_maxclients β€” slot count. Don't set higher than your hardware can handle (start conservative).
  • sv_licenseKey β€” from Keymaster (step 2). Required.
  • endpoint_add_tcp/udp β€” the port players connect on. Default 30120. Don't change unless you know why.
  • mysql_connection_string β€” needed by oxmysql and every framework. Skip this section only for zero-database standalone servers.
  • ensure β€” starts a resource with auto-restart. Prefer it over start.
  • add_ace / add_principal β€” sets you as an admin so you can use admin commands in-game.
πŸ’‘ Find your Steam hex Connect to any FiveM server once, then in your FiveM game data folder check the logs for identifier.steam:110000... β€” the long hex after steam: is your identifier. Paste it into the add_principal line.

5Choose a Framework (ESX vs QBCore vs Standalone)

Frameworks handle the core systems every RP server needs β€” player data, money, inventory, jobs, identity. Without one, you're writing all that yourself. Three choices:

ESX Legacy

The older, more widely-adopted framework. Huge script library β€” most marketplace scripts work on ESX out of the box. Mature, proven, slightly rougher around the edges than QBCore. Best pick if you plan to run a lot of third-party scripts or if you're forking an existing ESX server.

Install: clone esx-framework/esx_core + dependencies into resources/[esx]/, run the migration SQL, add ensure es_extended to server.cfg after oxmysql.

QBCore

Newer, cleaner code, actively maintained. Most new scripts target QBCore first. Preferred for new servers starting fresh. Slightly smaller ecosystem than ESX but growing fast.

Install: clone qbcore-framework/qb-core + the starter resources (qb-inventory, qb-menu, qb-input, qb-target) into resources/[qb]/, run the database setup, and add ensure qb-core to server.cfg.

QBox

A QBCore fork that's modernized further β€” cleaner code, faster, maintained by a different community team. API-compatible with most QBCore scripts. If you want QBCore but newer, this is it.

Standalone (no framework)

Only sensible for non-RP servers β€” drift events, deathmatch servers, minigame servers. You lose built-in player data, money, jobs, and inventory, and you're writing it all yourself. Don't start here unless you have a good reason.

⚠️ You only pick one Don't run ESX and QBCore at the same time β€” they define the same global ESX / QBCore namespaces and most scripts target one or the other exclusively. Pick, commit, move on.

6First Boot

Time to launch. With your framework and essentials installed:

On managed hosting

Click the "Start" button in the control panel. Watch the console stream in the dashboard β€” you're looking for the "listening on port 30120" line and no red errors below.

On Linux VPS

From ~/fivem/server-data/ launch the server artifact inside a screen session so it survives your SSH disconnect:

cd ~/fivem/server-data
screen -S fivem
bash ~/fivem/server/run.sh +exec server.cfg

# Detach the screen with Ctrl+A, then D
# Re-attach later with: screen -r fivem

On Windows VPS

From the server-data folder, run:

C:\fivem\server\FXServer.exe +exec server.cfg

Verify it's live

  • Console shows Server started.
  • No red Failed to verify license error (if you see that, your key or IP is wrong in step 2).
  • In FiveM, connect to your server by IP: press F8 in the FiveM client and type connect YOUR_SERVER_IP:30120.
  • You spawn in at the default Los Santos airport spawn β€” that's your framework's default spawnmanager at work.

7Add Your First Content

An empty framework server is functional but boring. This is where the marketplace comes in. Pick a handful of essentials from each category β€” don't try to install everything on day one.

Scripts (the gameplay loop)

Start with 5–8 core scripts that cover the RP essentials:

See the scripts install guide for the file-by-file process on each.

MLOs (custom interiors)

A handful of MLOs completely transforms how the map feels:

See the MLO install guide for the YMAP/YTYP-specific setup.

Vehicles

Replace the stock police/ambulance/fire with branded custom cars, then add civilian add-ons for players to buy:

Install process in the vehicle install guide.

Weapons

A realistic gun pack elevates every shootout and patrol. For stylized or event servers, pick wireframe guns (cyberpunk/sci-fi) or paintball guns (non-lethal events). Owner / VIP pieces can be commissioned as 1of1 bespoke weapons.

Clothing, UI, Sounds, Loading Screens

  • Clothing β€” streetwear, uniforms, EUP, dresses. Every script interacts with clothing somehow.
  • UI & HUD β€” a good speedometer, clean inventory skin, and a branded shop UI.
  • Sounds β€” realistic gun audio, police sirens, and event SFX. Pairs with the weapon pack.
  • Loading Screen β€” the first thing players see on connect. Branded loading screens are a small investment for the first-impression bump.

8Admin Tools, Permissions & txAdmin

The stock server.cfg permissions from step 4 get you a basic group.admin β€” enough to kick, ban, and use resource reload commands in-game. For any serious community you want more:

  • txAdmin β€” a web-based server manager that comes with modern server artifacts. Gives you a dashboard, live console, player manager, scheduled restarts, and remote command access. Access it at http://YOUR_SERVER_IP:40120 right after first boot β€” it prints the one-time password in the console.
  • Discord integration β€” most frameworks have a Discord bot resource that pushes player connects, admin actions, and crash alerts to a Discord channel. Worth setting up once you have a staff team.
  • Permissions hierarchy β€” extend server.cfg with add_ace / add_principal lines for group.mod, group.admin, group.owner. Each role gets different command allow entries.

Also drop in an anti-cheat script before you open the server to the public β€” script kiddies probe every new server on the list within hours. Don't leave it to chance.

Troubleshooting First-Boot Issues

"Failed to verify license key"

The key in server.cfg doesn't match the IP you registered on Keymaster. Fix: either update the key in Keymaster to the current IP, or regenerate a key for the correct IP and paste the new one into server.cfg.

Server starts but doesn't show in the server browser

Three common causes: (1) sv_licenseKey is missing or wrong, (2) endpoint port 30120 isn't forwarded / firewall-allowed, (3) sv_hostname is set but ensure hardcap / ensure scoreboard aren't running so the server fails its health check. Check all three.

"Couldn't start resource X"

Usually missing dependencies. Read the line above the error β€” it names what resource failed to load. Common culprit: oxmysql not running before a script that needs the database. Fix the ensure order in server.cfg.

Players connect but get kicked with "invalid client"

Your server's tick rate or OneSync setting is wrong. Add set onesync on (or onesync_enabled true on older artifacts) to server.cfg for 64-slot servers. Without it, players above slot 32 can't sync properly.

Database connection errors on boot

Bad mysql_connection_string. Test the connection independently with a database client first β€” host, port, username, password, and database name all have to work from the server's network. On managed hosts, the connection string is usually pre-filled in the control panel.

Server is up but laggy with only a few players

Run profile in the server console and watch which resources eat the most tick time. On a VPS, check CPU steal via top β€” if it's above ~5%, your host is oversold and you should consider moving to a dedicated server or a better-provisioned managed cloud host.

Can't log in via txAdmin

The one-time token printed in the console on first boot expires. If you missed it, restart the server β€” it prints a fresh token each first-boot when no admin account exists yet.

Need custom work for a feature that doesn't exist?

Commission it. The custom FiveM script development gig builds any script on spec, and custom vehicles / custom MLOs / custom weapons cover the rest.

What to Do Next

Server's up, framework's live, a handful of content is loaded. From here:

  • Expand the gameplay loop β€” add crime content (drug dealing, heists, jewelry robbery) and activities (fishing, hunting, casino).
  • Polish the player experience β€” a custom HUD, branded loading screen, and matching weapon/vehicle audio take a server from "generic RP" to "memorable."
  • Stress test β€” invite a group of friends to stress-test with 15–20 concurrent players before going public. That's where you'll find the performance issues no single-player test surfaces.
  • Plan for scale β€” if you're getting traction, budget for a dedicated server before you hit your plan's CPU limit. Migration is easier before you have 200 active players than after.
  • Related guides β€” the scripts install guide, MLO install guide, and vehicle install guide cover the per-asset-type details this overview only summarized.

FAQ

Do I need a beefy PC to run the server, or just to play?

To play FiveM you need a mid-range gaming PC. To host a public FiveM server you need a dedicated/VPS host β€” a home PC isn't reliable enough (your home internet, your PC's uptime, your IP exposure). A home PC is fine for a quick test or a LAN party, not for a public community.

Is it legal to run a FiveM server?

Yes, within Cfx.re's Terms of Service. Running a FiveM server is a legitimate non-commercial modification use of GTA V. Selling server access (paywalled communities, pay-to-win perks tied to in-game advantages) has restrictions β€” read Cfx.re's current policies before monetizing. Purely cosmetic donations and community support tiers are generally fine.

How much does a FiveM server cost to run?

Entry: $5–15/month on managed cloud hosting. Mid: $30–80/month on a VPS. High-end flagship communities: $150–400/month on dedicated. Add content costs on top β€” a solid starter server runs $200–500 in one-time purchases from the marketplace.

How long until the server shows in the FiveM server list?

Usually 1–5 minutes after boot, provided the license key is valid, the hostname isn't empty, and you have at least one slot free. New servers start at the bottom of the list β€” the list ranks by active player count, so once you have regulars, you climb.

Should I run my server on Linux or Windows?

Linux for production β€” smaller memory footprint, better process supervision (systemd, screen, tmux), faster artifact updates, lower cost. Windows is fine for testing or if you're uncomfortable in a terminal, but most serious servers land on Linux eventually.

Can I back up and migrate my server later?

Yes β€” FiveM servers are portable. Tarball your server-data/ folder and export your MySQL database, and you can restore on a new host in under 30 minutes. Plan this before you need it: automated daily backups of both are non-negotiable for live servers.

Do I need to code anything, or can I just use marketplace content?

You can run a solid server using only marketplace scripts with no coding. Config files cover all the common customization (prices, locations, job payouts, feature toggles). Commission custom script development when you want a feature that doesn't exist in any pre-made listing.