Install ESX Legacy on Your FiveM Server

ESX Legacy is the most popular roleplay framework for FiveM. It provides a complete system with jobs, economy, inventory, and vehicles that serves as the foundation for virtually every serious RP server. The installation is not difficult, but there are enough pitfalls. In this article, we walk through the entire process: from an empty FiveM server to a working ESX framework.

What is ESX Legacy?

ESX (EssentialMode Extended) started years ago as a simple framework and has grown into a comprehensive RP system. The "Legacy" version is the maintained fork that combines years of community improvements. It provides:

  • A player identity system (first name, last name, date of birth)
  • An economy with bank accounts, cash, and transactions
  • A job system with ranks, salaries, and on-duty/off-duty mechanics
  • An inventory system for items, weapons, and usable objects
  • A skin/clothing system
  • Integration hooks that hundreds of community resources build upon

Prerequisites

Before you start, make sure you have:

  • A working FiveM server with txAdmin
  • A MySQL database (MariaDB recommended). On HostValues servers, this is pre-configured.
  • Your server.cfg accessible via Files or SFTP
  • Basic understanding of navigating files on the server

Step 1: set up the database

ESX needs a MySQL database to store player data. If you do not have one yet:

  1. Create a new database (e.g., fivem_esx).
  2. Create a database user with full permissions on that database.
  3. Note the connection details: host, database name, username, password.

Add the connection string to your server.cfg:

set mysql_connection_string "mysql://user:password@localhost/fivem_esx?charset=utf8mb4"

Step 2: install oxmysql

ESX uses oxmysql as its database driver. Download the latest release from GitHub. Extract it to your resources/ folder. In server.cfg, add:

ensure oxmysql

Make sure this line comes before any ESX resources.

Step 3: download ESX Legacy

Download ESX Legacy from the official GitHub. Extract the contents. You will get several folders, each a resource:

  • es_extended - the core framework
  • esx_identity - character creation
  • esx_society - society/business system
  • esx_skin - appearance management
  • skinchanger - skin change utility
  • esx_menu_default, esx_menu_dialog, esx_menu_list - menu systems

Upload all of these to your resources/[esx]/ folder (create the [esx] subfolder for organization).

Step 4: configure server.cfg

Add the ESX resources to your server.cfg in the correct order:

ensure oxmysql

ensure es_extended
ensure esx_menu_default
ensure esx_menu_dialog
ensure esx_menu_list
ensure esx_identity
ensure esx_society
ensure esx_skin
ensure skinchanger

Order matters. es_extended must load first because other resources depend on it.

Step 5: import the database tables

Each ESX resource includes a SQL file for its database tables. Run them in your database client (phpMyAdmin, HeidiSQL, or command line):

  1. Import es_extended/sql/legacy.sql first (creates the users and items tables).
  2. Then import each additional resource's SQL file.

If a table already exists, the import will skip it. Running them again is safe.

Step 6: first start and testing

  1. Start your server.
  2. Watch the console for errors. Common issues: wrong MySQL connection string, missing resource, wrong ensure order.
  3. Connect with your FiveM client.
  4. You should see the character creation screen (esx_identity).
  5. Create a character and verify the economy works (default starting cash appears).

Adding jobs and resources

With ESX running, you can add community resources. Popular starter resources:

  • esx_policejob / esx_ambulancejob: essential emergency service jobs
  • esx_mechanicjob: vehicle repair and customization
  • esx_vehicleshop: buy and sell vehicles
  • esx_property: housing system

Each job resource follows the same pattern: download, extract to resources, add the ensure line to server.cfg, import the SQL file, restart.

ESX Legacy or QBCore?

ESX has the largest ecosystem of community resources and the most documentation. QBCore is newer, leaner, and better organized. For beginners, ESX has more tutorials available. For performance-focused servers, QBCore is often the better choice. Both are actively maintained.

Why does my server say "es_extended not found"?

The resource folder name must be exactly es_extended. If you downloaded it as esx_core-main, rename the folder. Also check that the ensure line comes after oxmysql.

Can I switch from ESX to QBCore later?

Technically possible but practically a rebuild. The two frameworks use different database structures, different events, and different APIs. Community resources are written for one or the other. If you are unsure, test both on a local server before committing to one for production.

Get started with your ESX server on HostValues FiveM hosting with pre-configured MySQL and one-click txAdmin access.


Still stuck? Open a support ticket and our team will help you out.

Back to the blog