To make your own FiveM server, you download the server files from Cfx.re, start them once so txAdmin opens in your browser, and let txAdmin deploy a recipe: a working ESX, QBCore or Qbox server with its database. You need a free Cfx.re account and license key, a Windows or Linux machine, MariaDB for the framework recipes, and port 30120 open on TCP and UDP so players can join.
This guide is for running a server. To play on someone else’s server, you only need FiveM and GTA V.
Before you start
- A Cfx.re account, the one you log in to the Cfx.re forum with. txAdmin links to it during setup.
- A server license key. Register one free on the Cfx.re Portal, under server registration keys, and keep it private.
- A Windows or Linux machine that stays on while people play. To rent one with the server preinstalled instead, Cfx.re lists game server hosting providers.
- MariaDB, for the framework recipes. Qbox supports MariaDB 10.9.0 or newer and does not support MySQL, and the ESX docs warn against XAMPP. A database tool such as HeidiSQL, which the QBCore docs use, lets you look at the tables.
- On Linux, the
xz or xz-utils package to extract the server files.
- On the PC you play from, FiveM and GTA V of the same edition as the server. FiveM Legacy requires GTA V Legacy, and FiveM for GTAV Enhanced requires GTA V Enhanced.
Choose Legacy or Enhanced server files
The Cfx.re Server Download page asks for three things: the platform (“FiveM / RedM” for Legacy, or “FiveM for GTAV Enhanced”), the operating system, and the update branch (Recommended or Latest). The two platforms ship differently named files:
Asset Escrow is the Cfx.re system that protects escrowed paid scripts, and Cfx.re’s Legacy vs Enhanced page lists it as not implemented on Enhanced. If you plan to run escrowed scripts, check that page before you pick Enhanced. The steps that follow use the Legacy file names.
Download the server files
-
On the Server Download page, choose your platform, your operating system and the Recommended branch. Old links to runtime.fivem.net/artifacts redirect to this page.
-
On Windows, create C:\FXServer\server and extract server.7z into it with 7-Zip or WinRAR.
-
On Linux, create the folder and go into it:
mkdir -p ~/FXServer/server
cd ~/FXServer/server
-
On Linux, copy the link of the build from the page, download it with wget followed by that link, then extract it:
tar xf fx.tar.xz
The folder now holds FXServer.exe on Windows or run.sh on Linux. Keep your server data out of it: txAdmin asks for a separate data folder in the recipe step. Qbox’s install page is the one exception to the Recommended branch: it asks for the newest build in the list.
Start txAdmin and link your account
- On Windows, double-click
FXServer.exe. On Linux, in ~/FXServer/server, run bash run.sh with no +exec argument; Cfx.re’s txAdmin page starts it inside screen so it keeps running after you close the terminal. The console shows the txAdmin address and a PIN, and on Windows a browser tab opens.
- Enter the PIN and click Link Account.
- Log in with your Cfx.re account and click Yes, Allow.
- Create the password for the txAdmin panel.
- Enter a server name and click Next.
txAdmin’s web panel listens on TCP port 40120 by default. Players join on 30120, not on 40120.
Deploy an ESX, QBCore or Qbox recipe
A recipe downloads a framework with its starter resources, imports its SQL into your database and writes server.cfg. The three framework recipes in txAdmin’s Popular Recipes list:
If you have not picked one yet, read how ESX, QBCore and Qbox compare first.
- For the deployment type, choose Popular Recipes, then the recipe.
- Keep the data folder txAdmin suggests, or choose your own outside
C:\FXServer\server: it must be empty or not exist yet, and its parent folder must exist. Moving it later means changing its path in server.cfg and in txAdmin.
- Click Go to Recipe Deployer, check the recipe and continue. Paste your license key into Server Registration Key.
- Open Show/Hide Database options (advanced) and check the details: host
localhost, port 3306, your MariaDB user and password, and the database name. Delete Database is on by default and deletes an existing database with that name, so give a new name or turn it off. Click Run Recipe: the deployer downloads the resources and imports the SQL.
- Review the
server.cfg it wrote and click Save & Run Server. On the first QBCore start, let yarn finish installing before you stop anything.
The server starts and txAdmin shows its console.
Read the server.cfg the recipe wrote
The recipe’s server.cfg sits in the data folder. These lines decide whether players can find and join the server; the values are from the example server.cfg on Cfx.re’s vanilla setup page.
Open port 30120
- In your router, forward port 30120 on TCP and UDP to the machine running the server. On a rented machine, open it in the host’s firewall settings instead.
- In the machine’s own firewall, allow port 30120 on TCP and UDP.
- From outside your network, open your public IP with
:30120/info.json added, such as http://203.0.113.5:30120/info.json. The page loads when the port is open. Cfx.re also names canyouseeme.org as a port checker.
Check it works
-
On the PC that runs the server, start FiveM and press F8 to open the console.
-
Run:
connect 127.0.0.1:30120
FiveM loads into your server.
-
Ask a player on another network to run connect with your public IP and :30120.
-
To find it in the server list, wait: a server can take up to 8 minutes to appear after it starts.
If it fails
- Players on other networks time out, but you can join on the server PC: port forwarding or a firewall blocks 30120. Run the
info.json check from outside your network.
- The server shows as private in the list: the
sv_master1 line in server.cfg lost its #. Put the # back at the start of the line.
- An error at startup names
sv_projectName or sv_projectDesc: add both sets lines from the table.
- The server starts slowly on Windows: Microsoft Defender may be scanning the server files. In PowerShell as administrator, run
Add-MpPreference -ExclusionPath 'C:\FXServer\', with your own folder if it differs.
- Antivirus removes
FXServer.exe: the ESX docs call this a false positive. Restore the file and add the same Defender exclusion.
- Your database is MySQL and you chose Qbox: Qbox does not support MySQL. Install MariaDB 10.9.0 or newer and run the recipe again.
- You started FXServer yourself, no resources start and players get
timed out or connection refused: Cfx.re traces this to a missing +exec server.cfg. Start FXServer.exe with no arguments to let txAdmin run it.
Replace the default police job
Police and EMS are the jobs most other roleplay runs into: a robbery ends in an arrest, a crash ends at the hospital. The recipes install free versions of both, so they are the first jobs worth replacing.
Our Advanced Police Job supports ESX, QBCore and Qbox, and covers arrests, patrol gear, vehicle radar, live bodycams and as many stations as you need. Its README asks for es_extended, qb-core or qbox, for mysql-async or oxmysql, and for bl_ui for the default cuff minigames. Remove the recipe’s police job (esx_policejob, qb-policejob or qbx_police) before you start ours, so two resources do not run the same job. The showcase video runs 4:45.
Replace the default ambulance job
Our Advanced Ambulance Job supports ESX, QBCore and Qbox. Each injury has a body part, a type and a severity, and EMS treat it with the matching item. Downed players crawl and bleed out on your timer until CPR, a defibrillator or adrenaline revives them, and a hospital medic NPC revives players while 2 or fewer EMS are online. Its README links the stretcher and wheelchair models you download separately.
Add the rest of your scripts
Choose the rest by what your players do: the scripts a roleplay server needs goes through them. If you will run many of ours, compare our subscription plans; both jobs are in Essential and in Ultimate.
How to install FiveM scripts takes each one from the download to its first start on your server.