Add to favorites: press Ctrl+DYou are visitor No.009264
new! est. 2026

Home » Owners » How to Make a FiveM Server

How to Make a FiveM Server

Updated: Owners
To make a FiveM server you need a free licence key from Cfx.re, the FiveM server files, a database and a framework. The built-in txAdmin tool walks you through most of the setup in a browser. A basic server can be running in under an hour.

What you need

  • A machine to run it on: your own PC for testing, or rented hosting for a public server. See FiveM server hosting.
  • A Cfx.re account.
  • A database server, usually MariaDB or MySQL.
  • Basic comfort with files, folders and a command window.

Step 1: get a licence key

  1. Sign in to the Cfx.re portal with your account.
  2. Register a new server key.
  3. Enter the IP address of the machine and choose the server type.
  4. Copy the key. You will paste it during setup.

The standard key is free. Player slots are tied to Cfx.re's own tiers: FiveM's documentation says that more than 48 slots requires a paid subscription level.

Step 2: download the server files

Download the latest recommended server build, called the artifacts, from FiveM's official site. Choose the Windows or Linux version to match your machine. Extract it into an empty folder.

Step 3: start txAdmin

  1. Run the server executable from the folder you extracted.
  2. A browser window opens with txAdmin, the web panel that ships with the server.
  3. Link it to your Cfx.re account and create an admin password.

By default txAdmin listens on port 40120.

Step 4: install a database

Install MariaDB or MySQL and create an empty database for the server. Note the address, user name, password and database name. On a Windows test machine, a bundled package such as XAMPP is a quick way to get one running.

Step 5: choose a recipe

txAdmin offers recipes that install a ready-made base. The main choices are ESX, QBCore and Qbox. Pick one, enter your database details and let txAdmin download and configure it. To decide, read ESX vs QBCore vs Qbox.

Step 6: configure server.cfg

txAdmin creates this file for you. Check these lines:

  • sv_licenseKey holds your key from step 1.
  • sv_hostname and sv_projectName are your server's name.
  • sv_maxclients is the player limit.
  • OneSync is enabled. Modern frameworks need it.
  • endpoint_add_tcp and endpoint_add_udp use port 30120.

Step 7: open the ports

Players connect on port 30120, both TCP and UDP. On rented hosting it is normally open already. At home you must forward it on your router and allow it through the firewall. Keep the txAdmin port closed to the public if you can.

Step 8: connect

Start the server from txAdmin. Open FiveM on your PC, press F8 and type connect followed by the server's address. For a server on the same machine, use connect localhost.

What to do next

  1. Make yourself an admin in txAdmin and in the framework.
  2. Set up automatic backups of the database and the server folder.
  3. Schedule restarts. Most servers restart every 6 to 12 hours.
  4. Add resources slowly. Install one script, test it, then add the next.
  5. Write your rules. See the shared core in GTA RP rules.
  6. Set up Discord. See Discord setup for GTA RP servers.
  7. Read the licence agreement before taking any money. See FiveM monetization rules.

Mistakes that cause the most trouble

  • Leaked or cracked scripts. They often hide backdoors that give strangers control of your server.
  • Too many scripts at once. When something breaks you will not know which one did it.
  • No backups.
  • Running everything as administrator or root.
  • Opening to the public before testing with friends.

FAQ

Is it free to make a FiveM server?

The software and licence key are free. You pay for hosting and for any paid scripts.

Do I need to know how to code?

Not to get a base server running. Customising it means working with Lua or JavaScript.

Can I run a FiveM server on my PC?

Yes, for testing. See free FiveM server hosting.

Which port does FiveM use?

30120 for players, TCP and UDP.