> For the complete documentation index, see [llms.txt](https://docs.cuxial.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cuxial.com/scripts/core/cuxial-admin/installation.md).

# Installation

Install Cuxial Admin step by step: dependencies, SQL, first superadmin, convars and start order.

Cuxial Admin needs one SQL import and one staff row before anyone can open the panel. It adds no inventory items.

{% stepper %}
{% step %}

## Check the dependencies

These resources must be installed and working before you add the panel:

* `ox_lib`
* `oxmysql`
* `qbx_core`
* `cuxial_bridge`
* OneSync enabled on the server

{% hint style="warning" %}
QBox is the only supported framework. The manifest depends on `qbx_core`, so the resource refuses to start without it.
{% endhint %}

The optional integrations are listed in the [Overview](/scripts/core/cuxial-admin.md#requirements). None of them is needed to start.
{% endstep %}

{% step %}

## Copy the resource

Place the `cuxial_admin` folder inside your `resources` directory. Keep the folder name as it is.
{% endstep %}

{% step %}

## Import the SQL

Run `install/cuxial_admin.sql` on your database. It creates five tables: `cuxial_admin_ranks`, `cuxial_admin_staff`, `cuxial_admin_sanctions`, `cuxial_admin_report_transcripts` and `cuxial_admin_audit`.

The resource does not create its tables by itself. Without this import every query fails.
{% endstep %}

{% step %}

## Add the first superadmin

Add your Discord account as the first superadmin. The SQL file ends with a commented template for this row: replace `YOUR_DISCORD_ID` with your Discord ID and run it.

```sql
INSERT INTO `cuxial_admin_staff` (`scope`, `identifier`, `label`, `rank`, `added_by`)
VALUES ('discord', 'YOUR_DISCORD_ID', 'Your name', 'superadmin', 'install');
```

* `scope = 'discord'` gives the rank to that Discord account, on all its characters. The player must have Discord linked to FiveM.
* To give it to a single character, use `scope = 'character'` and the character's citizenid as `identifier`.

The rank `superadmin` is created the first time the resource starts. If you add the row while the server is running, type `staffreload` in the server console to apply it.

From here on, grant and remove ranks from the panel. Whoever is in `cuxial_admin_staff` as `superadmin` has full control of it.
{% endstep %}

{% step %}

## Set the convars

All of them are optional. Without them the panel works, with the screen view and the remote web panel turned off. The remote web panel also needs `remote.enabled = true` in `shared/config.lua`.

{% code title="server.cfg" %}

```cfg
# Language of notifications and key names (en and es are included)
setr ox:locale "en"

# Staff allowed to view a player's screen: Discord IDs separated by commas
set cuxial_admin_screen_owners "DISCORD_ID_1,DISCORD_ID_2"

# Optional media relay for the screen view
set sd_phone_relay_url "wss://YOUR_RELAY_HOST/PATH"
set sd_phone_relay_key "YOUR_64_CHARACTER_HEX_KEY"
set sd_phone_relay_ttl "45"

# Optional remote web panel
set cuxial_admin_remote_url "http://YOUR_PANEL_SERVICE"
set cuxial_admin_remote_secret "YOUR_SHARED_SECRET"

# SQL trace in the server console
set cuxial_admin_debug "0"
```

{% endcode %}

{% hint style="danger" %}
Write the relay key and the remote secret with `set`, never with `setr`. `setr` sends the value to every player.
{% endhint %}

What each one does is explained in [Configuration](/scripts/core/cuxial-admin/configuration.md#convars).
{% endstep %}

{% step %}

## Start the resource

Start the panel after its dependencies:

{% code title="server.cfg" %}

```cfg
ensure ox_lib
ensure oxmysql
ensure qbx_core
ensure cuxial_bridge
ensure cuxial_admin
```

{% endcode %}

Optional integrations are detected while the server runs, so their position in the list does not matter.
{% endstep %}

{% step %}

## Check that it works

1. Join the server with the account you added and load a character.
2. Press <kbd>U</kbd> or type `/admin`. The panel opens.
3. Open the staff section and check that your rank is listed.
4. With another account, type `/report` and send a message. It appears in the reports tab of the panel.
   {% endstep %}
   {% endstepper %}

Next: adjust the panel to your server in [Configuration](/scripts/core/cuxial-admin/configuration.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cuxial.com/scripts/core/cuxial-admin/installation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
