How to Set Up a FiveM Server

  • 8 min read
  • Updated 7 October 2026
  • ESAGAMES Team

A clear walkthrough for launching your own FiveM roleplay server — get your Cfx.re server key, install the server artifacts, configure server.cfg and add a framework. Plus the managed route if you'd rather skip the Linux work.

FiveM is the multiplayer framework for Grand Theft Auto V, run by Cfx.re (a Rockstar Games company). To host a server you need a legitimate copy of GTA V, a free Cfx.re account, and a server key. ESAGAMES provides the protected server hardware; you bring the game and your content.

You can run the server yourself on a VDS/dedicated box, or use managed FiveM hosting with a panel that handles the artifacts and updates for you.

What you'll need

  • A legitimate copy of Grand Theft Auto V (you and your players each need one).
  • A free Cfx.re account and a server key from the keymaster.
  • A Linux or Windows server with a strong CPU (FiveM is CPU-bound).
  • The latest FXServer artifacts, and (for RP) a framework like ESX or QBCore plus a MySQL database.
  • Port 30120 (TCP & UDP) open and reachable.

Launch a FiveM server, step by step

  1. Step 1: Get a Cfx.re server key

    Create a free account at the Cfx.re portal and generate a server key (license key) from the keymaster. You'll put it in your server.cfg. Each key is tied to your account — keep it private.

  2. Step 2: Install the FXServer artifacts

    Download the latest recommended FXServer build (the "artifacts") for Linux or Windows from the official Cfx.re source, and extract them on your server. On managed hosting this is handled for you.

  3. Step 3: Configure server.cfg

    Set your endpoints, server name, max clients, your license key and the resources to start. Never share your sv_licenseKey publicly.

    endpoint_add_tcp "0.0.0.0:30120"
    endpoint_add_udp "0.0.0.0:30120"
    sv_maxclients 48
    sv_hostname "My ESAGAMES RP Server"
    sv_licenseKey "your_cfx_key_here"
  4. Step 4: Add a framework (optional)

    Most roleplay servers run a framework like ESX or QBCore plus a database (MySQL via oxmysql). Add the framework resources and ensure them in server.cfg, then import its SQL.

    ensure oxmysql
    ensure es_extended
  5. Step 5: Start the server

    Launch FXServer pointing at your server.cfg. It connects to Cfx.re, validates your key and registers your server.

    ./run.sh +exec server.cfg
  6. Step 6: Connect and go live

    Open the FiveM client, press F8 and use connect your-ip:30120, or find your server in the list. Share your connect address with your community.

    connect your-server-ip:30120

FiveM best practices

  • CPU is everything

    FiveM is heavily single-thread bound. High CPU clock keeps a busy ESX/QBCore city smooth.

  • Anti-DDoS

    RP communities are heavily attacked. Always-on filtering keeps your city online during raids.

  • Stay compliant

    Use only legitimate GTA V copies and follow the FiveM & Rockstar terms — don't sell the game or use leaked paid resources.

Common problems & fixes

Server doesn't appear in the list

Your sv_licenseKey is missing, invalid, or already in use elsewhere. Generate a fresh key in the keymaster and make sure only one server uses it.

Players can't connect

Check that port 30120 is open on both TCP and UDP and that your endpoints in server.cfg are correct.

Resources fail to start

A resource is missing a dependency or has the wrong name. Read the console — it names the failing resource and reason.

Database errors on a framework

oxmysql isn't configured or the MySQL connection string is wrong. Set your connection string and ensure oxmysql before the framework.

Frequently asked questions

How do I set up a FiveM server?

Get a free server key from the Cfx.re portal, download the latest FXServer artifacts, run txAdmin to create the server and a framework recipe (Qbox, QBCore or ESX), set your key in server.cfg, and open port 30120 for TCP and UDP. Then start the server and connect from FiveM with F8 → connect ip:30120.

Do I need to own GTA V to host a FiveM server?

You need a legitimate copy of Grand Theft Auto V to play on FiveM, and so do your players. You also need a free Cfx.re account and a server key.

Where do I get a FiveM server key?

From the official Cfx.re keymaster portal after creating a free account. Put the key in your server.cfg as sv_licenseKey and keep it private.

What port does FiveM use?

FiveM uses port 30120 by default (TCP and UDP). Make sure it's open and reachable.

How much CPU/RAM does a FiveM server need?

FiveM is CPU-bound, so high single-core clock matters most. A small server runs on 4–6 GB RAM; a busy ESX/QBCore city wants 8 GB+ and a strong CPU.

ESX or QBCore — which framework?

Both are popular. QBCore is modern and modular; ESX is mature with a huge resource ecosystem. Pick the one your developers know best.

Is FiveM legal?

Yes — FiveM is operated by Cfx.re, a Rockstar Games company, and is legitimate to use with a legal copy of GTA V. Always follow the FiveM and Rockstar terms of service.

What port does a FiveM server use?

TCP and UDP 30120 by default (set with endpoint_add in server.cfg). Forward both so players can connect and the server lists on the server browser.

How much RAM and CPU does a FiveM server need?

A high-clock CPU matters most — FiveM and its resources are largely single-thread. 4 GB of RAM suits a small ESX/QBCore server; a busy roleplay server with many scripts wants 8 GB or more and a strong CPU to avoid resource lag.

ESX or QBCore for a FiveM roleplay server?

Both are popular, actively maintained frameworks. QBCore is newer and modular with a large modern script ecosystem; ESX is the long-standing standard with the most tutorials. Pick the one your target scripts support, then add ox_inventory on top.

Fixes for when it goes wrong

Knowledge-base fixes that pair with this guide — the errors people hit after setup.

More guides

Skip the troubleshooting

Managed, protected hosting in Frankfurt — we handle the Linux, the network and the DDoS so you don't have to.