> ## Documentation Index
> Fetch the complete documentation index at: https://docs.youba.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install YB Admin, configure your first owner, and verify the resource.

Follow these steps to install YB Admin on a new server.

## Prerequisites

* FiveM server artifact 7290 or newer
* OneSync enabled
* QBox, QBCore, or ESX
* `oxmysql` running before YB Admin for persistence
* The included `web/dist` production interface

<Steps>
  <Step title="Add the resource">
    Place the complete resource in your server's resources directory.

    ```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
    resources/
    └── yb-admin/
        ├── client/
        ├── editable/
        ├── locales/
        ├── server/
        ├── web/dist/
        ├── config.lua
        └── fxmanifest.lua
    ```

    Keep the folder named `yb-admin`. If you rename it, update `Config.ResourceName` in `config.lua`.
  </Step>

  <Step title="Set the start order">
    Start the database, framework, and optional integrations before YB Admin.

    ```cfg theme={"theme":{"light":"github-light","dark":"github-dark"}}
    # Database
    ensure oxmysql

    # Choose one framework
    ensure qbx_core
    # ensure qb-core
    # ensure es_extended

    # Optional integrations
    ensure ox_lib
    ensure ox_inventory
    ensure screencapture

    # Admin menu
    ensure yb-admin
    ```

    Do not run multiple frameworks. QBox must start before `yb-admin` because it also provides compatibility behavior used by some QBCore resources.
  </Step>

  <Step title="Configure an owner">
    Open `editable/server.lua` and add at least one trusted identifier.

    ```lua theme={"theme":{"light":"github-light","dark":"github-dark"}}
    Config.Owners = {
        license = {
            'license:YOUR_LICENSE_HERE',
        },
        discord = {
            -- 'discord:YOUR_DISCORD_ID',
        },
        steam = {},
        fivem = {},
    }
    ```

    Owner identifiers are server-only. Never move them to `config.lua` or a client file.
  </Step>

  <Step title="Configure Discord logs">
    Open `editable/server/webhooks.lua` and set a fresh webhook URL.

    ```lua theme={"theme":{"light":"github-light","dark":"github-dark"}}
    local PRIMARY_WEBHOOK = 'https://discord.com/api/webhooks/...' 
    ```

    Use separate category URLs when you want different Discord channels for reports, staff activity, bans, items, or screenshots.
  </Step>

  <Step title="Start and verify">
    Restart the server or run:

    ```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
    ensure yb-admin
    ```

    Join with the configured owner identifier, run `/admin`, select **Go On Duty**, then open **Admin Panel**.
  </Step>
</Steps>

## ACE group assignment

You can assign a configured group from `server.cfg` instead of adding a database staff record:

```cfg theme={"theme":{"light":"github-light","dark":"github-dark"}}
add_principal identifier.license:YOUR_LICENSE_HERE yb-admin.group.admin
```

Default group names are `helper`, `mod`, `admin`, `dev`, `superadmin`, and `owner`.

## Database setup

No SQL import is required. When `oxmysql` is available, YB Admin creates these tables automatically:

* `yb_admin_groups`
* `yb_admin_staff`
* `yb_admin_staff_profiles`
* `yb_admin_settings`
* `yb_admin_logs`
* `yb_admin_reports`
* `yb_admin_bans`
* `yb_admin_jails`

<Note>
  Reports and panel logs are session-scoped by default and are cleared when the resource starts. Discord audit messages are not affected.
</Note>

## Verify the installation

You should see a permissions-ready message in the FXServer console with the detected framework and database state. Confirm that:

* `/admin` opens the mini menu
* **Go On Duty** changes to the red off-duty action
* **Admin Panel** opens the full workspace
* The sidebar only shows sections allowed by the current group
* Personal settings remain after reconnecting when `oxmysql` is running
