How to Install ESX or QBCore on Your FiveM Server
ESX vs QBCore: Which to Choose?
ESX Legacy
Advantages:
- Very large and established community
- Tons of available scripts
- Complete documentation
- Stable and proven
- Easy for beginners
Disadvantages:
- Sometimes outdated code
- Less optimized than QBCore
- More rigid structure
QBCore
Advantages:
- Modern and optimized code
- Better performance
- Modular structure
- Frequent updates
- Highly customizable
Disadvantages:
- Smaller community
- Fewer scripts available
- Steeper learning curve
Prerequisites
- Working FiveM server
- txAdmin installed (recommended)
- FTP or file manager access
- MySQL/MariaDB database
- Basic FiveM knowledge
Part 1: Installing ESX Legacy
Step 1: Download ESX Legacy
- Go to https://github.com/esx-framework/esx_core
- Click Code then Download ZIP
- Extract the ZIP file on your computer
Step 2: Prepare the Database
Create the Database
- Log in to your game panel
- Go to Databases or MySQL
- Create a new database:
- Name:
esx_legacy - User: Create a user with all privileges
- Password: Write it down carefully
- Name:
Import the SQL File
- Open phpMyAdmin or your MySQL manager
- Select the
esx_legacydatabase - Click Import
- Import the
esx_core.sqlfile (in the downloaded folder)
Step 3: Install the Files
Folder Structure
In your resources folder, create the following structure:
resources/
└── [esx]/
├── es_extended/
├── esx_menu_default/
├── esx_menu_dialog/
├── esx_menu_list/
└── esx_context/
Upload the Resources
- Connect to your FTP or file manager
- Go to the
resourcesfolder - Create a folder
[esx](with brackets) - Upload all ESX folders into
[esx]/
Step 4: Configure MySQL Connection
Open the server.cfg file and add:
# MySQL Configuration for ESX
set mysql_connection_string "mysql://username:password@localhost/esx_legacy?charset=utf8mb4"
# Alternative with separate parameters
set mysql_connection_string "user=username;password=password;host=localhost;port=3306;database=esx_legacy"
Replace:
username: Your MySQL usernamepassword: Your MySQL passwordlocalhost: Your database addressesx_legacy: Your database name
Step 5: Configure server.cfg
Add these lines to server.cfg:
# ESX Legacy
ensure es_extended
ensure esx_menu_default
ensure esx_menu_dialog
ensure esx_menu_list
ensure esx_context
# Essential ESX Resources
ensure esx_skin
ensure esx_identity
ensure esx_basicneeds
ensure esx_optionalneeds
Step 6: Install ESX Base Resources
Download and install these essential resources:
esx_skin (character appearance):
esx_identity (character creation):
esx_basicneeds (hunger/thirst):
Place them all in the [esx]/ folder
Step 7: ESX Configuration
Open [esx]/es_extended/config.lua:
Config = {}
Config.Locale = 'en' -- Language (en, fr, de, etc.)
Config.Accounts = {
'bank',
'black_money',
'money'
}
Config.StartingAccountMoney = {
bank = 50000,
money = 5000,
black_money = 0
}
Config.StartingInventoryItems = false
Config.EnableDebug = false -- Disable in production
Config.EnableDefaultInventory = true
Config.MaxWeight = 30
Config.MaxWeaponWeight = 3000
Config.PaycheckInterval = 7 * 60000 -- Salary every 7 minutes
Step 8: Test ESX
- Restart your FiveM server
- Connect to the server
- You should see the character creation screen
- Check the console for errors
Part 2: Installing QBCore
Step 1: Download QBCore
- Go to https://github.com/qbcore-framework/qb-core
- Click Code then Download ZIP
- Extract the ZIP file
Step 2: Download Dependencies
QBCore requires several additional resources:
qb-core (main framework):
qb-multicharacter (character selection):
qb-spawn (spawn system):
qb-smallresources (various resources):
qb-apartments (apartments):
qb-inventory (inventory):
Step 3: Prepare the Database
Create the Database
- Create a new MySQL database
- Name:
qbcore - Create a user with all privileges
Import the SQL File
- Open phpMyAdmin
- Select the
qbcoredatabase - Import the
qbcore.sqlfile (in the qb-core folder)
Step 4: Install the Files
Folder Structure
Create this structure in resources:
resources/
└── [qb]/
├── qb-core/
├── qb-multicharacter/
├── qb-spawn/
├── qb-apartments/
├── qb-inventory/
├── qb-smallresources/
└── [other qb scripts]
Upload the Resources
- Create the
[qb]folder inresources - Upload all downloaded QBCore resources
Step 5: Configure MySQL Connection
In server.cfg:
# MySQL Configuration for QBCore
set mysql_connection_string "mysql://username:password@localhost/qbcore?charset=utf8mb4"
Step 6: Configure server.cfg
Add to server.cfg:
# QBCore Framework
ensure qb-core
ensure qb-multicharacter
ensure qb-spawn
ensure qb-apartments
ensure qb-garages
ensure qb-interior
ensure qb-clothing
ensure qb-weathersync
ensure qb-inventory
ensure qb-smallresources
# Base Scripts
ensure qb-ambulancejob
ensure qb-policejob
ensure qb-shops
ensure qb-vehicleshop
Step 7: QBCore Configuration
Open [qb]/qb-core/shared/config.lua:
QBShared = {}
-- Language
QBShared.Locale = 'en'
-- Starting money
QBShared.StarterAmount = {
cash = 500,
bank = 5000
}
-- Default jobs
QBShared.DefaultJob = 'unemployed'
-- General configuration
QBShared.MaxPlayers = 64
QBShared.DefaultSpawn = vector4(-1035.71, -2731.87, 12.86, 0.0)
-- Inventory
QBShared.MaxInventorySlots = 41
QBShared.MaxInventoryWeight = 120000
Step 8: Configure Permissions
In [qb]/qb-core/server/main.lua, configure administrators:
QBCore.Config.Server.Permissions = {
['god'] = {
'steam:110000xxxxxx', -- Replace with your Steam Hex
},
['admin'] = {
'steam:110000yyyyyy',
}
}
To find your Steam Hex, type in the server console when connected:
status
Step 9: Test QBCore
- Restart the server completely
- Connect
- You should see the character selection screen
- Create a character and test the spawn
Post-Installation Configuration
Install Essential Jobs
For ESX
esx_policejob (police):
esx_ambulancejob (EMS):
esx_mechanicjob (mechanic):
For QBCore
Jobs are already included in the recommended downloads:
- qb-policejob
- qb-ambulancejob
- qb-mechanicjob
Add Vehicles
ESX
Edit [esx]/es_extended/config.lua and add vehicles in the database file.
QBCore
Edit [qb]/qb-core/shared/vehicles.lua:
QBShared.Vehicles = {
['adder'] = {
['name'] = 'Adder',
['brand'] = 'Truffade',
['model'] = 'adder',
['price'] = 1000000,
['category'] = 'super',
['hash'] = `adder`,
['shop'] = 'pdm',
},
-- Add more vehicles here
}
Configure Shops
ESX - esx_shops
- Install esx_shops
- Configure positions in
config.lua - Add items to the database
QBCore - qb-shops
Edit [qb]/qb-shops/config.lua:
Config.Locations = {
['247supermarket'] = {
['label'] = '24/7 Supermarket',
['coords'] = vector4(24.47, -1346.62, 29.5, 271.66),
['products'] = Config.Products['normal'],
['showblip'] = true,
},
}
Useful Commands
ESX Administrator Commands
/setjob [id] [job] [grade]
Set a player's job
/setgroup [id] [group]
Set a player's group (admin, superadmin, etc.)
/givemoney [id] [account] [amount]
Give money (account: money, bank, black_money)
/car [model]
Spawn a vehicle
QBCore Administrator Commands
/setjob [id] [job] [grade]
Set a player's job
/givemoney [id] [amount]
Give money
/giveitem [id] [item] [amount]
Give an item
/car [model]
Spawn a vehicle
Optimization and Security
Disable Debug
ESX - In es_extended/config.lua:
Config.EnableDebug = false
QBCore - In qb-core/shared/config.lua:
QBShared.Debug = false
Secure Events
Install an anticheat like:
- AC (Anticheat) for ESX
- qb-anticheat for QBCore
Optimize Performance
- Disable unused resources
- Limit the number of vehicles/objects
- Use optimized scripts
- Configure txAdmin properly
Troubleshooting
ESX Won't Start
Checks:
- MySQL connection is correct
- SQL file has been imported
- Resources are in the correct
[esx]/folder ensure es_extendedis in server.cfg
Solution: Check server logs for the exact error.
QBCore Won't Start
Checks:
- All dependencies are installed
- Database is imported
- Folders are named correctly (case-sensitive)
ensure qb-coreis before other QB scripts
Solution: Restart the server completely, not just a refresh.
MySQL Connection Error
Cause:
- Incorrect MySQL credentials
- Database not created
- MySQL not started
Solution: Check the MySQL connection string and test the connection.
Players Cannot Create a Character
ESX:
- Check that esx_identity is started
- Check that esx_skin is installed
QBCore:
- Check that qb-multicharacter is started
- Check that qb-spawn is installed
Admin Commands Don't Work
ESX:
- Add yourself to the database
userswith admin group
QBCore:
- Add your Steam Hex in qb-core/server/main.lua
Recommended Resources
For ESX
Essential:
- esx_society (companies)
- esx_billing (billing)
- esx_vehicleshop (dealership)
- esx_property (properties)
Optional:
- esx_drugs (drugs)
- esx_holdup (robberies)
- esx_garage (garages)
For QBCore
Essential:
- qb-management (business management)
- qb-banking (bank)
- qb-vehicleshop (dealership)
- qb-houses (houses)
Optional:
- qb-drugs (drugs)
- qb-storerobbery (robberies)
- qb-garages (garages)
- qb-phone (phone)
Migrating ESX to QBCore
If you want to migrate from ESX to QBCore:
- Backup your entire database
- Use a conversion tool (available on GitHub)
- Test on a test server first
- Expect to redo some configurations manually
Note: Migration is complex and may require a lot of manual work.
Conclusion
ESX Legacy and QBCore are both excellent frameworks for creating a FiveM roleplay server. ESX is ideal for beginners with its large community and many available scripts, while QBCore offers better performance and a more modern structure for experienced developers.
Choose the one that best fits your needs and technical skills. Both frameworks have complete documentation and active communities ready to help.


















