How to install a QBCore server: txAdmin recipe and manual steps
Install QBCore on FiveM with the txAdmin recipe or by hand: qb-core, the qb resources, oxmysql, SQL import, server.cfg, first checks and the most common first errors.
You want a QBCore server and you are choosing between the recipe and a manual install. This guide covers both, the server.cfg you need, what to check on your first start, and the errors that show up on almost every first QBCore server.
Option 1: the txAdmin recipe
The recipe is the recommended way. In txAdmin's setup, choose the QBCore template from the popular recipes, as described in txAdmin setup and recipes. You enter your license key and database details, txAdmin downloads everything, creates the database and writes server.cfg. Review that file, start the server, and move on to the first checks below.
Option 2: manual install
Use this if you already have a server and want to add QBCore. You need FXServer, a MySQL or MariaDB database and a license key.
1. Get the resources
QBCore is not a single resource. You need:
- qb-core, the framework itself.
- The qb resources around it: inventory, multicharacter, spawn selector, jobs, phone and so on. They are normally grouped in a folder such as
[qb]. - oxmysql for the database and ox_lib, which many current resources depend on.
- Standalone resources such as a voice resource (see pma-voice not working) and any map or vehicle packs.
Copy them into your resources folder, for example resources/[qb] and resources/[standalone].
2. Create the database and import the SQL
CREATE DATABASE qbcore CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;Import the SQL file that comes with the QBCore install (the recipe repository ships one with the base tables) and then the SQL of each resource that has its own file. If a script later says a table is missing, see SQL table doesn't exist.
3. Edit server.cfg
set mysql_connection_string "mysql://user:password@localhost/qbcore?charset=utf8mb4"
ensure oxmysql
ensure ox_lib
ensure qb-core
ensure [qb]
ensure [standalone]
add_ace group.admin command allow
add_ace qbcore.god command allow
add_principal group.admin qbcore.god
add_principal identifier.license:YOUR_LICENSE_HERE qbcore.godReplace YOUR_LICENSE_HERE with your own FiveM license identifier. You find it in the player list of txAdmin or in the server console when you join. The ACE lines are covered in ACE permissions.
Tip:
ensure [qb]starts every resource inside that folder. Keep qb-core itself outside of it, as in the example, or it is ensured twice. See server.cfg ensure order.
First checks
Start the server and read the console before you join:
- oxmysql connects to the database without an error.
- qb-core starts. If it does not, every other qb resource fails after it.
- No red errors from the resources in
[qb]. A few warnings are normal; repeating errors are not. - You can join, get the character selection, create a character and spawn.
- A row is created in the
playerstable for your character.
If you cannot join or stay on the loading screen, read players stuck on the loading screen.
Common first errors
QBCore is nil. A script that uses an old method to get the core object fails with:
attempt to index a nil value (global 'QBCore')Use local QBCore = exports['qb-core']:GetCoreObject() at the top of every file. The full explanation is in QBCore nil: the GetCoreObject fix.
qb-core did not start. Other resources then report:
No such export GetCoreObject in resource qb-coreLook at the top of the console for the first error of qb-core itself, which is usually the database. See oxmysql connection error.
Resource fails to start. Missing dependency or folder name problems: could not find dependency, couldn't start resource.
You are not admin. Your identifier in server.cfg does not match yours, or you did not restart after editing it.
Next steps
When the base is stable, the usual first tasks are adding jobs and items. See QBCore add job and qb-inventory add items. If you plan to run the newer stack later, read install QBox first, because the stack differs.
Checklist
| Symptom | Fix |
|---|---|
attempt to index a nil value (global 'QBCore') |
local QBCore = exports['qb-core']:GetCoreObject() at the top of the file |
No such export GetCoreObject in resource qb-core |
Fix the qb-core start error, usually the database connection |
| Table doesn't exist | Import the missing SQL file for that resource |
| Stuck on loading | Check the console for the resource that errors on join |
| Not admin | Put your own license in add_principal and restart |
| Resources start twice | Do not ensure a resource by name and through its bracket folder |
Quick answers
Should I use the txAdmin recipe for QBCore?
Yes. The recipe downloads qb-core with its resources and dependencies, creates the database and writes server.cfg, which avoids most first install mistakes.
Which database does QBCore need?
MySQL or MariaDB, accessed through oxmysql. Set mysql_connection_string in server.cfg and import the SQL files the framework and its resources ship with.
How do I become admin on QBCore?
Add your identifier to a principal such as qbcore.god with add_principal in server.cfg, restart, and rejoin. Use your own license identifier, not the example from the recipe.
Scripts that skip this problem
Item Creator V2Create usable items with animations, props, effects and more β without writing code.View script β
Shop CreatorBuild a shop in under a minute β owners, employees, vaults and robberies included.View script β
Mic PhoneA foldable phone that unfolds into a tablet and carries onto a player's real phone.View script β