EN

Game servers

How to Install ESX or QBCore on a FiveM Server

Choose between ESX Legacy and QBCore, prepare the MariaDB database, deploy the framework with txAdmin on your Linux server, check the result and roll back if needed.

8 min read, updated on 18 November 2026

On this page

Your values

Enter them once and the commands in this guide update.

ESX Legacy and QBCore are roleplay frameworks: they add characters, jobs, money and inventory to FiveM. This guide helps you choose between the two, then deploy one with txAdmin without losing your current configuration.

Prerequisites

  • A server installed with the guide Create a FiveM Server: fivem user, fivem.service service, /usr/local/sbin/backup-fivem.sh script
  • MariaDB installed, with the fivem database and the fivem user created in the MariaDB section of that guide
  • The password of that MariaDB user
  • Your cfxk_ license key and a main txAdmin administrator account

Choosing Between ESX and QBCore

Both frameworks meet the same need. The deciding factor is the list of resources you plan to use: a resource written for one does not work as is on the other.

Criterion ESX Legacy QBCore
Deployment in txAdmin Popular Recipes, ESX Legacy recipe Remote URL Template, with the recipe address
Main resource es_extended qb-core
Main dependencies oxmysql, esx_lib oxmysql
Players table users players
Player permissions Groups stored in the database, changed with setgroup god, admin and mod levels, managed by ACE permissions
OneSync Enabled by the recipe Enabled by the recipe
Documentation docs.esx-framework.org qbcore.org/docs

To decide:

  • Choose ESX Legacy if you want to follow the path offered directly by txAdmin, or if the resources you are aiming for are written for ESX.
  • Choose QBCore if the resources you are aiming for are written for QBCore, or if your team already knows it.
  • Also look at Qbox if you are hesitating on the QBCore side: txAdmin offers its recipe in Popular Recipes and presents it as compatible with QBCore resources. This guide does not cover its installation.

Changing framework later means starting from scratch: tables, functions and resources differ. Never install both on the same server.

Step 1: Back Up the Server

Run the backup script and check that the archives are created:

Terminal
sudo /usr/local/sbin/backup-fivem.sh
sudo ls -lh /home/fivem/backups

Note the date of the two latest files, fivem_DATE.tar.gz and fivem_db_DATE.sql.gz. You will need them to roll back.

Step 2: Prepare the Database

Check that MariaDB is running and count the tables in the fivem database:

Terminal
sudo systemctl is-active mariadb
sudo mariadb -N -e "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='fivem';"
  • The result is 0: the database is empty, use fivem and go to step 3.
  • The result is greater than 0: the database already contains data. Create another one for the framework, as shown below.
Terminal
sudo mariadb
SQL
CREATE DATABASE fivem_rp CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON fivem_rp.* TO 'fivem'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Then point the backup script to this database, otherwise it will not be backed up:

Terminal
sudo sed -i 's/^DB_NAME="fivem"$/DB_NAME="fivem_rp"/' /usr/local/sbin/backup-fivem.sh
sudo grep '^DB_NAME' /usr/local/sbin/backup-fivem.sh

In the rest of this guide, replace fivem with fivem_rp wherever it refers to the database name.

If you have lost the password, generate one with openssl rand -hex 16, then apply it in sudo mariadb:

SQL
ALTER USER 'fivem'@'localhost' IDENTIFIED BY 'GENERATED_PASSWORD';

If an existing server already uses this account, also update its mysql_connection_string line.

Step 3: Go Back to the txAdmin Wizard

Skip this step if no server has been deployed yet: txAdmin already displays the wizard.

Otherwise, open txAdmin through the SSH tunnel, then:

  1. Go to Settings, FXServer tab.
  2. Copy the value of Server Data Folder and keep it: it is the path of your current server.
  3. Click Reset, then confirm.

This action stops the server and takes txAdmin back to the wizard. It does not delete the resource files or the database.

Step 4: Start the Deployment

In the wizard, give the server a name, then choose the recipe:

  • ESX Legacy: select Popular Recipes, then ESX Legacy.
  • QBCore: select Remote URL Template, then paste this address:
Text
https://raw.githubusercontent.com/qbcore-fivem/txAdminRecipe/main/qbcore.yaml

Keep the suggested destination folder and move on to the Recipe Deployer. Paste your cfxk_ key, then click Show/Hide Database options (advanced) and fill in:

