To make a FiveM server, download FXServer, start it to open txAdmin, paste a free registration key from Cfx.re Portal and deploy a recipe, then open port 30120 so players can join. The server software, txAdmin and the registration key cost nothing, and a server can run up to 48 player slots without a subscription. This guide sets up a FiveM server for GTA V Legacy with FXServer and txAdmin on Windows or Linux, then shows two ways to turn it into a roleplay server, a framework recipe or a ready-made server template, and when a rented game server host saves you the setup.
The short version:
- Create a server registration key in Cfx.re Portal.
- Download the recommended FXServer build for your operating system.
- Start FXServer and open txAdmin on port 40120.
- Link your Cfx.re account and deploy a recipe.
- Open game port 30120 (TCP and UDP) for players.
- Join with F8 and
connect, first locally, then from another network.
- Add a framework, database and resources one step at a time.
Choose how you want to start
Every path below ends with the same FXServer and txAdmin installation. They differ in who assembles the roleplay content and who runs the machine.
| Path | What you get | What you still do | Cost |
| Basic recipe | An empty FiveM server with the Cfx.re default resources | Everything after the first connection: framework, database, scripts, maps | Free, plus your hardware or hosting |
| Framework recipe | ESX Legacy or Qbox with its core resources and a fresh database | Choose and configure jobs, inventory, phone, housing, vehicles and maps yourself | Free, plus a database server and hosting |
| Server template | A framework with preconfigured scripts, maps and a database file, assembled by someone else | Hosting, your own keys and credentials, testing, and adapting the content to your community | The template price, plus hosting |
| Rented game server | A machine with FXServer and txAdmin already installed | The same choice of recipe or template, inside the host's panel | A monthly hosting fee |
If you want to learn how FiveM works, start with the basic recipe below and add a framework later. If you already know what kind of city you want and would rather spend your time on staff and story than on assembling dozens of resources, compare the FiveM server templates we sell first; their installation starts at step 4 of this guide.
Before you start
| Requirement | What to prepare |
| Cfx.re account | Use it for Portal registration and the txAdmin account link. |
| A server host | A local PC for learning, or a host that supports FXServer. Check access to files, the console, firewall settings and backups before choosing a service. |
| A player client | To join this Legacy server, use a legitimate GTA V Legacy installation and the matching FiveM client. GTA V does not need to be installed on the server host. |
| Windows tools | An archive utility that opens .7z files, such as 7-Zip. |
| Linux tools | A non-root account for running FXServer, a download tool and support for extracting .tar.xz archives. Package commands below are for Debian/Ubuntu. |
| A database server | Only for a framework or a template: MariaDB or MySQL, as the framework's own guide requires. The basic recipe needs none. |
No RAM or CPU figure guarantees a player count. Resource code, streamed assets, the database and simultaneous activity all affect demand. Start with a small test configuration and measure it before paying for more capacity.
Where to host your server
You can run FXServer on your own PC, on a rented VPS or dedicated server, or with a game server host that installs it for you. A home PC is fine for building and testing. A public server needs a machine that stays online, has a stable upload and does not expose your home address to every player.
- Your own PC: free and good for learning. Players connect to your home connection's public address, and the server stops when the PC does.
- VPS or dedicated server: full control over files, firewall and database. You maintain the operating system, updates and backups yourself.
- Game server host: FXServer and txAdmin are preinstalled and ports are assigned for you. Check which files, database access and backups the panel gives you before paying.
For the operating system, Cfx.re calls the Linux build of FXServer a courtesy port and says Linux issues are more likely to be fixed on the Windows build. Both work; our Linux vs Windows comparison covers the trade-offs. To weigh rented machines, read VPS or dedicated hardware and the FiveM hosting provider comparison, and plan the monthly total with the server cost budget guide. Linux administrators who prefer containers can run FXServer with the Docker setup.
Choose the Legacy or Enhanced path
The commands below cover GTA V Legacy and FXServer. At the source-review date shown below, Cfx.re describes FiveM for GTAV Enhanced as an early-access release. Enhanced uses separate Cfx Server binaries, including cfx-server.exe on Windows, needs the Microsoft Visual C++ 2017 Redistributable on Windows, and has changes that can require resource or configuration updates.
For Enhanced, read the official migration and breaking-change notes before selecting a framework or moving a server. Check asset, voice and Asset Escrow support for the current release. Our Legacy and Enhanced comparison explains the choice; renaming an executable is not a migration procedure.
Step 1: Create a server registration key
- Open Server registration keys in Cfx.re Portal (
portal.cfx.re/servers/registration-keys) and sign in.
- Under Active, select the + button, fill in the server's Name, Tagline, Description and Language, then select Generate Key.
- Copy the generated key for the txAdmin recipe deployer. In
server.cfg, the corresponding setting is sv_licenseKey.
The old keymaster.fivem.net address now redirects to Cfx.re Portal. The current Cfx.re registration instructions ask for the server's name, tagline, description and language, which also become its public server listing; they do not ask for the first-use public IP described in older Keymaster tutorials. Keep the key out of public repositories, screenshots and shared logs. If it leaks, regenerate it in Portal and update your server configuration.
Step 2: Download the Legacy server files
Use the official Server Download page, select FiveM for GTA V Legacy and your operating system, then download the recommended build. Copy the current download URL from that page rather than reusing a build number from a tutorial.
Windows
- Create
C:\FXServer\server for the server binaries.
- Download
server.7z and extract its contents into that directory.
Linux: Debian/Ubuntu preparation
Install the download and extraction tools with an account allowed to manage packages. Run FXServer itself as your dedicated non-root user.
sudo apt update
sudo apt install ca-certificates wget xz-utils
mkdir -p ~/FXServer/server
cd ~/FXServer/server
wget -O fx.tar.xz 'PASTE_RECOMMENDED_LINUX_URL_HERE'
tar -xf fx.tar.xz
Replace PASTE_RECOMMENDED_LINUX_URL_HERE before running the download command. Stop and resolve any download or extraction error before continuing. For other distributions, use their package manager and check the official Linux setup requirements.
Step 3: Start FXServer and open txAdmin
txAdmin is included with current FXServer builds. Start it without +exec server.cfg; txAdmin manages the server configuration through its setup flow.
- Windows: run
FXServer.exe from the extracted directory.
- Linux: run
bash ~/FXServer/server/run.sh.
Read the console for the setup URL and PIN. The default txAdmin web port is 40120 TCP. On the server machine, open http://127.0.0.1:40120. A managed host may provide its own URL or port.
For a remote host with SSH access, open a tunnel from your own computer, keep it running and visit that same local URL:
ssh -N -L 127.0.0.1:40120:127.0.0.1:40120 user@YOUR_SERVER_IP
Replace the SSH username and server address. Restrict direct access to the admin port through your host's access controls or firewall; a tunnel does not itself close a publicly exposed port. Players do not need access to txAdmin to join.
Step 4: Link your account and deploy a recipe
- Enter the console PIN if needed and select Link Account.
- Authorize the Cfx.re account link, choose a strong backup password and review the agreements shown by txAdmin.
- Enter a server name and choose the deployment type. Popular Recipes is the right choice for a first server.
- Select the Cfx.re default FiveM recipe. Depending on the interface version, it is labelled FiveM Basic Server (Legacy), FiveM Basic Server (CFX Default) or CFX Default FiveM.
- Confirm a separate data directory for the resources and
server.cfg, then open Recipe Deployer.
- Review the recipe, enter your registration key and select Run Recipe.
- Wait for all deployment tasks to finish successfully, review the generated configuration and select Save & Run Server.
The default recipe is a basic server without a roleplay economy. It lets you check the server before introducing framework and database dependencies. If deployment fails, keep the first relevant error from the console and resolve it before retrying. The txAdmin recipe documentation lists every task a recipe can run.
Give staff their own accounts through txAdmin's Admin Manager. Grant only the actions they need: viewing a console, executing commands, editing configuration and managing other admins are separate permissions. Framework roles and server ACE rules require their own configuration.
Since 21 October 2026, the name, description, tags, language and images players see in the server list are set in Cfx.re Portal, no longer in local configuration files (Cfx.re announcement). If a field is empty, the list shows "Missing server data (must be configured in Portal)". You can set up to five tags; the banner is 2560×280 pixels (minimum 1825×200) and the profile image 512×512 (minimum 256×256). A clear server name and a correctly sized server logo are worth settling before you go public.
Step 5: Review server.cfg
Edit the existing values in the configuration generated by the recipe. Keep its resource-start lines. This excerpt illustrates a small test server; it is not a replacement for the complete file:
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
sv_maxclients 8
set onesync on
sv_licenseKey "REPLACE_WITH_YOUR_KEY"
| Setting | Check |
endpoint_add_tcp and endpoint_add_udp | Use the port assigned by your host. The examples use 30120 for both protocols; firewall rules and connection commands must match. |
sv_maxclients | Sets the player cap, not a performance guarantee. More than 48 requires Element Club Argentum or higher. |
| Public name and description | Set in Cfx.re Portal; the old server.cfg values no longer control the public listing. |
sv_enforceGameBuild | Only add a game-build requirement after checking the documentation for your resources and the supported builds for your server branch. |
The server.cfg guide explains every common setting. You can also check your file with the server.cfg builder and checker; compare any generated values against your recipe and host.
Step 6: Open the game port for players
For players on other machines, allow the configured game port through the operating-system firewall and any hosting-provider firewall. The examples below use 30120 TCP and UDP. Keep the separate txAdmin port restricted to administrators.
Windows firewall: PowerShell as administrator
New-NetFirewallRule -DisplayName "FiveM TCP" -Direction Inbound -Protocol TCP -LocalPort 30120 -Action Allow
New-NetFirewallRule -DisplayName "FiveM UDP" -Direction Inbound -Protocol UDP -LocalPort 30120 -Action Allow
Linux: when UFW is already in use
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp
sudo ufw status
Check the resulting rules and preserve the access you use to manage the host. These commands do not configure an upstream firewall or router.
If you host behind a home router, forward the game port for both protocols to the server PC's local address. Confirm that your connection permits incoming public traffic. A public home-hosted server exposes your home connection's public address; choose the hosting location with that in mind.
Step 7: Test local and external connections
Open the Legacy FiveM client, press F8 and use the address that fits your test. Replace the example address labels and port as needed.
| Test | Client command |
| Client and server on the same PC | connect 127.0.0.1:30120 |
| Another PC on the same local network | connect SERVER_LAN_IP:30120 |
| A player outside your network | connect SERVER_PUBLIC_IP:30120 |
For a server on the same PC or network, the official Cfx.re quick-start guide also shows a Connect to [ComputerName] on LAN entry in the FiveM client, and says that pressing F8 and entering tx confirms txAdmin is working.
Join the world, move around, disconnect and reconnect while watching the server console. For a public server, have a player test from a different network; a local join does not test public reachability.
You can also check http://SERVER_PUBLIC_IP:30120/info.json from outside the server network. A JSON response confirms only the HTTP endpoint, not UDP traffic or the full join, so keep the external client test. A new server can take up to 8 minutes to appear in the public server list after launch, according to Cfx.re.
Once these checks pass, back up the working data directory and txAdmin configuration before making further changes.
Step 8: Turn it into a roleplay server
A roleplay server needs a framework: the shared player, job, money and inventory layer that roleplay scripts build on. Choose it around the resources you want to use and the code your team can maintain. Our FiveM framework guide compares the options, and Qbox vs QBCore covers the closest pair.
| Framework | How to install it | Compatibility checkpoint |
| ESX Legacy | txAdmin Popular Recipes | Use ESX-compatible resources and follow the current ESX recipe and database instructions. |
| Qbox | txAdmin Popular Recipes (the Qbox Framework recipe) | Its QBCore bridge covers many resources that use documented interfaces; scripts that access internal tables or files can need changes. Requires MariaDB 10.9 or newer; MySQL and XAMPP are not supported. |
| QBCore | QBCore's own installation guide; the txAdmin index lists its recipe as deprecated | Check that your resources support the QBCore APIs and dependencies of the installed version. |
Prepare the database
Framework recipes store characters, money, items and vehicles in a database. Install the database server the framework's guide requires before you run the recipe, and keep it reachable only from the FXServer machine.
- Install MariaDB (or the database your framework names) on the server machine or a private database host.
- Create a dedicated database user for FXServer that may create a database (the recipe creates one), with a long password that avoids
; , / ? : @ & = + $ #, which can break the oxmysql connection string. Do not use the root account.
- Run a fresh txAdmin setup in a new data directory, choose the framework under Popular Recipes and enter the database host, port, user and password when the recipe deployer asks. The recipe creates its own database; txAdmin generates its name.
- After the first start, create a character, disconnect and reconnect to confirm that the character was saved.
The connection string ends up in server.cfg (as mysql_connection_string for oxmysql). Keep that file private. If the server cannot reach the database, check host, port, user, password and whether the database service is running. Older resources written for mysql-async need the oxmysql replacement.
Or start from a server template
A server template (also called a server pack) is a complete server data folder: a framework, configured scripts, maps, vehicles and a database file that someone has already assembled and tuned together. It replaces the work of choosing and wiring dozens of resources. It does not replace hosting, your own registration key, your own database credentials or testing.
Installing one follows the same steps as above, with the template's files in place of a framework recipe:
- Complete steps 1 to 3 of this guide on a fresh server.
- Read the template's readme for its framework version, game build and dependencies.
- Deploy it the way its readme says: its own recipe, or the template's server data folder as existing server data.
- Import the template's fresh-install SQL into a new, empty database.
- Set your own registration key, database connection string and server identity; never reuse webhook URLs or API keys from an example config.
- Run the connection tests from step 7, then test characters, items, jobs, vehicles and a full restart.
Our server pack installation docs and the guide to installing and verifying a server template cover each step in detail, including what to check before launch. Before you buy, read how to evaluate a complete server: ask for the framework build, the resource list and the database file, and keep the delivery on a test server until it passes.
RPScripts sells server templates; our server pack comparison lists each one's framework, documented contents and requirements, including QBCore server packs and ESX server packs.
Step 9: Add and maintain resources
The short version is below. How to install a FiveM script step by step covers manifests, SQL imports, escrow and rollback in detail, and the checklist of essential scripts for a new server helps you decide which systems to add first.
- Check each resource's source, server-branch compatibility, framework requirements and dependencies.
- Place it in the recipe's
resources/ directory, for example resources/[local]/example_resource. Inspect its supplied fxmanifest.lua and installation instructions.
- Add
ensure example_resource after its required dependencies in server.cfg.
- Test one addition at a time and read the first startup or gameplay error.
Vehicles add streamed assets and their own steps; see installing custom cars. Only install resources from sources you trust: leaked or modified files can carry hidden code that gives a stranger control of your server. Scan unknown code with the FiveM backdoor scanner before you start it. For custom gameplay scripts, validate sensitive actions on the server using server-side permissions and state. Client-side checks alone cannot protect item grants, payments or privileged actions.
Step 10: Secure, back up and update
Before you invite the public, set up these routines.
Before you go public
Decide between an open server and an application process; a FiveM whitelist admits only approved players. Publish clear server rules before the first players join. Getting listed in the Cfx.re server list is a separate check from a direct connection.
Cfx.re names Tebex its exclusive monetization partner and prohibits other payment platforms. Read its Tebex guidance and linked policies and our monetization guide before selling perks.
How do I make a private FiveM server for friends?
The Cfx.re server command reference has no setting for a join password (its only password settings are for RCon and the metrics endpoint), so a friends-only server combines these options:
- A txAdmin allowlist: the Cfx.re txAdmin documentation lists a whitelist system (called the allowlist in current txAdmin) with four modes: Discord member, Discord Role, Approved License and Admin-only. Choose the mode that matches how your group is organized.
- Private in the server list: the line
sv_master1 "" marks the server as private. The default txAdmin recipe's server.cfg does not contain it, so add it; in a file where it is commented out with #, remove the #. Cfx.re says the connect button in the server browser is then disabled, while the server is not removed from the list. Friends join with F8 and connect, and so can anyone else who has the address, so pair it with a whitelist.
- LAN only (same network):
sv_lan true makes the server LAN-only. According to Cfx.re, it does not appear in the public server list and license key checks are skipped. Use it only when everyone plays on the same local network, and do not open the game port for a LAN-only server: per FiveM's server source code, sv_lan also skips the Cfx.re ticket check that authenticates joining players.
Each friend still needs a legitimate copy of GTA V and the FiveM client. With the first two options, friends outside your network need the open game port from step 6.
Troubleshooting
| Symptom | What to check next |
no license key was specified | Check sv_licenseKey in the configuration actually loaded by txAdmin. For a manual launch, also check the data directory and +exec server.cfg; do not add that argument to the txAdmin startup command. |
Failed to start resource | Read the preceding error. Check the resource folder, manifest, dependencies and start order; the message alone does not identify one cause. |
| Connection times out or is refused | Confirm that FXServer is running, then check the selected address, both game-port protocols, host firewall and router or provider rules. |
| Direct connection works but the server is absent from the list | Wait up to 8 minutes after launch. Check the Portal metadata, that sv_master1 "" is commented out (otherwise the server shows as private and the connect button is disabled), and whether your router or NAT rewrites UDP source ports. |
| The recipe or server cannot connect to the database | Check that the database service runs, then host, port, user and password in the connection string. Confirm the user may connect from the FXServer machine. |
| txAdmin cannot be reached | Check the URL and port printed by the console, the process and your admin-access rules. 127.0.0.1 in a browser refers to the machine running that browser unless you have set up the tunnel above. |
| FXServer stops responding | Inspect logs around the first failure, recent resource changes and host CPU, memory and storage usage. Keep that evidence before restarting. |
For further diagnosis, use the FiveM error guide and the official server-issues documentation below.
Common questions
Is it free to make a FiveM server?
Yes. FXServer, txAdmin, the default recipe and a server registration key cost nothing, and a server can use up to 48 player slots without a subscription. You pay for what runs it: your own electricity and connection, or a rented server. Budget separately for any licensed resources and Cfx.re subscriptions the features you choose require; paid scripts, maps and server templates are optional.
How many players can a FiveM server hold?
Up to 48 slots without a subscription; higher Element Club tiers raise the limit. Whether your server stays smooth at that number depends on its resources, assets, database and hardware, so test with real players and watch the server's resource monitor before raising sv_maxclients.
Can I make a FiveM server without port forwarding?
For players on your own network, yes. For players elsewhere, the game port has to be reachable from the internet: forward it on your router, or rent a server or game server host where the port is already open.
Should I build my own server or start from a template?
Build your own if you want to learn the stack and choose every resource. A template is faster when you know which framework and style you want, and it still needs your hosting, credentials and a full test before launch. You can also do both: learn on the basic recipe, then launch on a tested template.
Do I need GTA V on the server?
No. FXServer runs without GTA V. Each player needs a legitimate copy of GTA V on PC and the FiveM client; FiveM is not available on consoles.
Should I use Windows or Linux?
Choose an operating system your host supports and your team can administer. This guide gives both Legacy startup paths. Cfx.re provides the Linux build as a courtesy port; problems are more likely to be fixed on Windows.
How long does setup take?
A basic recipe can be running once the download and the registration key are ready. Framework configuration, database setup, resource testing and a tested restore take most of the time before a public launch.
Sources
Technical source review: 2 November 2026; the private-server options, quick-start guide and registration-key location rechecked 16 November 2026. This article was checked against the linked documentation; the commands were not executed on a test server for this review.