Skip to content

10% off shop orders, applied at checkoutBlack Friday: 20% off until Nov 30, applied at checkoutServer packs

RPScripts

How to Create a FiveM Server: Free Setup, Templates and Hosting

By Luke

How to Create a FiveM Server: txAdmin Setup (2026)
On this page

You can create a FiveM server for free: the server software, txAdmin and the Cfx.re 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:

  1. Create a server registration key in Cfx.re Portal.
  2. Download the recommended FXServer build for your operating system.
  3. Start FXServer and open txAdmin on port 40120.
  4. Link your Cfx.re account and deploy a recipe.
  5. Open game port 30120 (TCP and UDP) for players.
  6. Join with F8 and connect, first locally, then from another network.
  7. 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.

PathWhat you getWhat you still doCost
Basic recipeAn empty FiveM server with the Cfx.re default resourcesEverything after the first connection: framework, database, scripts, mapsFree, plus your hardware or hosting
Framework recipeESX Legacy or Qbox with its core resources and a fresh databaseChoose and configure jobs, inventory, phone, housing, vehicles and maps yourselfFree, plus a database server and hosting
Server templateA framework with preconfigured scripts, maps and a database file, assembled by someone elseHosting, your own keys and credentials, testing, and adapting the content to your communityThe template price, plus hosting
Rented game serverA machine with FXServer and txAdmin already installedThe same choice of recipe or template, inside the host's panelA 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

RequirementWhat to prepare
Cfx.re accountUse it for Portal registration and the txAdmin account link.
A server hostA 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 clientTo 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 toolsAn archive utility that opens .7z files, such as 7-Zip.
Linux toolsA 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 serverOnly 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

  1. Open Server registration keys in Cfx.re Portal and sign in.
  2. Choose the option to generate a key, enter a display name and confirm.
  3. 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 use a display name; 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

  1. Create C:\FXServer\server for the server binaries.
  2. 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.

  1. Enter the console PIN if needed and select Link Account.
  2. Authorize the Cfx.re account link, choose a strong backup password and review the agreements shown by txAdmin.
  3. Enter a server name and choose the deployment type. Popular Recipes is the right choice for a first server.
  4. 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.
  5. Confirm a separate data directory for the resources and server.cfg, then open Recipe Deployer.
  6. Review the recipe, enter your registration key and select Run Recipe.
  7. 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.

Public server metadata in Cfx.re Portal

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"
SettingCheck
endpoint_add_tcp and endpoint_add_udpUse the port assigned by your host. The examples use 30120 for both protocols; firewall rules and connection commands must match.
sv_maxclientsSets the player cap, not a performance guarantee. More than 48 requires Element Club Argentum or higher.
Public name and descriptionSet in Cfx.re Portal; the old server.cfg values no longer control the public listing.
sv_enforceGameBuildOnly 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.

TestClient command
Client and server on the same PCconnect 127.0.0.1:30120
Another PC on the same local networkconnect SERVER_LAN_IP:30120
A player outside your networkconnect SERVER_PUBLIC_IP:30120

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.

FrameworkHow to install itCompatibility checkpoint
ESX LegacytxAdmin Popular RecipesUse ESX-compatible resources and follow the current ESX recipe and database instructions.
QboxtxAdmin 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.
QBCoreQBCore's own installation guide; the txAdmin index lists its recipe as deprecatedCheck 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.

  1. Install MariaDB (or the database your framework names) on the server machine or a private database host.
  2. 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.
  3. 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.
  4. 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:

  1. Complete steps 1 to 3 of this guide on a fresh server.
  2. Read the template's readme for its framework version, game build and dependencies.
  3. Deploy it the way its readme says: its own recipe, or the template's server data folder as existing server data.
  4. Import the template's fresh-install SQL into a new, empty database.
  5. Set your own registration key, database connection string and server identity; never reuse webhook URLs or API keys from an example config.
  6. 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.

  1. Check each resource's source, server-branch compatibility, framework requirements and dependencies.
  2. Place it in the recipe's resources/ directory, for example resources/[local]/example_resource. Inspect its supplied fxmanifest.lua and installation instructions.
  3. Add ensure example_resource after its required dependencies in server.cfg.
  4. 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.

Troubleshooting

SymptomWhat to check next
no license key was specifiedCheck 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 resourceRead 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 refusedConfirm 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 listWait 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 databaseCheck 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 reachedCheck 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 respondingInspect 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. This article was checked against the linked documentation; the commands were not executed on a test server for this review.