Halloween Edition36 maps, limited runlimited runShop the drop
Chapter 01 of 17The Server Handbook for FiveM

How a FiveM server works

In short

A FiveM server is FXServer — the Cfx.re server program — running a folder of resources and a server.cfg. Knowing which part does what makes every later chapter easier.

PartWhat it isWhere it lives
ArtifactsThe FXServer build itself, published by Cfx.reC:\FXServer\server or ~/FXServer/server
Server dataYour resources, server.cfg and cacheserver-data/ (with txAdmin: the folder you choose)
ResourcesFolders with an fxmanifest.lua: scripts, maps, vehicles, UIserver-data/resources/
server.cfgStartup commands: endpoints, name, slots, resources, permissionsserver-data/server.cfg
txAdminWeb panel bundled with the artifactsPort 40120, data in txData/
Server keyLinks the server to your Cfx.re accountsv_licenseKey in server.cfg
DatabaseWhere frameworks store players, money and itemsMariaDB/MySQL through oxmysql

Players connect to your IP on port 30120. The server tells each client which resources to download — scripts, streamed models and textures, UI files — then runs server scripts on the server and client scripts on every player’s PC. The server also sends a heartbeat to the Cfx.re server list, which is how players find you.

Scripts come in halves. Server scripts are authoritative: they can read the database, secrets and every player. Client scripts run on each player’s PC: they draw the world, read input and show UI. Anything that runs on a player’s PC can be modified, so money, items and permissions are always decided on the server — see security hardening.

The Server Handbook for FiveM

This chapter is one of 17. The handbook also carries the console command and convar cheat sheets, a glossary and the official references every chapter is checked against.

Open the handbook