How to Install and Configure QBCore (and Qbox) on FiveM
Step-by-step QBCore and Qbox installation guide for FiveM: prerequisites, qb-core setup, oxmysql connection string, SQL import, server.cfg load order, and first-run verification.
On this page
QBCore and its actively maintained community fork Qbox (qbx_core) are two of the most popular FiveM frameworks, widely used for semi-serious RP, economy servers, and city-life gameplay. Their shared API and large resource ecosystem make them a strong choice for server owners who want a modern codebase with a vast library of scripts.
This guide covers both qb-core and Qbox installation — the process is nearly identical. Where they differ, we will call it out. Follow every step in order; QBCore and Qbox are particularly sensitive to load-order mistakes.
QBCore vs Qbox — Which Should You Install?
qb-core is the original framework repository. Qbox (qbx_core) is a community fork of QBCore that is actively maintained, receiving performance improvements and regular updates. The two are API-compatible: resources written for QBCore work on Qbox. If you are starting a new server, choose Qbox. If you are maintaining an existing qb-core server, you can continue with qb-core or migrate to Qbox using the migration guide on the Qbox GitHub.
Qbox Is the Forward-Looking Choice
qb-core sees limited active development. Qbox (qbx_core) is the community-endorsed, actively maintained fork. New servers should use Qbox — you get the full QBCore ecosystem with better long-term support.
Prerequisites
- FiveM server artifact — latest recommended build from runtime.fivem.net/artifacts/fivem
- MySQL 8.x or MariaDB 10.6+ — installed locally or on a remote host
- HeidiSQL or phpMyAdmin — for database management and SQL import
- A blank MySQL/MariaDB database created for your server (e.g., fivem_qbcore)
- A valid FiveM sv_licenseKey from keymaster.fivem.net
- oxmysql — downloaded from github.com/overextended/oxmysql (releases page)
- qb-core from github.com/qbcore-framework/qb-core OR qbx_core from github.com/Qbox-project/qbx_core
Step 1 — Download qb-core or qbx_core
Go to the relevant GitHub repository and download the latest release. Extract the folder and place it in your server's resources directory. A common convention is to put it under a [qb] or [qbx] subfolder to separate framework resources from standalone scripts. The folder must be named qb-core (for QBCore) or qbx_core (for Qbox) — the fxmanifest.lua inside defines the resource name, and other scripts depend on that exact name.
Step 2 — Import the SQL Database
Inside the qb-core or qbx_core folder, locate the SQL file (commonly qb-core.sql or similar). Open your database management tool, select your blank database, and run the import. This creates all necessary tables: players, player_vehicles, apartments, player_contacts, and more. Each additional qb-* resource you add will often include its own SQL file — import each one individually.
Step 3 — Configure the oxmysql Connection String
oxmysql is the database bridge that QBCore and Qbox use to communicate with MySQL/MariaDB. Set the connection string as a convar in server.cfg before any ensure lines. This is identical to the ESX setup:
# oxmysql connection string — must be set BEFORE any ensure lines
set mysql_connection_string "mysql://dbuser:[email protected]/fivem_qbcore?charset=utf8mb4"
# Replace dbuser, dbpassword, and fivem_qbcore with your actual values.
# For a remote database, replace 127.0.0.1 with the remote host's IP or hostname.Step 4 — Set the server.cfg Load Order
Load order is critical in QBCore and Qbox. oxmysql must start first. Then qb-core (or qbx_core). Then all qb-* dependent resources. Any script that tries to call QBCore exports before the framework is ready will throw errors and fail to initialize.
# ============================================================
# server.cfg — QBCore / Qbox recommended load order
# ============================================================
set onesync on
# Database connection (must appear before any ensure)
set mysql_connection_string "mysql://dbuser:[email protected]/fivem_qbcore?charset=utf8mb4"
# 1. Core connector
ensure oxmysql
# 2. Framework core — use ONE of the following:
ensure qb-core
# OR for Qbox:
# ensure qbx_core
# 3. Core framework resources
ensure qb-multicharacter
ensure qb-spawn
ensure qb-inventory
ensure qb-hud
ensure qb-phone
# 4. Job/emergency resources
ensure qb-policejob
ensure qb-ambulancejob
ensure qb-mechanicjob
# 5. Additional scripts
ensure qb-vehicleshop
ensure qb-garages
ensure qb-targetCore QBCore Resource Reference
| Resource | Purpose | Required? |
|---|---|---|
| oxmysql | MySQL/MariaDB connector | Yes |
| qb-core / qbx_core | Framework core — player data, jobs, money | Yes |
| qb-multicharacter | Character creation and selection screen | Strongly recommended |
| qb-spawn | Spawn location picker on character load | Strongly recommended |
| qb-inventory | Item inventory system | Yes (or use ox_inventory) |
| qb-hud | Player HUD (health, armor, hunger, thirst) | Recommended |
| qb-target | Interaction targeting system | Recommended (or ox_target) |
| qb-phone | In-game smartphone | Recommended |
| qb-policejob | Police department job script | Optional |
| qb-ambulancejob | EMS job script | Optional |
Step 5 — Configure qb-core
The primary configuration file is qb-core/shared/config.lua (path may vary slightly by version). Key settings to review on a new installation:
- QBConfig.Money.MoneyTypes — defines the money accounts (cash, bank, crypto)
- QBConfig.Player.HungerRate and ThirstRate — how quickly needs deplete
- QBConfig.Server.Whitelist — toggle whitelisting on or off
- QBConfig.Server.WhitelistPermission — ACE permission required for whitelisted entry
- QBConfig.Server.MaxPlayers — should match your sv_maxclients
Qbox Config Location May Differ
Qbox (qbx_core) reorganizes some configuration into separate files or modules compared to qb-core. Check the Qbox documentation for the exact location of each setting — do not assume the file paths are identical to qb-core.
Step 6 — Enable OneSync
Add `set onesync on` to server.cfg. OneSync is required for player counts above 32 and expected by all modern QBCore and Qbox resources. Many scripts that rely on entity or vehicle state bags will fail or behave incorrectly without it.
Step 7 — First Run and Verification
Start the server and watch the console. A successful startup shows oxmysql connecting, then qb-core (or qbx_core) initializing without errors. Connect with a FiveM client and confirm the character creation screen appears, a character spawns correctly, and the HUD loads.
- Console: oxmysql reports a successful database connection
- Console: qb-core or qbx_core starts without nil errors or missing export warnings
- Client: character creation/multicharacter screen appears on first connect
- Client: player spawns in the world with correct starting money and default job
- Client: HUD displays health, armor, and other stats
- Console: no Lua errors in the log during normal gameplay
Common Installation Errors
| Error / Symptom | Likely Cause | Fix |
|---|---|---|
| attempt to index a nil value (QBCore) | Resource ensured before qb-core | Move the resource below qb-core in server.cfg |
| Database connection error on startup | Wrong mysql_connection_string | Check host, user, password, and database name |
| Character screen does not appear | qb-multicharacter not ensured or SQL missing | Add ensure qb-multicharacter and import its SQL |
| Items missing from inventory | qb-inventory SQL not imported | Import the qb-inventory .sql file into your database |
| OneSync-related desyncs | set onesync missing in server.cfg | Add set onesync on at the top of server.cfg |
Conclusion
QBCore and Qbox follow the same installation pattern: database first, SQL imported, connection string set, then resources ensured in the correct order. For new servers, Qbox (qbx_core) is the recommended choice — it gives you the full QBCore ecosystem with active maintenance and performance improvements. If you want to skip the manual setup and get straight to building your community, CRM Development's QBCore server packs include all core resources pre-configured, tested, and ordered — so you can be in-game in minutes instead of hours.
Frequently asked questions
Should I install QBCore or Qbox for a new server?+
If you are starting a new server today, Qbox (qbx_core) is the recommended choice. It is a community-maintained fork of QBCore with ongoing updates, performance improvements, and modernized code. It is compatible with QBCore's resource ecosystem, so you do not lose access to any qb-* scripts.
Is Qbox compatible with QBCore scripts?+
Yes. Qbox (qbx_core) maintains API compatibility with QBCore, meaning most qb-* resources work on Qbox with little or no modification. Check the Qbox GitHub for a list of officially supported resources.
What is the correct oxmysql connection string format for QBCore?+
QBCore uses the same oxmysql convar as ESX: set mysql_connection_string "mysql://user:[email protected]/database?charset=utf8mb4" in server.cfg. Set this before any ensure lines.
Do I need OneSync for QBCore or Qbox?+
Yes. Add set onesync on to your server.cfg. OneSync is required for servers with more than 32 players and is expected by virtually all modern QBCore and Qbox resources.
What is the minimum set of resources needed to run QBCore?+
At minimum: oxmysql, qb-core (or qbx_core), and ideally qb-multicharacter and qb-spawn so players can create and spawn characters. Most servers also add qb-inventory or ox_inventory, qb-target or ox_target, and qb-phone.