Field Value
Database Host 127.0.0.1
Database Port 3306
Database Username fivem
Database Password The password of the fivem user
Database Name fivem (or fivem_rp)
Delete Database Disabled

Click Run Recipe. The deployment downloads many resources and can take several minutes. When it finishes, click Save & Run Server.

Step 5: Verify the Installation

Wait about a minute, then look for the database connection and the framework startup in the console:

Terminal
sudo grep -a -E 'Database server connection established|Started resource (es_extended|qb-core)' /home/fivem/fxserver.log

You should see the database connection line and the one for es_extended or qb-core. Then check that the server declares these resources:

Terminal
curl -fsS http://127.0.0.1:30120/info.json | grep -oE '"(oxmysql|es_extended|qb-core)"'

Finally, check that the recipe created the players table:

Terminal
# ESX Legacy
sudo mariadb fivem -e "SHOW TABLES LIKE 'users';"

# QBCore
sudo mariadb fivem -e "SHOW TABLES LIKE 'players';"

Then connect to the game with connect SERVER_IP:30120 and create a character. A row should then appear in this table.

Step 6: Give Yourself Administration Rights

  • ESX Legacy: connect to the server, find your player number in txAdmin's list of connected players, then type setgroup 1 admin in Live Console, replacing 1 with that number. The group is stored in the users table.
  • QBCore: add your identifier to the qbcore.god group, as explained in Manage ACE Permissions on FiveM.

Also run a new backup: it is now your reference rollback point.

Terminal
sudo /usr/local/sbin/backup-fivem.sh

Rolling Back

This procedure restores the server and the database as they were at step 1. Replace DATE with the date you noted.

Terminal
sudo systemctl stop fivem.service
sudo mv /home/fivem/txData /home/fivem/txData.framework
sudo -u fivem tar -xzf /home/fivem/backups/fivem_DATE.tar.gz -C /home/fivem
sudo mariadb -e "DROP DATABASE fivem; CREATE DATABASE fivem CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
zcat /home/fivem/backups/fivem_db_DATE.sql.gz | sudo mariadb fivem
sudo systemctl start fivem.service

If you had created fivem_rp, the step 1 archive contains the original fivem database, which was not modified: do not run the DROP DATABASE and zcat lines. Instead, delete fivem_rp with sudo mariadb -e "DROP DATABASE fivem_rp;", then put DB_NAME="fivem" back in the backup script.

The /home/fivem/txData.framework folder keeps the trial. Delete it when you no longer need it.

Troubleshooting

Database connection failed

This message appears in the Recipe Deployer, followed by the cause:

  • connect ECONNREFUSED 127.0.0.1:3306: MariaDB is not running. Check with sudo systemctl status mariadb.
  • Access denied for user 'fivem'@'localhost': the password is incorrect.
  • Access denied for user 'fivem'@'127.0.0.1': add this account by following Install and Configure oxmysql on FiveM.

Access denied for user 'fivem'@'localhost' to database

The Database Name field contains a name other than fivem. By default, txAdmin puts the deployment ID there, and the fivem user has no rights on that database. Fix the field.

Table 'addon_account' already exists

The ESX recipe has already been run on this database, for example during an interrupted deployment. If the database contains nothing useful, empty it, then run the recipe again:

Terminal
sudo mariadb -e "DROP DATABASE fivem; CREATE DATABASE fivem CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

The deployment stops during a download

Recipes download many files from GitHub, which may temporarily rate-limit requests. Wait a few minutes, then restart the deployment. Also check the disk space with df -h /home.

The recipe does not appear or txAdmin considers it incompatible

QBCore is not in Popular Recipes: use Remote URL Template. If txAdmin reports Some recipes are not compatible with your txAdmin version, Update FXServer Artifacts, which bundles txAdmin.

Could not find dependency oxmysql for resource es_extended

The oxmysql resource is missing or misplaced. The same message exists for qb-core and for esx_lib. Check that it is present with the guide Install and Configure oxmysql on FiveM.

Resource 'oxmysql' can't run

If the following line says server needs to be 12913 or higher, your FXServer version is too old for this version of oxmysql. Update FXServer Artifacts.

Table 'fivem.users' doesn't exist

The connection string points to a different database than the one used by the deployment, or the SQL import did not complete. Compare mysql_connection_string in CFG Editor with the result of sudo mariadb -e "SHOW DATABASES;".

The server starts but remains unstable

See Diagnose Crashes and Lag on a FiveM Server to find the resource responsible.