Back to Blog

How to Make a FiveM Server with txAdmin

How to make a FiveM server: license key, server artifacts, ESX or QBCore through txAdmin, MariaDB, port 30120 and the most common errors, step by step.

Nodesty Team8 min readGame servers
The FiveM logo and the word FiveM on a dark Nodesty background

So, how do you make a FiveM server? In short: you get a free license key from Cfx.re, download the FiveM server files (artifacts), open txAdmin and pick a ready-made recipe such as ESX or QBCore in the setup wizard. The wizard installs the framework, the database tables and the base scripts for you. With the right preparation, setup takes less than an hour; the real work is shaping the server into your own roleplay world.

This guide walks through the whole process step by step, from requirements and the license key to txAdmin, the database, ports and the errors people run into most often.

Requirements

  • Operating system: FXServer runs on Windows and Linux. If this is your first server, Windows is the more familiar environment; Linux uses fewer resources and is better suited to running for long periods without interruption.
  • Hardware: 4 GB of RAM is enough for testing. For a live roleplay server we recommend at least 8 GB of RAM and 4 CPU cores, because the game server, the database and txAdmin run on the same machine. Game logic mostly runs on one core, so high clock speed matters more than core count.
  • Database: ESX and QBCore store character and inventory data in a MySQL/MariaDB database.
  • A Cfx.re account: needed for the license key and for signing in to txAdmin.
  • GTA V: not installed on the server, but every player who connects needs a legitimate copy of GTA V.

Before you start, decide where the server will run. Your own computer is ideal for experimenting, but the server only runs while the computer is on, your home upload speed limits player capacity and the address you give players is your home IP. For a roleplay server you plan to open to a community, setting it up on the machine where it will live saves you a migration later.

Getting a Cfx.re license key

Every FiveM server needs a license key. The key is free and tied to your Cfx.re account.

  1. Sign in to Cfx.re's license key portal (Keymaster) with your Cfx.re account.
  2. Create a new server key and enter the server name and the IP address of the machine it will run on.
  3. Save the key somewhere safe. The setup wizard will ask for it.

Don't share the key. It is tied to your account, so you are responsible if it is misused.

Downloading the server files (artifacts)

Compiled builds of FXServer are called "artifacts" and are published on Cfx.re's official artifacts pages, separately for Windows and Linux. A recommended build is usually marked in the list; use that one for a new server.

On Windows:

  1. Create a folder, for example C:\FXServer\server.
  2. Download server.7z for the recommended build from the Windows artifacts page and extract it into that folder.
  3. Run FXServer.exe from the folder. This starts txAdmin.

On Linux:

  1. Create a folder such as ~/FXServer/server and change into it.
  2. Download fx.tar.xz for the recommended build from the Linux artifacts page and extract it:
    tar xf fx.tar.xz
    
  3. Start the server:
    ./run.sh
    

On Linux, use a tool like screen or tmux so the server keeps running after you close the terminal.

Setting up the server with txAdmin (ESX / QBCore)

txAdmin is the web-based management tool bundled with FXServer. Starting and stopping the server, scheduled restarts, player management and logs are all handled in the browser.

  1. The first time you start FXServer, the console shows txAdmin's address and a 4-digit PIN. Open http://localhost:40120 in your browser (if the server is on another machine, use its IP address instead of localhost).
  2. Enter the PIN and link txAdmin to your Cfx.re account. Then set an admin password for txAdmin.
  3. In the setup wizard, name your server and choose Popular Recipes as the deployment type.
  4. Pick a recipe:
    • CFX Default: a clean, basic server.
    • ESX Legacy: the widely used roleplay framework with jobs, inventory and economy built in.
    • QBCore Framework: a roleplay framework known for its modern structure and ready-made scripts.
    • Qbox: a performance-focused continuation that keeps QBCore compatibility.
  5. Confirm the folder the server files will be installed into.
  6. The wizard asks for your license key and database details. Once entered, the recipe installs the framework, the database tables and the base scripts automatically.
  7. When it finishes, start the server from txAdmin and check the console for errors.

Lines to know in server.cfg

txAdmin creates a server.cfg file that holds the server's basic settings. These are the lines you will edit most:

sv_hostname "Your server name"
sets sv_projectName "Project name"
sets sv_projectDesc "Short description"
sets tags "roleplay, english"
sets locale "en-US"
sv_maxclients 48
sv_licenseKey "your-license-key"
set onesync on
ensure oxmysql
  • sv_hostname, sv_projectName and sv_projectDesc are the name and description shown in the server list.
  • sets tags and sets locale help players find your server with the list filters.
  • sv_maxclients is the player limit. A free key cannot go above 48.
  • set onesync on enables server-side synchronisation; it is required above 32 players.
  • ensure lines decide which scripts start, and in which order.

