FiveM

How to Make a FiveM Server for GTA V Roleplay (2026 Guide)

A free license key, the FXServer files, a server.cfg and a framework like ESX or Qbox. Here is the whole path, plus the October 2026 change to how the server list works.

TheGameHosting Team 9 min read
Night view of a city full of lights, the kind of map you get when you make a FiveM server for GTA V roleplay
Photo: FairbanksMike, CC BY 2.0, via Wikimedia Commons (cropped)

If you want to know how to make a FiveM server, the short version is: get a free license key from the Cfx.re Portal, download the server files (FXServer), write a server.cfg, open port 30120 on TCP and UDP, and start it. For roleplay you then add a framework such as ESX, QBCore or Qbox, which needs a MySQL database. This guide walks through each step with the values from the official Cfx.re documentation.

What you need before you start

  • A Cfx.re account to sign in to the Cfx Portal. The official setup guide says to register a free license key there before anything else.
  • A machine that stays on. Cfx.re recommends an x86-64 system running Linux or Windows, with decent upload speed and preferably a multi-core processor.
  • A MySQL database if you plan to run a roleplay framework. Freeroam and drift servers can skip it.
  • Players with GTA V on PC. Each player needs a legal PC copy of Grand Theft Auto V and the FiveM client.

How much memory depends on your scripts. On our plans FiveM starts at 8 GB, and a full city with jobs, housing, vehicle packs and MLOs grows from there.

Step 1: get your license key

Every FiveM server needs a server license key. It is free. Sign in to the Cfx Portal with your Cfx.re account, create a key for your server and copy it. You will paste it into server.cfg as sv_licenseKey, or into txAdmin during setup.

The key belongs to you, not to the machine. If you move your server later, you take the key with you.

Step 2: download the server files (FXServer)

The server program is called FXServer. You download it from the Server Download page in the Cfx.re docs, where you pick the platform, the operating system (Windows or Linux) and the branch (Recommended or Latest). Use Recommended unless a resource you need asks for a newer build.

There are now two platforms on that page: the classic FiveM server and FiveM for GTAV Enhanced. They are not interchangeable. Enhanced uses different file names (cfx-server.exe instead of FXServer.exe), needs the Microsoft Visual C++ 2017 Redistributable on Windows, and has a list of breaking changes for older resources. Cfx.re published a tool called Alchemist to convert existing assets. If you are starting a city from community scripts, read the "What's Changed in FiveM for GTAV Enhanced" page before you choose.

Cfx.re also notes that the Linux build is a courtesy port and that the Windows build is better supported when something needs to be diagnosed.

How to create a FiveM server with txAdmin (the easy way)

Since early 2020, txAdmin is part of FXServer, so there is nothing extra to install. It is a web panel that deploys a server from a "recipe" and then lets you restart it, watch the console and manage players.

  1. Extract the server files into a folder, for example C:\FXServer\server.
  2. Run FXServer.exe (or cfx-server.exe on Enhanced). A txAdmin setup page opens in your browser, on port 40120 by default.
  3. Check that the PIN is filled in, click Link Account and log in with your Cfx.re account.
  4. Create a password for the txAdmin admin page and give the server a name.
  5. Pick a recipe under Popular Recipes. The official guide uses "CFX Default FiveM"; the recipe list also has framework recipes such as ESX Legacy and Qbox, and some recipes need a database.
  6. In the Recipe Deployer, paste your license key and click Run Recipe.
  7. Click Save & Run Server.

The recipe writes a working server.cfg for you. You still need to know what is in it, because that is where you change slots, resources and admin rights.

Setting up a vanilla server and server.cfg

Without txAdmin, you create the folders yourself. The official guide puts the binaries in one folder (server) and your data in another (server-data), which you can fill by cloning cfx-server-data with Git. Then you start the server from the data folder:

Windows
cd /d C:\FXServer\server-data
C:\FXServer\server\FXServer.exe +exec server.cfg
Linux
cd ~/FXServer/server-data && bash ~/FXServer/server/run.sh +exec server.cfg

The most common startup mistakes, per the docs, are starting from the wrong folder (resources not found) and forgetting +exec server.cfg (no license key, connections refused).

Here is a trimmed server.cfg based on the official example:

server.cfg
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap

sv_scriptHookAllowed 0
set onesync on
sv_maxclients 48

add_ace group.admin command allow
add_ace group.admin command.quit deny
add_principal identifier.fivem:1 group.admin

sv_licenseKey "your-license-key"

What each part does:

LineWhat it does
endpoint_add_tcp / endpoint_add_udpBinds the server to port 30120 on TCP and UDP. Change the port only, not the IP, unless the machine has several network interfaces.
ensureStarts a resource, or restarts it if it is already running. It also accepts a folder in brackets, like ensure [cars].
set onesync onTurns on OneSync. Cfx.re requires it for 32 slots or more, and on (not legacy) above 64.
sv_maxclientsThe player limit. It accepts 1 to 2048, within the limits of your key (see below).
add_ace / add_principalGives the admin group every command except quit. Replace identifier.fivem:1 with your own identifier.
sv_licenseKeyYour key from the Cfx Portal.

If you want RCON, set rcon_password; it stays disabled while that is empty. To hide player IP addresses from public server reports, add sv_endpointPrivacy true.

