Find us on social media
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:
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:
mysql -u fivem -p fivem_db < ~/fxserver/server-data/resources/[esx]/[SQL]/legacy.sqlThis creates tables: users, owned_vehicles, jobs, items, etc.
Step 3: Configure server.cfg
Add the following lines to your server.cfg:
# 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_libImportant: 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:
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:
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.gitAdd them to server.cfg:
ensure esx_policejob
ensure esx_ambulancejob
ensure esx_mechanicjobStep 6: Restart and verify
From txAdmin, restart the server. In the console you should see:
[ESX] [es_extended] Loaded successfully
[ESX] [esx_identity] Loaded successfullyIf there are errors, check that oxmysql is properly connected to the database.
Recommended folder structure
resources/
├── [esx]/ # Framework core and ESX scripts
├── [standalone]/ # Independent scripts
├── [maps]/ # MLOs and custom maps
└── [vehicles]/ # Custom vehiclesTips
- Always use the Legacy version of ESX (not the old v1)
- Keep ESX updated with
git pullperiodically - 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