OFFER Limited time only: -10% site-wide with code WELCOME10

Installing ESX Legacy on a FiveM server

Updated on August 4, 2026 5 min read 10 sections

If you are building a roleplay server on FiveM, ESX Legacy is probably the first brick you will lay: it is the most widely used economy, jobs and inventory framework in the RP ecosystem, free, open source and actively maintained by the community. This guide covers the full installation, from the database to the first boot, along with the most common errors and how to fix them.

Budget 30 to 45 minutes for a clean first install.

What is ESX Legacy?

ESX Legacy is the maintained, modernised version of the historical ESX framework (the one previously known as es_extended v1). It provides the common base most FiveM RP servers rely on: player accounts, money (cash and bank), inventory, jobs, society and a permission system. The vast majority of paid or free RP scripts on the market are built to run on top of it.

The best known alternative is QBCore: both are technically sound, and the choice mostly comes down to compatibility with the scripts you intend to use (see the FAQ at the bottom of this page).

Prerequisites

  • A FiveM server that already boots (a cfx-server-data base or a txAdmin install). If that is not the case yet, start with setting up the FiveM server, which is step zero before this one.
  • Access to a MySQL or MariaDB database. On an ElypseCloud FiveM server it is included with the plan or available as an option: check your client area.
  • Access to your panel's file manager (Pterodactyl at ElypseCloud) or SFTP access.
  • Basic familiarity with editing the server.cfg file.

Want to try ESX Legacy without committing a budget? The free FiveM plan is enough to follow this tutorial end to end and see the framework running before moving to a plan sized for real players.

Step 1: prepare the database

Create a dedicated database: do not reuse one that already serves another project. Write down precisely:

  • the database name
  • the user and its password
  • the host (often localhost, or an internal address if the database is shared)

You will need those three details in step 4.

Step 2: install oxmysql

ESX Legacy needs an asynchronous MySQL connector to talk to your database. The current standard in the FiveM ecosystem is oxmysql. The older mysql-async / ghmattimysql still works on some setups, but oxmysql is what the ESX Legacy documentation recommends today. Check the framework's official docs as you read this, the FiveM ecosystem moves fast.

  1. Download the latest oxmysql release from its official repository.
  2. Place the folder in resources/[core]/oxmysql (the [core] prefix is a filing convention, not a technical requirement).
  3. Add this to server.cfg, before any line that loads ESX:
ensure oxmysql

Step 3: download es_extended and the ESX resources

Get es_extended (the core of the framework) from the official ESX Legacy repository, along with the additional resources you will need: spawnmanager, esx_menu_default, esx_context and so on. The exact list depends on the version and on the scripts you plan to install on top.

Place each resource in its own folder under resources/[esx]/.

Step 4: configure server.cfg

In order, your server.cfg must load:

ensure oxmysql
ensure es_extended
ensure spawnmanager
ensure esx_menu_default
ensure esx_menu_dialog
ensure esx_menu_list

Then add the connection string to your database, using your real details from step 1:

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

Load order matters. oxmysql must always start before es_extended: otherwise ESX finds no database connection at boot and crashes.

Step 5: import the SQL schema

The ESX Legacy repository ships a .sql file containing the base structure (player tables, society and so on). Import it into your database through phpMyAdmin, Adminer or the command line, depending on what your panel offers.

Step 6: boot and test

Restart the server from your panel, then watch the console during startup. Connect in game: you should land at spawn with a blank character. If an ESX menu opens (F2 by default on most configurations), the installation works.

Common errors

"oxmysql wasn't ready before a resource was started"

The MySQL connector did not have time to initialise before es_extended tried to connect to it. Check the order in server.cfg (oxmysql first) and that the connection string is correct.

Database connection error ("Access denied", "Unknown database")

Check the user, password and database name in mysql_connection_string, and that the MySQL user actually has rights on that specific database.

"Could not find resource" at startup

A resource listed in server.cfg is not in the right place under resources/, or the folder name does not match exactly what is written in server.cfg, which is case sensitive on some systems.

The character does not spawn / persistent black screen

Check that spawnmanager loads after es_extended, and look at the console for a more specific Lua or JS error before digging further.

What next?

Once ESX Legacy is in place, what follows depends on your project: job scripts, advanced inventory, company systems. Two infrastructure points deserve attention, independently of the framework: available RAM as the script count grows, and the quality of the database link under load. That is where most RP servers start to lag, not inside ESX itself. If you are already in that situation with your current host, we wrote a page about it.

FAQ

ESX Legacy or QBCore: which one for a new server?

Both are solid and actively maintained. ESX historically has the widest ecosystem of paid scripts; QBCore has a reputation for a more modern code structure. The real criterion: look at the specific scripts you want to run, most are built for one OR the other, rarely both natively.

How much RAM does an ESX Legacy server need?

It depends mostly on the number of additional scripts and concurrent players, not on ESX itself (the base framework is light). For a roleplay server with around thirty scripts and OneSync enabled, size up rather than picking the cheapest plan.

Can an old ESX server be migrated to ESX Legacy?

Yes, but it is not a simple folder swap: the database structure and some export names have changed. Expect breakage on third-party scripts that have not been updated, and test on a development environment before touching production.

Does ElypseCloud support help with installing ESX?

Technical support covers everything infrastructure related: panel, database, ports, server performance. Fine-tuning the framework and its scripts remains the roleplay server admin's job, which is exactly what this tutorial is for.