Changes to server.cfg take effect after the server restarts.

Scheduled restarts and backups

On a FiveM server that runs for a long time, some scripts slowly build up memory. txAdmin's Restart Schedule restarts the server automatically every day at the quietest hour, and warns players beforehand. A regular database backup also means you can restore characters and inventories after a bad script update.

Database (MariaDB)

The ESX and QBCore recipes need a MySQL database. We recommend MariaDB, the open-source, MySQL-compatible option.

  1. Install MariaDB. On Windows, use the official installer; on Linux, install it with your distribution's package manager.
  2. Set a strong password for the root user during setup.
  3. When the txAdmin wizard asks for database details, use localhost as the host and the user name and password you just set. The recipe creates the database itself.

After setup, scripts connect to the database through oxmysql. The connection details live on this line in server.cfg:

set mysql_connection_string "mysql://user:password@localhost/database?charset=utf8mb4"

Running the database on the same machine as the game server means queries are answered without network latency. Back it up regularly; characters, vehicles and inventories all live there.

Port 30120 and the firewall

A FiveM server uses port 30120 for both TCP and UDP by default. txAdmin runs on TCP port 40120.

  • Windows: create inbound rules in Windows Defender Firewall for 30120 TCP and 30120 UDP.
  • Linux (ufw):
    sudo ufw allow 30120/tcp
    sudo ufw allow 30120/udp
    
  • On a home connection: forward 30120 TCP and UDP on your router to the server's local IP address.

Rather than opening port 40120 to everyone, allow only your own IP. Game servers are frequent attack targets, so DDoS protection in front of your server matters too; our guide What is a DDoS attack? explains why.

Connecting to your server

  1. Open the FiveM client and press F8 to open the console.
  2. Type connect server-ip:30120 and press Enter. If the server is on the same computer, connect localhost is enough.
  3. Once your server has registered with the list, players can also find it by name in FiveM's server browser.

To make yourself an admin in game, use txAdmin's in-game menu (the /tx command) or your framework's permission commands.

Common errors

  • License key could not be validated: The key was copied incorrectly or created for a different IP address. Check the key's IP in Keymaster.
  • Can't connect to the database: If oxmysql reports a connection error, make sure MariaDB is running and that the user, password and database name in mysql_connection_string are correct.
  • A script won't load: This happens when a script is ensured before a script it depends on. Start dependencies first.
  • Port already in use: If another FXServer or program uses port 30120 on the same machine, the server won't start. Stop the old process or change the port.
  • Players can't connect: Check that 30120 is open for both TCP and UDP in the firewall and that port forwarding is set up on a home connection.
  • The server stutters: Type resmon 1 in the F8 console in game to see how much time each script uses. Scripts that use a lot of time while idle usually need optimising.
  • The server list shows an old name: List information refreshes at intervals. Restart the server after changing the name in server.cfg and wait a few minutes.
  • Players see "Couldn't load resource": Usually a script's files are missing or corrupt. Download and upload the script again and make sure its fxmanifest.lua is present.

Setting up a server yourself teaches you a lot. As your server grows, though, you will need a machine that is online 24/7, has a high clock speed and sits behind DDoS protection. Nodesty's FiveM server hosting comes with a Ryzen 9 9950X and DDoS protection, ready for txAdmin, OneSync, ESX and QBCore. Want a Minecraft server too? Our guide on how to make a Minecraft server walks you through it.

Frequently Asked Questions

Is it free to make a FiveM server?

The server software (FXServer) and the license key are free. With a free key your server can hold up to 48 players; more slots need a paid Element Club membership from Cfx.re. The machine you rent to keep the server online 24/7 is a separate cost.

Do I need GTA V on the server?

No. GTA V is not installed on the server; FXServer does not need the game files. Every player who connects needs their own legitimate copy of GTA V.

Should I choose ESX or QBCore?

Both are mature roleplay frameworks. ESX Legacy comes with a huge number of ready-made scripts and a large community; QBCore has a more modern structure, and Qbox is a performance-focused continuation that keeps QBCore compatibility. Choose based on which framework the scripts you want support.

Is it safe to open txAdmin to the internet?

txAdmin is password protected, but rather than opening port 40120 to everyone, it is safer to allow only your own IP address, or at least to use a strong password with two-factor authentication.