How to make a FiveM server public

A FiveM server is public by default: on startup it reports itself to the server list. If yours does not show up, the official troubleshooting page points to the same causes almost every time:

  1. Port forwarding or a firewall. Port 30120 has to be reachable from the internet on TCP and UDP. If a direct connect from outside your network fails, this is the problem.
  2. sv_master1 "" is active. That line makes the server private: it still appears in the list, but the Connect button is disabled. Leave it commented out.
  3. Patience. It can take up to 8 minutes for a new server to appear in the list.
  4. Missing Portal data. Since October 21, 2026, a server's name, description, tags, language, images and Discord link are managed in the Cfx Portal, not in server.cfg. Servers with blank fields show as "Missing server data (must be configured in Portal)".

Server name, description and tags

The docs now mark sv_hostname, sv_projectName and sv_projectDesc as deprecated and send you to the Portal instead. There you can add up to five tags, which players use to search, so pick the ones that describe your city (for example roleplay, serious, Spanish). The recommended banner is 2560x280 pixels and the profile image 512x512.

Slot limits and Element Club

Your key sets a ceiling on top of sv_maxclients. Without a subscription, Cfx.re says a server supports up to 48 players using OneSync Infinity. Higher limits come with the paid Element Club tiers on fivem.net: Argentum allows 64 slots, Aurum up to 128, and Platinum up to 2048 with OneSync Infinity. Start with the default limit and look at a tier only when your city actually fills it.

How to create a GTA V roleplay server: picking a framework

Roleplay is built on a framework: a core resource that handles characters, jobs, money and inventory, with community scripts written for it. The three you will hear about are:

  • ESX Legacy, the long-running framework many cities started on.
  • QBCore, known for gangs, a modern inventory and a large script catalogue.
  • Qbox, a community fork that keeps QBCore compatibility while modernizing the code.

All three store their data in MySQL, usually through the oxmysql connector, so you need a database and its connection string in server.cfg. Choose based on the scripts you want to buy or use, since scripts are usually written for one framework. Start the framework before the scripts that depend on it:

server.cfg
set mysql_connection_string "mysql://user:password@host/city"
ensure oxmysql
ensure qb-core
ensure [jobs]

Make a backup before every framework update, because a new core version can break the scripts around it.

Running it at home vs. hosting it

You can run FXServer on your own PC, but then your city is only online while your PC is on, you have to forward port 30120 on your router, and your home IP is exposed to anyone who wants to attack a public RP server. Database, backups and updates are also on you.

On a FiveM server hosting plan from TheGameHosting, those problems are handled for you:

  • 24/7 online on hardware we own in Dallas, TX and Amsterdam, NL, without your PC on. Pick the location closest to most of your players.
  • No port forwarding. Players connect to the address and port your panel shows.
  • DDoS protection in front of every server.
  • Two MySQL databases included, one for the live city and one for a test copy.
  • Files and sFTP to upload resources, vehicle packs and MLOs, and edit server.cfg in the browser, on NVMe storage.
  • Backups before every update, restored in one click.
  • AMD 9950X / 7950X3D CPUs up to 5.7 GHz with DDR5 RAM, so heavy script loads keep up.
  • No slot cap from us: your config and your key's rules set the limit.

If your group also plays other games, the same plan switches games from the panel with Game Changer. We have guides to make a Rust server and make a CS2 server.

You keep your own Cfx.re license key, so the server stays yours. Plans for FiveM start at 8 GB for $6.96 USD a month; see all sizes on our pricing page.

Start your city today

Making a FiveM server is mostly setup: a key, the server files, a clean server.cfg and a framework. Keeping it online every night your players log in is the harder part. If you would rather spend your time on jobs and scripts than on routers and uptime, pick a plan, paste your license key and upload your resources. Your server is ready about 60 seconds after payment, and our support team answers 24/7 by chat, email and tickets in English and Spanish.

FAQ

How do I make a FiveM server for free?

The FiveM server software and the license key from the Cfx Portal cost nothing, so you can run a server on your own PC. You still need a machine that stays on, port 30120 open on TCP and UDP, and your own protection against attacks.

How do I make my FiveM server public?

Leave sv_master1 "" commented out, make sure port 30120 is reachable on TCP and UDP, and fill in your server's name, description and tags in the Cfx Portal. A new server can take up to 8 minutes to appear in the list.

Do I need txAdmin to make a FiveM server?

No. txAdmin is built into FXServer and makes setup easier with recipes, but you can also start the server by hand with +exec server.cfg.

How many players can join a FiveM server?

sv_maxclients accepts up to 2048, but your license key sets the real limit. Without an Element Club tier, Cfx.re says a server supports up to 48 players using OneSync Infinity.

Is QBCore or ESX better for a new roleplay server?

Both work and both need MySQL. Pick the one your scripts are written for; Qbox is also an option if you want QBCore compatibility with newer code.

Can I use my server.cfg name and tags after October 2026?

The docs now mark sv_hostname and sv_projectName as deprecated. Your name, description and tags are managed in the Cfx Portal, so set them there.

Hosting for this game

Written by TheGameHosting Team, the people who run our servers in Dallas and Amsterdam and answer your tickets.

All posts