# How to Install QBCore on a FiveM Server

Install QBCore on a FiveM server with the txAdmin recipe or by hand: the database, qbcore.sql, mysql_connection_string, ensure order and admin permissions.

Updated 2026-10-03. https://gamezservers.com/guides/how-to-install-qbcore-on-a-fivem-server

To install QBCore on a FiveM server, the easy way is txAdmin: in setup choose **Popular Recipes**, pick **QBCore Framework**, give it your MySQL details and let it download the resources, import the database and write `server.cfg`. By hand, put `oxmysql`, `qb-core` and the `[qb]` resources in `resources/`, import `qbcore.sql` into your database, set `mysql_connection_string` in `server.cfg`, and `ensure qb-core` before `[qb]`. OneSync must be on.

## What you are working with

| Piece | What it does |
| --- | --- |
| `qb-core` | The core: players, jobs, money, items, commands |
| `[qb]` folder | About 70 QBCore resources: inventory, phone, garages, jobs, housing, HUD and more |
| `oxmysql` | The database connector every QBCore resource talks through |
| `[standalone]`, `[voice]`, `[defaultmaps]` | Supporting resources, including `pma-voice` for proximity voice |
| `qbcore.sql` | Creates the database tables, starting with `players`, `bans` and `player_contacts` |
| MySQL or MariaDB database | Stores characters, money, vehicles and inventories |
| `server.cfg` | The connection string, `ensure` lines, permissions and game build |

## Method 1: The txAdmin recipe (recommended)

The official [QBCore txAdmin recipe](https://github.com/qbcore-framework/txAdminRecipe) does every step for you: it downloads the resources, imports the SQL, enables OneSync and writes a working `server.cfg`.

### 1. Open txAdmin and start setup

Open txAdmin, sign in with your Cfx.re account and start the setup. A fresh server shows the setup wizard. On an existing one, go to the settings and use the deployer again with a new data folder, so your current server is not overwritten.

### 2. Pick the recipe

Choose **Popular Recipes**, then **QBCore Framework**. Enter your Cfx.re license key if asked.

### 3. Give it the database

Enter the database host, port, user, password and database name. On a home PC that is usually `localhost` and `3306`. On a host, it is whatever the host gave you, and it is almost never `localhost`.

### 4. Run it

Let the recipe finish. It downloads the resources into `resources/[qb]`, `[standalone]`, `[voice]` and `[cfx-default]`, runs `qbcore.sql` against your database and writes `server.cfg`. Click **Save & Run Server** and watch the live console until `qb-core` reports it started.

## Method 2: Manual install

Use this to add QBCore to a server you built yourself or to control exactly what goes in.

### 1. Get the resources

Download `qb-core` and the QBCore resources you want from the [qbcore-framework GitHub](https://github.com/qbcore-framework), plus the latest `oxmysql` release from Overextended. Unzip them so each resource folder has its `fxmanifest.lua` directly inside, and remove `-main` from folder names (`qb-core-main` must become `qb-core`).

### 2. Put them in place

| Resource | Folder on the server |
| --- | --- |
| `qb-core` | `resources/[qb]/qb-core/` |
| Other QBCore resources | `resources/[qb]/<resource>/` |
| `oxmysql` | `resources/[standalone]/oxmysql/` |
| `pma-voice` | `resources/[voice]/pma-voice/` |

Folder names in square brackets are categories. `ensure [qb]` starts everything inside.

### 3. Import the database

Open the database in HeidiSQL or phpMyAdmin and run `qbcore.sql` from `qb-core`. Some resources ship their own `.sql` file too. Import each one.

### 4. Edit server.cfg

The key lines, in this order:

```
set mysql_connection_string "mysql://USER:PASSWORD@HOST:PORT/DATABASE?charset=utf8mb4"
set onesync on
setr qb_locale "en"

ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
ensure baseevents

ensure qb-core
ensure [qb]
ensure [standalone]
ensure [voice]
ensure [defaultmaps]
```

`qb-core` declares `oxmysql` as a dependency, so FiveM starts it first. Under txAdmin, OneSync is set in txAdmin's settings rather than in `server.cfg`.

![A city street at night on a FiveM roleplay server](https://gamezservers.com/games/fivem/shot-2.jpg)

## The gotcha: the connection string

The most common reason a QBCore install looks fine and then fails is `mysql_connection_string`. Players connect, the loading screen hangs or no character screen appears, and the console shows `oxmysql` errors or missing tables. Three causes cover nearly all of it:

1. **The string still says `localhost`** after copying a config from a guide or a home PC, while the database lives on another host.
2. **The tables were never created**, because `qbcore.sql` was not imported (manual installs only, the recipe does it).
3. **A special character in the password**, like `@` or `#`, breaks the URL form. Use the alternative form instead:

```
set mysql_connection_string "user=USER;password=PASSWORD;host=HOST;port=PORT;database=DATABASE"
```

Check the console right after start: `oxmysql` prints a line when it connects to the database. No line, no QBCore.

## Make yourself admin

QBCore permissions use FiveM ACE. The recipe adds the txAdmin master account to `group.admin` automatically. To add someone else, put their identifier in `server.cfg`:

```
add_principal identifier.license:abc123... qbcore.god
```

`qbcore.god` already inherits `group.admin` and the admin and mod levels in the default config. Our [FiveM admin guide](https://gamezservers.com/guides/how-to-make-yourself-admin-on-a-fivem-server) explains finding identifiers.

## Common problems

- **Stuck on loading or no character screen:** database connection or missing tables. See the gotcha above.
- **`Couldn't find resource qb-core`:** the folder is still named `qb-core-main`, or it is nested one folder too deep.
- **Resources start in the wrong order:** a script that needs `qb-core` starts before it. Keep `ensure qb-core` above `ensure [qb]` and your own scripts below.
- **Map and vehicle DLC missing:** `sv_enforceGameBuild` is lower than what a resource needs. The recipe sets a current build.
- **Voice not working:** `pma-voice` is not started, or OneSync is off.

## QBCore on GamezServers

A [FiveM server from GamezServers](https://gamezservers.com/games/fivem) comes with txAdmin and its own MySQL database. In the recipe step, the database host, port, user, password and name are already filled in, so the connection string is right from the first start, and the details are under **Settings** for HeidiSQL. Ports are handled for you, **Backup** covers you before you add scripts, and the city stays up without anyone's PC. Not sure QBCore is the right framework? Read [QBCore vs Qbox vs ESX](https://gamezservers.com/guides/qbcore-vs-qbox-vs-esx).

## FAQ

### What is the easiest way to install QBCore?

The QBCore Framework recipe in txAdmin. It downloads the resources, imports the database and writes `server.cfg` for you.

### Does QBCore need a database?

Yes. It needs MySQL or MariaDB through `oxmysql`, with the tables from `qbcore.sql`.

### Why is my QBCore server stuck on loading?

Usually the database: a wrong `mysql_connection_string`, often still `localhost`, or tables that were never imported.

### Can I install QBCore on an existing FiveM server?

Yes, by hand: add the resources, import `qbcore.sql`, set the connection string and add the `ensure` lines. Back up first, since other frameworks clash with it.
