> For the complete documentation index, see [llms.txt](https://mango-5m.gitbook.io/mango5m-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mango-5m.gitbook.io/mango5m-docs/resources/mango-mdt/getting-started/installation.md).

# Installation

Install Mango MDT — files, database import, and server.cfg — in five steps.

{% stepper %}
{% step %}

### Add the resource

Drop the `mango_mdt` folder into your server's `resources` directory.

{% hint style="danger" %}
The folder **must** be named `mango_mdt` exactly. Inventory item hooks (`server = { export = 'mango_mdt.bodycam' }`) and cross-resource exports reference the resource by this name — renaming the folder breaks them.
{% endhint %}
{% endstep %}

{% step %}

### Import the core SQL

Import `mango_mdt/sql/install.sql` into your server's database (HeidiSQL, phpMyAdmin, or the `mysql` CLI). It creates the core tables — departments, users, permissions, settings, logs — and seeds:

* the three core permissions (`mdt.access`, `mdt.admin`, `mdt.manage_users`),
* one default department: **Los Santos Police Department** with the short code `police`.

The import is safe to re-run — everything is `IF NOT EXISTS` / `ON DUPLICATE KEY`.

{% hint style="info" %}
**Only the core `sql/install.sql` needs a manual import.** Every plugin (warrants, evidence, bodycam, …) carries its own migrations and runs them **automatically** on first start.
{% endhint %}
{% endstep %}

{% step %}

### Add to server.cfg

Add the resource **after** oxmysql and your framework:

{% tabs %}
{% tab title="ESX Legacy" %}

```
ensure oxmysql
ensure es_extended
ensure mango_mdt
```

{% endtab %}

{% tab title="QBCore" %}

```
ensure oxmysql
ensure qb-core
ensure mango_mdt
```

{% endtab %}

{% tab title="Qbox" %}

```
ensure oxmysql
ensure qbx_core
ensure mango_mdt
```

{% endtab %}
{% endtabs %}

The framework is auto-detected — or pin it in `config/bridge.lua`: `Framework = 'esx'` / `'qbcore'` / `'qbox'`. If you run optional integrations (ox\_inventory, ox\_lib, a billing or dispatch resource), start those before `mango_mdt` too, so auto-detection sees them.
{% endstep %}

{% step %}

### Create your admin user

One SQL insert with your own identifier — follow [First Admin Setup](/mango5m-docs/resources/mango-mdt/getting-started/first-admin-setup.md).
{% endstep %}

{% step %}

### Start and verify

Restart the server (or `refresh` then `ensure mango_mdt` from the console). On a healthy boot the console lists each plugin as it loads and applies any pending plugin migrations. Then check:

* `/mdt` in-game (default keybind `F6`) opens the tablet — with your admin row in place, you'll land on the dashboard.
* `mango_bridges` in the **server console** prints which provider was bound for every bridge category (framework, inventory, notifications, dispatch, billing, clothing) — the fastest way to confirm your integrations were detected.

If the console instead shows `Schema not found - import sql/install.sql to finish setup.`, step 2 wasn't run against the database this server actually connects to.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
`restart mango_mdt` is always safe on a live server — any open tablet is force-closed cleanly and players can reopen immediately.
{% endhint %}
