FiveMESXRoleplayFramework8 min read

Install ESX Framework

Step-by-step installation of ESX Legacy for your FiveM Roleplay server.


What is ESX Legacy?

ESX Legacy is the most popular roleplay framework for FiveM. It provides economy, inventory, jobs, character identity and a foundation for hundreds of RP scripts.

Prerequisites

  • A running FiveM server with txAdmin
  • MariaDB database configured (see our database guide)
  • oxmysql installed and connected

Step 1: Download ESX Legacy

Connect via SSH to your VPS and clone the official repository:

bash
cd ~/fxserver/server-data/resources/
git clone https://github.com/esx-framework/esx_core.git [esx]

This downloads the ESX core with all base modules.

Step 2: Import the database

ESX needs tables in your database. Import the included SQL:

bash
mysql -u fivem -p fivem_db < ~/fxserver/server-data/resources/[esx]/[SQL]/legacy.sql

This creates tables: users, owned_vehicles, jobs, items, etc.

Step 3: Configure server.cfg

Add the following lines to your server.cfg:

bash
# ESX Core
ensure es_extended
ensure esx_identity
ensure esx_society
ensure esx_status
ensure esx_basicneeds
ensure esx_skin
ensure esx_multicharacter

# Dependencies
ensure oxmysql
ensure ox_lib

Important: Load order matters. oxmysql and ox_lib must come before ESX.

Step 4: Configure ESX

Edit the ESX config file at resources/[esx]/es_extended/config.lua:

lua
Config = {}
Config.Locale = 'en'
Config.MaxWeight = 24
Config.PaycheckInterval = 10  -- Minutes between job payments
Config.EnableDefaultInventory = true
Config.EnableSocietyPayouts = true
Config.StartingAccountMoney = { bank = 50000, money = 500 }

Step 5: Install additional scripts

ESX works with additional scripts for each RP mechanic:

bash
cd ~/fxserver/server-data/resources/[esx]
git clone https://github.com/esx-framework/esx_policejob.git
git clone https://github.com/esx-framework/esx_ambulancejob.git
git clone https://github.com/esx-framework/esx_mechanicjob.git

Add them to server.cfg:

bash
ensure esx_policejob
ensure esx_ambulancejob
ensure esx_mechanicjob

Step 6: Restart and verify

From txAdmin, restart the server. In the console you should see:

terminal
[ESX] [es_extended] Loaded successfully
[ESX] [esx_identity] Loaded successfully

If there are errors, check that oxmysql is properly connected to the database.

Recommended folder structure

terminal
resources/
├── [esx]/           # Framework core and ESX scripts
├── [standalone]/    # Independent scripts
├── [maps]/          # MLOs and custom maps
└── [vehicles]/      # Custom vehicles

Tips

  • Always use the Legacy version of ESX (not the old v1)
  • Keep ESX updated with git pull periodically
  • Do not mix ESX scripts with QBCore scripts (they are incompatible)
  • Test each new script on a development server before production
  • Check the official documentation at docs.esx-framework.org

Was this guide helpful?