Running your own FiveM server is one of the most rewarding things you can do with GTA V. You control the rules, the scripts, the player experience. But the setup has a specific order, and skipping a step usually means backtracking later. This guide walks you through every stage, from getting a license key to connecting with your first players.
What you need before you start
Three things are required before you touch any server files:
- A Cfx.re account. Register at forum.cfx.re if you do not have one. This account is tied to your server identity and your txAdmin login.
- A license key from keymaster.fivem.net. Log in with your Cfx.re account, create a new key and enter your server's IP address. If you do not know the IP yet, select the option to fill it in later. Keep the key private: sharing it can get it revoked.
- A server to run on. You need a machine with at least 2 GB of RAM for testing and 4 to 8 GB for a public roleplay server. HostValues FiveM hosting runs on AMD Ryzen 9 7950X hardware with NVMe storage; your IP and ports are ready as soon as the service is delivered.
Step 1: the server.cfg file
The file server.cfg is where your entire server configuration lives. Every resource, every permission, every endpoint starts here. The four lines that every config needs:
endpoint_add_tcp "0.0.0.0:30120"andendpoint_add_udp "0.0.0.0:30120"to bind the default port.sv_licenseKey "your_key_here"with the key from the Keymaster.sv_hostname "My Server"with the name that shows in the server list.sv_maxclients 48with a slot count your hardware can handle.
You also give yourself admin rights with an add_principal line tied to your FiveM identifier, and you load resources with ensure (not start). The ensure command restarts a resource cleanly if it is already running, which avoids ghost states when you reload scripts during development.
Step 2: understanding the resources folder
Everything your server does lives in the resources folder. Each resource is a subfolder containing a fxmanifest.lua that declares which scripts run on the client side and which on the server side. Folders wrapped in square brackets like [core] or [jobs] are purely for organization; they do not change how resources load.
The order in server.cfg matters. Your framework must be loaded before any script that depends on it, and your database connector (usually oxmysql) before anything that queries the database.
Step 3: choosing a framework
The framework determines how players, money, jobs and inventory work. In 2026 the realistic options are:
- ESX: the largest script library, the most community resources, and the lowest barrier to entry. A solid choice if you want to assemble your server from individual scripts.
- Qbox: the modern successor to QBCore. It runs almost all QBCore scripts while being actively maintained. Recommended for new roleplay servers that you plan to run long-term.
- Standalone: no framework at all. Only practical for drift servers, race maps or minigames where roleplay mechanics are not needed.
Pick one and commit. Scripts written for ESX do not work on Qbox and vice versa. Switching later means rebuilding from scratch. For a deeper comparison, see ESX vs QBCore vs Qbox.
Step 4: connecting the database
Both ESX and Qbox store player data in MySQL or MariaDB. The steps are the same for either framework:
- Create a database and note the username, password and database name. On HostValues a database is included with every FiveM plan.
- Import the SQL file that ships with your framework to create the required tables.
- Place the
oxmysqlresource in your resources folder andensureit before everything else. - Add the connection string to
server.cfg:set mysql_connection_string "mysql://user:password@localhost/dbname?charset=utf8mb4"
A failed database connection is the most common reason a server starts and immediately shuts down again. If you see database errors in the console, check this line first.
Step 5: setting up txAdmin
txAdmin ships with the FiveM server artifacts and gives you a web panel to start, stop and restart the server, view the live console, manage players and schedule automatic restarts. On first launch the console prints a link with a PIN code. Walk through that setup once, link your Cfx.re account, and from that point you can manage the server entirely through your browser. For a detailed walkthrough, see txAdmin setup guide.
Schedule a restart every six to twelve hours. It keeps memory usage in check and catches small script leaks before they affect players.
Step 6: connect and test
Start the server and watch the console for errors. Once everything loads cleanly, open FiveM on your PC, press F8 and type connect your.server.ip:30120. If that works, invite a few friends to test before you make the server public. Bugs that stay hidden with one player often surface immediately with five.
What to do next
With the base in place, you can start adding scripts: a car dealer, a police job, custom vehicles, interiors. Add them one at a time and test after each addition. Trying to install thirty resources at once and then debugging why the server crashes is a frustrating experience.
How much RAM does a FiveM server need?
A bare server without a framework runs on 2 GB. A roleplay server with a framework, a database and a moderate set of scripts needs 4 to 8 GB. Large servers with 64 or more slots, many custom vehicles and streamed interiors should start at 16 GB. Single-thread CPU speed matters more than core count for FiveM, which is why HostValues runs on high-clock AMD Ryzen 9 7950X processors.
Can I switch frameworks later?
In theory yes, in practice no. Every script, every database table and every piece of player data is tied to the framework. Switching means rebuilding the server and wiping player progress. Choose carefully before you begin.
Do I need to know how to code?
Not to get started. Installing a framework and adding community scripts requires no programming. Writing your own scripts or modifying existing ones does require Lua (or JavaScript/C#), but you can get a fully functional server running without writing a single line of code.
All FiveM plans at HostValues include a database, NVMe storage, DDoS protection and txAdmin access out of the box.