Logo

How to Install ESX or QBCore on Your FiveM Server

How to Install ESX or QBCore on Your FiveM Server

This guide explains how to install and configure ESX Legacy or QBCore frameworks to create a FiveM roleplay server.

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

  1. Go to https://github.com/esx-framework/esx_core
  2. Click Code then Download ZIP
  3. Extract the ZIP file on your computer

Step 2: Prepare the Database

Create the Database

  1. Log in to your game panel
  2. Go to Databases or MySQL
  3. Create a new database:
    • Name: esx_legacy
    • User: Create a user with all privileges
    • Password: Write it down carefully

Import the SQL File

  1. Open phpMyAdmin or your MySQL manager
  2. Select the esx_legacy database
  3. Click Import
  4. Import the esx_core.sql file (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

  1. Connect to your FTP or file manager
  2. Go to the resources folder
  3. Create a folder [esx] (with brackets)
  4. 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 username
  • password: Your MySQL password
  • localhost: Your database address
  • esx_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

  1. Restart your FiveM server
  2. Connect to the server
  3. You should see the character creation screen
  4. Check the console for errors

Part 2: Installing QBCore

Step 1: Download QBCore

  1. Go to https://github.com/qbcore-framework/qb-core
  2. Click Code then Download ZIP
  3. 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

  1. Create a new MySQL database
  2. Name: qbcore
  3. Create a user with all privileges

Import the SQL File

  1. Open phpMyAdmin
  2. Select the qbcore database
  3. Import the qbcore.sql file (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

  1. Create the [qb] folder in resources
  2. 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

  1. Restart the server completely
  2. Connect
  3. You should see the character selection screen
  4. 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

  1. Install esx_shops
  2. Configure positions in config.lua
  3. 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

  1. Disable unused resources
  2. Limit the number of vehicles/objects
  3. Use optimized scripts
  4. 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_extended is 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-core is 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 users with admin group

QBCore:

  • Add your Steam Hex in qb-core/server/main.lua

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:

  1. Backup your entire database
  2. Use a conversion tool (available on GitHub)
  3. Test on a test server first
  4. 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.

Join our Discord community server

For any questions, suggestions, or just to chat with the community, join us on Discord!

900+Members