FiveM
How to start a FiveM server step by step
From the licence key on the Cfx.re portal through txAdmin and choosing a recipe to the database, first restart and inviting players. A walkthrough for your first FiveM server.
6 min readBlazeHost
Thanks to txAdmin, starting your own FiveM server is much easier than it used to be, but it still consists of several steps that build on each other: a licence key, hosting, txAdmin's first run, a recipe with a framework, a database and configuration. This guide walks you through every step in the order you will do them and points out the most common mistakes along the way.
1. What you will need
- A legitimate copy of GTA V — not for the server, but for every player. The FiveM client runs on top of the installed game, and without it nobody can connect, including you.
- A Cfx.re account — the same account signs you in to portal.cfx.re, the forum and txAdmin.
- A server — your own machine, a VPS or game hosting. We cover the choice below.
- A MySQL or MariaDB database if you want a roleplay framework such as ESX or QBCore. A plain server without a framework can do without one.
2. A licence key from the Cfx.re portal
Every FiveM server needs its own licence key. Sign in to portal.cfx.re, create a new key in the server registration section and enter the IP address of the server it will run on. The key is free, and you will later enter it in txAdmin or in server.cfg as sv_licenseKey. Don’t share the key and don’t commit it to public repositories.
3. Where the server will run
The server side of FiveM (FXServer) runs most script work on its main thread, so what matters most is single-core CPU performance, enough memory and fast storage. A home PC is fine for testing, but a community needs a machine that runs 24/7, has a public IP address and DDoS protection. What to ask when choosing is covered in How to choose FiveM hosting.
As a memory guide: the advisor on our FiveM plans page uses a starting point of roughly 2 GB for a standalone server, 4 GB for ESX and 5 GB for QBCore, then adds headroom for player count and resource weight. The estimate assumes one server instance and the database on the same machine. With us the server runs on AMD Ryzen 9 5900X CPUs with NVMe SSDs in Frankfurt am Main, you manage it in the Pterodactyl panel, and txAdmin and a MySQL database are included with the service.
4. txAdmin's first run
txAdmin is a web interface for server management that ships with FiveM server builds. On first start it prints the interface address and a one-time PIN to the console. Open the address in a browser, enter the PIN and choose Link Account — this links txAdmin to your Cfx.re account, which becomes the master account. You then set a backup password in case signing in via Cfx.re ever fails. On our hosting you first need to give txAdmin its own port; the steps are in the Database and txAdmin guide.
5. Choosing a recipe
The setup wizard asks for a server name and a deployment type. The simplest option is Popular Recipes. A recipe is a script that downloads a framework and base resources and prepares server.cfg. The list changes over time; typically you will find:
| Recipe | What you get | Database |
|---|---|---|
| CFX Default | A clean server with base resources | Not needed |
| ESX Legacy | The ESX roleplay framework with economy and jobs | Required |
| QBCore | The QBCore roleplay framework | Required |
If you are deciding between frameworks, see ESX vs QBCore vs Qbox. In the next step (Recipe Deployer) you enter your licence key, and for framework recipes the database details too, then start the deployment with Run Recipe.
6. The MySQL database and oxmysql
Both ESX and QBCore talk to the database through the oxmysql library. It reads credentials from the mysql_connection_string convar in server.cfg. The recipe usually fills it in from the details you enter; if you set it by hand, two formats are supported:
set mysql_connection_string "mysql://user:password@host:3306/database"
# or
set mysql_connection_string "user=user;password=password;host=host;port=3306;database=database"If the password contains characters such as @, :, / or ;, one of the formats may fail — try the other one or change the password. After the server starts, check the console to confirm oxmysql connected successfully.
7. server.cfg basics
server.cfg is the server's main configuration. You can edit it in txAdmin or via the file manager. The most important lines:
sv_hostname "My RP server"
sets sv_projectName "My RP server"
sets sv_projectDesc "A roleplay community"
sets tags "roleplay, esx"
sets locale "en-US"
sv_maxclients 32
set onesync on
sv_licenseKey "your_key"sv_hostnameandsv_projectName— the name in the server list.sets tagsandsets locale— tags and language that help players find you in search.sv_maxclients— the maximum player count. Above 32 you need OneSync; the terms for higher slot counts are set by Cfx.re (see the OneSync documentation).set onesync on— enables OneSync, which modern frameworks expect.
The full list of commands and convars is in the official documentation. On hosting with a panel, some values (key, player count, name) may also be set as server startup variables. If a change in server.cfg has no effect, check those too.
8. Adding resources and ensure order
Upload new scripts to the resources folder (subfolders in square brackets, such as [jobs], are just for grouping) and start them in server.cfg with ensure. Order matters: a resource must start after everything it depends on.
ensure oxmysql
ensure ox_lib
ensure es_extended
ensure [jobs]
ensure my_scriptDatabase library first, then shared libraries, then the framework, and finally scripts that use the framework. Errors such as “dependency not found” or nil values from the framework after startup usually mean wrong order or a missing dependency.
9. First restart and connecting
After making changes, restart the server and go through the console: look for red errors, a failed database connection and resources that did not start. When everything is fine, connect. In FiveM open the console with F8 and type:
connect ip_address:portYou can then share a link in the form cfx.re/join/xxxxxx, which the server gets once its licence key is verified. To find out which address such a link points to, use our Cfx resolver tool.
10. Updating artifacts and backups
Artifacts are the FXServer server binaries. Cfx.re releases new builds continuously and the artifacts page marks a recommended build. Newer versions bring fixes, but some older scripts may need a specific build — so update deliberately and test everything afterwards. How to change the version in our panel is covered in the FiveM artifacts guide.
Take a backup before every bigger change. With us the server, database included, is backed up automatically every night (last 5 days kept), and you start a manual backup in the panel (panel basics). Also export the database to an SQL file regularly so player characters and inventories are stored outside the server too. If the configuration breaks so badly that starting over is easier, see the guide on reinstalling a FiveM server.
Summary
The process is always the same: a licence key from portal.cfx.re, a server with enough performance, txAdmin’s first run with the PIN and Cfx.re account link, a recipe with a framework, the database via oxmysql, editing server.cfg and getting the ensure order right. Then restart, check the console and connect via F8. Once the server is running, keep up with backups and careful artifact updates. A ready environment with txAdmin and a database is available in our FiveM plans.
FiveM servers on our own hardware in Frankfurt
txAdmin, a MySQL database and DDoS protection included.