How to Make a FiveM Server (Windows and Linux, 2026)
Make your own FiveM server on Windows or Linux: download FXServer, get a Cfx.re key, set up txAdmin and MariaDB, open the right ports and deploy QBCore or ESX.
Updated Oct 1, 2026 · 5 min read
On this page
A FiveM server is FXServer, the free server program from Cfx.re, plus a license key and the resources that make your world. This guide sets one up from scratch on Windows or Linux, with txAdmin to manage it and MariaDB for roleplay frameworks like QBCore, Qbox and ESX. Budget about an hour the first time.
What you need
- A PC or server that stays on while people play. FiveM runs most of its work on one thread, so a fast CPU matters more than many cores.
- RAM: 4 GB free for a vanilla server, 8 GB or more for a roleplay framework with a script pack.
- A Cfx.re account for the license key and txAdmin login.
- Port forwarding on your router, or a VPS with a public IP.
- Grand Theft Auto V and FiveM on the PC you play from (the server itself does not need GTA V).
Step 1: Generate a license key
- Sign in at portal.cfx.re.
- Open Server Keys, generate a new key and give it a name.
- Copy the key that starts with
cfxk_. You paste it into txAdmin later.
Step 2: Download FXServer
FXServer builds are called artifacts. Use the build marked Recommended unless a resource asks for a newer one.
Windows
- Download the recommended build from the Windows artifacts page on runtime.fivem.net.
- Create a folder like
C:\FXServer\serverand extract the archive into it with 7-Zip. - Create a second folder,
C:\FXServer\txData, for your server data. Keeping the two apart lets you replace FXServer without touching your server.
Linux
mkdir -p ~/FXServer/server && cd ~/FXServer/server
wget <link to the recommended fx.tar.xz>
tar xf fx.tar.xz
Copy the link from the Linux artifacts page on runtime.fivem.net. Install xz-utils first if tar cannot read the file.
Step 3: Install MariaDB (for roleplay frameworks)
QBCore, Qbox and ESX store characters, money and inventories in MySQL. Skip this step for a plain freeroam server.
- Windows: install MariaDB and set a root password during setup. HeidiSQL comes with it for browsing the database.
- Linux:
sudo apt install mariadb-server, then runsudo mariadb-secure-installation.
Create a database and a user for the server:
CREATE DATABASE fivem;
CREATE USER 'fivem'@'localhost' IDENTIFIED BY 'a-long-password';
GRANT ALL PRIVILEGES ON fivem.* TO 'fivem'@'localhost';
FLUSH PRIVILEGES;
Step 4: Start FXServer and open txAdmin
- Windows: run
FXServer.exefromC:\FXServer\server. - Linux: run
./run.shfrom the server folder. Usescreenortmuxso it keeps running after you log out.
txAdmin starts and prints its address and a 4 digit PIN, for example http://localhost:40120. Open it in a browser (on a VPS use the server's IP), enter the PIN, sign in with your Cfx.re account and set a master password.
Keep port 40120 private. Anyone who reaches txAdmin's login page can try to get in, so do not forward it unless you need to manage the server from outside.
Step 5: Deploy a recipe
In txAdmin's setup choose Popular Recipes, then:
- Pick CFX Default, QBCore, Qbox or ESX Legacy.
- Set the data folder to your
txDatafolder. - Paste your license key.
- For roleplay recipes, enter the database host (
localhost), port (3306), user, password and database name from step 3. - Run the recipe, then Save & Run Server.
The recipe writes a server.cfg like this, which you can edit later in txAdmin's CFG Editor:
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
sv_hostname "My FiveM Server"
sv_maxclients 48
sv_licenseKey cfxk_your_key_here
set mysql_connection_string "mysql://fivem:a-long-password@localhost/fivem?charset=utf8mb4"
ensure qb-core
Step 6: Open the ports
| Port | Protocol | What for | Open to the internet |
|---|---|---|---|
| 30120 | TCP and UDP | The game, the server list and players.json | Yes |
| 40120 | TCP | txAdmin web panel | Only if you manage it from outside |
| 3306 | TCP | MariaDB | No |
Forward 30120 TCP and UDP on your router to the server's local IP, and allow both in Windows Defender Firewall or ufw. The server also needs to reach Cfx.re's servers on the internet to check its key and appear in the server list, so do not block outbound traffic.
Step 7: Join your server
Start FiveM, press F8 and type connect followed by your address:
- On the same PC:
connect localhost:30120 - Friends at home:
connect your-public-ip:30120
New servers can take a while to appear in the FiveM server list. Connecting by address always works.
Common problems
- License key errors: see fixing FiveM license key errors.
- "Couldn't load resource" for a framework script: the database connection failed. Check
mysql_connection_stringand that MariaDB is running. - Friends time out but you can join: port 30120 is not forwarded on both TCP and UDP, or the firewall blocks it.
- txAdmin says the server is outdated: download a newer recommended artifact and extract it over the
serverfolder. YourtxDatafolder stays.
The easier option
Running a roleplay server at home means your PC stays on all day, your upload speed decides everyone's ping and your home IP is shared with every player. A hosted FiveM server comes with txAdmin, the ports and a MySQL database ready, so you go straight to picking a recipe.
FAQ
Is it free to make a FiveM server?
Yes. FXServer, txAdmin and the license key are free. Free keys allow up to 48 players.
Does a FiveM server need GTA V installed?
No. Only players need a legal copy of Grand Theft Auto V for PC. The server runs on its own.
Can I run a FiveM server on Linux?
Yes. Linux builds are on the same artifacts site, and txAdmin works the same way. Most hosted FiveM servers run on Linux.
Do I need OneSync?
txAdmin recipes turn OneSync on, which most current scripts expect. It is included with every server.
Skip the setup. Your own FiveM server.
Then $9.99/mo. Just trying it? $2.50 for 3 days