This guide covers how to install resources (scripts) on your FiveM server, set up a MySQL database for frameworks like ESX or QBCore, and understand resource load order. If you have not yet completed initial server setup, start with the FiveM Server Setup Guide first.
server.cfg. See the FiveM Server Setup Guide for initial setup steps.
Installing Resources and Scripts
FiveM servers are extended with resources (also called scripts). Resources add features like car dealers, jobs, HUD elements, frameworks, and more.
How to Install a Resource
- Download the resource from its source (GitHub, Cfx.re forums, Tebex, etc.).
- Extract the resource folder from the ZIP/archive if needed.
- Upload the resource folder to your server's
resources/directory using the GPanel Files tab or via SFTP. - Open
server.cfgand add anensureline for the resource:
# Add your custom resources
ensure my-new-resource
- Restart the server from GPanel or TXAdmin for the resource to load.
ensure line must exactly match the resource folder name (case-sensitive). If the folder is my-cars, the line must be ensure my-cars.
Resource Manifests
Every valid resource must contain a manifest file. Modern resources use fxmanifest.lua, while older ones use __resource.lua. If a downloaded resource folder does not contain either of these files, the resource will not load. Some downloads nest the actual resource folder inside an outer folder — make sure the folder you place in resources/ is the one that contains the manifest.
Resource Load Order
Resources load in the order they appear in server.cfg. If a resource depends on another (for example, a job script that depends on a framework like ESX or QBCore), ensure the dependency is listed before the resource that needs it:
# Database resource first
ensure oxmysql
# Framework second
ensure es_extended
# Then resources that depend on the framework
ensure esx_basicneeds
ensure esx_jobs
ensure esx_vehicleshop
Organising Resources with Category Folders
You can organise resources into subfolders inside the resources/ directory. Use bracket notation in server.cfg to ensure an entire category folder:
# Ensure all resources inside resources/[esx]/
ensure [esx]
# Ensure all resources inside resources/[standalone]/
ensure [standalone]
This loads every resource within the named subfolder. It is a convenient way to group related scripts without listing each one individually.
Hot-Loading Resources via TXAdmin
You do not always need a full server restart to load a new resource. TXAdmin can start, stop, and restart individual resources from its Resources page. After uploading a new resource and adding its ensure line, you can run the following command in the TXAdmin live console:
refresh
ensure my-new-resource
The refresh command tells the server to rescan the resources/ directory for new entries.
Database Setup (MySQL / MariaDB)
Many FiveM frameworks and resources (such as ESX, QBCore, or vRP) require a MySQL or MariaDB database. Legion Hosting provides database credentials with your server.
Finding Your Database Credentials
- In GPanel, go to the Databases tab.
- If no database exists yet, click New Database to create one.
- Note down the following details:
- Database Host (address and port)
- Database Name
- Username
- Password (click the eye icon to reveal it)
Configuring the Database Connection
Database connection details are set in server.cfg using a connection string. The exact format depends on which MySQL resource you are using, but the most common format is:
# MySQL connection string (oxmysql / mysql-async format)
set mysql_connection_string "mysql://USERNAME:PASSWORD@HOST:PORT/DATABASE_NAME?charset=utf8mb4"
Replace the placeholders with your actual credentials from the Databases tab. For example:
set mysql_connection_string "mysql://u123_fivem:[email protected]:3306/s123_fivem?charset=utf8mb4"
localhost or 127.0.0.1.
@, #, or %, you must URL-encode them in the connection string. For example, @ becomes %40 and # becomes %23.
Choosing a MySQL Resource
| Resource | Status | Notes |
|---|---|---|
| oxmysql | Recommended | Modern, actively maintained, best performance. Used by most current frameworks. |
| mysql-async | Legacy | Older but still works. Some older scripts depend on it specifically. |
| ghmattimysql | Legacy | Another older option. Check your framework's documentation if it requires this. |
Whichever MySQL resource you use, it must be ensured in server.cfg before any resources that depend on it:
# Database connection
set mysql_connection_string "mysql://USERNAME:PASSWORD@HOST:PORT/DATABASE_NAME?charset=utf8mb4"
# MySQL resource — must load before framework
ensure oxmysql
# Framework
ensure es_extended
Framework Basics
A framework provides the core gameplay systems that other resources build on — things like player identity, money, inventory, jobs, and vehicles. The two most popular FiveM frameworks are:
| Framework | Resource Name | Description |
|---|---|---|
| ESX | es_extended |
The most widely used framework. Large ecosystem of free and paid scripts. Good for roleplay servers. |
| QBCore | qb-core |
Modern alternative to ESX. Cleaner codebase, active development. Growing script ecosystem. |
Most frameworks are installed via TXAdmin's recipe system during initial setup. If you chose a recipe like "QBCore" or "ESX" during TXAdmin setup, the framework and its core dependencies are already installed. If you need to install a framework manually, follow its official documentation:
Getting Help
If you need assistance with resource installation or database configuration:
- Check the resource's documentation or GitHub page for installation instructions and known issues.
- Review the GPanel console or TXAdmin logs for error messages.
- Open a support ticket at https://legionhosting.net/submitticket.php with your error messages and the name of the resource you are trying to install.