Why doesn't my server show up in the server list?

Usually port 30120 is not open for both TCP and UDP, the license key is wrong, or the server has not registered with the list yet. Check the console for errors; meanwhile players can connect directly by IP from the F8 console.

Can I move my server to a rented machine later?

Yes. Transfer your resources folder, your server.cfg and an SQL dump of your database to the new server. At Nodesty our support team does the migration for free.

Nodesty

About the author

Nodesty Team · Infrastructure & Support

The Nodesty team runs our servers, network and DDoS protection day to day and answers customer support requests around the clock. These guides come from that work.

Related articles

Launch your server now.

Build, scale, and conquer without limits on Nodesty's premium infrastructure.

                                                                                                                                                                                                                            
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            
                                                                                                                             ············································                                                   
                                                ··································································································..........···························                                     
                                       ················..........................................................................................................................··············                             
                                  ·············.................::::::::::::::::::::::::::::::::::::::::::::::....................:::::::::::::::::::::::::::::::::::::::................···········                        
                             ············................:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::............·········                     
                         ············.................:::::::::::::::::::::::::::::::::::::::::::::::::::------------::::::::::::::::::::::::::::::----------------:::::::::::::::::::::..........········                  
                    ············......................::::::::::::::::::::::::::::::::::::------------------------------------------------------------------------------------:::::::::::::.........········                
                ··········.............................................::::::::::::::::::-------------==========================================-----------------------------------:::::::::::........·······               
             ········..................:.....................................::::::::::--------=======+++++++++++++++++++++++++++++++++++++=========================------------------::::::::::.......·······              
           ······.........::::::::::::::::::::................................:::::::-----=====++++xxxxxx**************************xxxxxxxxx++++++++++++++===================------------::::::::.......·······             
          ·····.......:::::::::::::::::::::::::::.............................:::::----===+++xxx****%%%%&&&&&&#############&&&&&&&%%%%%*******xxxxxxxx++++++++++++++==============----------:::::::......······             
         ····......::::::::-------------:::::::::::..........................::::---===+++xx***%%%&&&####@@@@@@@@@@@@@@@@@@@@@@@@####&&&&&%%%%*******xxxxxxxxx+++++++++++++===========--------::::::......·····             
        ····.....:::::::--------------------:::::::::.......................::::---===++xxx**%%&&&###@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###&&&&%%%%%********xxxxxxxxxxx++++++++++++========------::::::.....······            
        ····.....:::::--------------------------::::::::....................::::---===++xx***%%&&&####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###&&&&&%%%%%**********xxxxxxxxxxxxx+++++++++=======------:::::.....·····            
        ····....::::::-------=============---------:::::::::................:::::---===+++xx***%%%&&&#####@@@@@@@@@@@@@@@@@@@@@@@@@#####&&&&&%%%%%%*************xxxxxxxxxxxxxx+++++++++======-----:::::....·····            
         ····....:::::-------================---------:::::::::...............:::::----===++++xxx***%%%%&&&&&&#################&&&&&&%%%%%%%*******************xxxxxxxxxxxxxxxxx++++++++======----:::::....·····            
         ·····....:::::--------=================---------::::::::::..............:::::::-----====+++++xxxxxx**************************xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx++++++++=====-----::::....·····            
          ·····.....:::::--------=================----------:::::::::::.................:::::::::-------=============++++++++++++++++++++++++++++++++++++xxxxxxxxxxxxxxxxxxxxxxx++++++++======-----::::....·····            
            ·····.....:::::::----------===========-------------::::::::::::.........................::::::::::::::::::------------------=============+++++++++++++++++++++++++++++++++=======-----::::.....·····            
              ······......:::::::---------------------------------:::::::::::::........................................:::::::::::::::-----------============+++++++++++++++++++++========------:::::.....·····             
                 ······........:::::::::---------------------------:::::::::::::::::...........................................:::::::::::::------------=============================--------::::::.....······              
                    ·········.........:::::::::::::::-------------::::::::::::::::::::::::.......................................::::::::::::::::--------------------------------------::::::::......·······                
                          ··········............::::::::::::::::::::::::::::::::::::::::::::::::::................................::::::::::::::::::::::::::-------------:::::::::::::::.........········                   
                                  ············..................:::::::::::::::::::::::::::::::::::::::::::.........................:::::::::::::::::::::::::::::::::::::................···········                        
                                             ················.............................................................................................................·················                                 
                                                           ······················................................................................···························                                                
                                                                               ·········································································