GamingAugust 4, 20264 min read

How to Add Resources to a FiveM Server

Install frameworks and resources on your FiveM server the right way: folder structure, ensure lines, dependencies, ESX/QBCore, and database setup.

NBy Nxeon

Resources are what turn a bare FiveM server into a real roleplay city — jobs, inventory, vehicles, HUDs, and full frameworks like ESX and QBCore. This guide shows how to add resources correctly so they load, in the right order, without breaking your server. If you're just starting, set up the server first with our FiveM setup guide.

How resources are structured

Every resource is a folder inside your server-data resources directory, containing an fxmanifest.lua (or older __resource.lua) that declares its scripts and dependencies. To load a resource, you drop its folder in and add an ensure line in server.cfg.

You can group resources in bracketed folders like [esx] or [jobs] — FiveM loads everything inside [...] folders automatically, which keeps large servers organized.

resources/
  [system]/
    es_extended/
    oxmysql/
  [jobs]/
    esx_policejob/
    esx_ambulancejob/
  my-custom-resource/

Step 1: Add a resource folder

Clone or copy the resource into resources. For example, the oxmysql database connector:

cd ~/FXServer/server-data/resources
git clone https://github.com/overextended/oxmysql.git
The Nxeon control panel showing live CPU, memory, and network metrics for a VPS
The Nxeon control panel showing live CPU, memory, and network metrics for a VPS

Step 2: Set up the database (for framework resources)

Frameworks like ESX and QBCore need MySQL/MariaDB. Install it and create a database:

sudo apt update
sudo apt install -y mariadb-server
sudo mysql -e "CREATE DATABASE es_extended CHARACTER SET utf8mb4;"
sudo mysql -e "CREATE USER 'fivem'@'localhost' IDENTIFIED BY 'strong-password';"
sudo mysql -e "GRANT ALL ON es_extended.* TO 'fivem'@'localhost'; FLUSH PRIVILEGES;"

Import the framework's SQL file, then set the connection string in server.cfg:

set mysql_connection_string "mysql://fivem:strong-password@localhost/es_extended?charset=utf8mb4"

Step 3: Add ensure lines in the right order

Order matters — dependencies must load first. A typical ESX stack:

ensure oxmysql
ensure es_extended
ensure esx_menu_default
ensure esx_menu_dialog
ensure esx_menu_list
ensure esx_policejob
ensure esx_ambulancejob

The database connector (oxmysql) loads before the framework (es_extended), which loads before job resources that depend on it. If you put a dependent resource before its dependency, it will error out on start.

Step 4: Check dependencies in fxmanifest.lua

Open a resource's fxmanifest.lua to see what it needs:

fx_version 'cerulean'
game 'gta5'

dependencies {
  'es_extended',
  'oxmysql'
}

server_scripts {
  '@oxmysql/lib/MySQL.lua',
  'server/main.lua'
}

The dependencies block tells you exactly what must load first. Follow it and your ensure order will be correct.

Step 5: Restart and read the console

After adding resources, restart the server and watch the console. Errors name the failing resource and usually the cause — a missing dependency, a SQL error, or a bad ensure order. Fix them one at a time. For safe scheduled restarts, use automate game server restarts with systemd and cron.

Keeping resources safe and updated

  • Only install resources from trusted sources — malicious resources can steal data or backdoor your server.
  • Update via git pull and re-import any SQL changes.
  • Keep a backup of your database and resources folder; see how to back up your game server automatically.

For the meaning of every ensure, set, and convar line you'll touch, read how to configure a FiveM server (server.cfg explained). As your resource list grows, revisit Game Server Specs Explained to make sure your box keeps up.

Writing a simple custom resource

Once you understand the structure, a basic resource is just a folder with a manifest and a script. Create resources/[local]/hello/fxmanifest.lua:

fx_version 'cerulean'
game 'gta5'
server_script 'server.lua'

And server.lua:

RegisterCommand('hello', function(source)
  print('Hello from a custom resource, player ' .. source)
end)

Add ensure hello to server.cfg, restart, and type hello in the server console. From here you can build jobs, commands, and events.

Updating and securing resources

  • Update with git: git pull in the resource folder, re-import any SQL, and restart the resource.
  • Vet everything: only run resources from sources you trust — a malicious resource can exfiltrate data or backdoor your server. Treat heavily obfuscated code with suspicion.
  • Back up the database before importing SQL migrations so a bad import doesn't wipe player data — see how to back up your game server automatically.

If resource B depends on A, ensure A first — the console names the missing dependency at startup, so fix them top to bottom.

FAQ

Why does a resource fail to start?

Usually a missing dependency, wrong ensure order, or a database/SQL problem. The console names the failing resource — read the error and load its dependencies first.

Do I need a database for every resource?

No — only frameworks and resources that persist data (inventory, characters, economy) need MySQL/MariaDB. Simple resources run without one.

What are the [bracket] folders for?

Folders named like [esx] are category folders; FiveM auto-loads all resources inside them. They keep large servers organized but don't change load behavior.

ESX or QBCore — which framework?

Both are popular and capable. QBCore is modular and modern; ESX has a huge resource ecosystem. Pick one and stick with it — mixing frameworks causes conflicts.

Build out your RP city on an NVMe game server VPS from Nxeon with full root access, plenty of RAM for a big resource stack, and free migration help if you're moving servers.

#fivem#resources#esx#qbcore#game servers#seobatch

Deploy your first server in under a minute

Creating an account is free and takes no card details. You pay when you deploy — choose a billing term and pay from your wallet or by card at checkout.