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

# Server Setup

> Deploy Mythic Framework using the txAdmin Recipe Deployer

This guide covers deploying Mythic Framework to your FiveM server using the **txAdmin Recipe Deployer** — the recommended method for all users.

<iframe width="100%" height="400" src="https://www.youtube.com/embed/LSvHrTf-_hU" title="Mythic Framework Server Setup" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen style={{ borderRadius: '8px', marginTop: '16px', marginBottom: '16px' }} />

<Note>
  **What is txAdmin?** txAdmin is the official FiveM server management panel. It comes pre-installed with FiveM server builds and provides web-based server management, recipe deployment, and more.
</Note>

## Prerequisites

Before using the recipe deployer, make sure you have:

* **FiveM Server** — [Windows](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/) or [Linux](https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/) (txAdmin included)
* **MongoDB** 4.4+ — See [Database Setup](/installation/database-setup)
* **MariaDB/MySQL** 10.5+ or MySQL 8.0+ — See [Database Setup](/installation/database-setup)
* **Node.js** 18.x+ — [nodejs.org](https://nodejs.org/)

## Deployment

<Steps>
  <Step title="Start txAdmin">
    Launch `FXServer.exe` (Windows) or `./run.sh` (Linux) for the first time. txAdmin will provide a setup URL, usually `http://localhost:40120`.
  </Step>

  <Step title="Create Admin & Link License">
    Open the txAdmin URL in your browser, create an admin account, and link your FiveM license key from [Cfx.re Portal](https://portal.cfx.re/servers/registration-keys).
  </Step>

  <Step title="Deploy Recipe">
    In the deployment screen:

    1. Select **"Custom Recipe"** or **"Remote URL Template"**
    2. Enter the Mythic Framework recipe URL:
       ```
       https://raw.githubusercontent.com/Mythic-Framework/txAdminRecipe/main/mythic-stable.yaml
       ```
    3. Click **"Next"** or **"Deploy"**
  </Step>

  <Step title="Enter Credentials">
    The recipe will prompt you for:

    * **MongoDB** connection string, auth DB name, game DB name
    * **MariaDB/MySQL** host, port, username, password, database name
    * **Server** name, max players, license key, Steam Web API key

    <Warning>
      Have your database credentials ready before starting. The recipe tests connections during setup.
    </Warning>
  </Step>

  <Step title="Wait for Deployment">
    The recipe will download resources, install npm dependencies, configure `server.cfg`, and set up the database. **This takes 10-15 minutes** depending on your connection.
  </Step>

  <Step title="Verify">
    Once done, check the txAdmin dashboard shows "Server Online", verify resources loaded in the console, and connect via FiveM.
  </Step>
</Steps>

## Post-Deployment

<Accordion title="Server Settings" icon="gear">
  Edit `server.cfg` in txAdmin or directly:

  ```bash theme={null}
  sv_hostname "My Mythic Server"
  sv_maxclients 32

  sets tags "mythic, roleplay, economy"
  sets banner_detail "https://url-to-your-banner.png"
  sets banner_connecting "https://url-to-your-banner.png"

  # OneSync (required)
  set onesync on
  ```
</Accordion>

<Accordion title="Database Connections" icon="database">
  Database connections are auto-configured by the recipe. If your credentials change later, update them in `server.cfg`:

  ```bash theme={null}
  set mongodb_auth_url "mongodb://localhost:27017/..."
  set mongodb_auth_database "auth"
  set mongodb_game_url "mongodb://localhost:27017/..."
  set mongodb_game_database "fivem"
  set mysql_connection_string "mysql://user:pass@localhost/dbname"
  ```
</Accordion>

<Accordion title="Resource Load Order" icon="list-ol">
  Resource loading order is set in `resources.cfg`.

  <Warning>
    **Do NOT change the load order of core Mythic resources.** They depend on each other and must start in a specific sequence. `mythic-base` must always load first, followed by its dependencies. Changing this order will cause cascading failures across the framework.
  </Warning>

  If adding custom resources, place them **after** all Mythic resources in the load order.
</Accordion>

<Accordion title="Admin Permissions" icon="shield">
  Add yourself as admin in `server.cfg`:

  ```bash theme={null}
  add_principal identifier.fivem:YOUR_FIVEM_ID group.admin
  add_principal identifier.discord:YOUR_DISCORD_ID group.admin
  ```

  Find your identifiers by joining the server and typing `status` in the F8 console.
</Accordion>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Recipe URL not found" icon="link-slash">
    * Verify the URL: `https://raw.githubusercontent.com/Mythic-Framework/txAdminRecipe/main/mythic-stable.yaml`
    * Check your server has internet access
    * Try opening the URL in a browser
  </Accordion>

  <Accordion title="Database connection failed" icon="database">
    * Verify database servers are running
    * Check credentials are correct
    * Check firewall isn't blocking ports (27017 for MongoDB, 3306 for MySQL)
    * Make sure databases exist and user has permissions
  </Accordion>

  <Accordion title="npm/pnpm errors during deployment" icon="npm">
    * Verify Node.js: `node --version` (18.x+)
    * Check internet connection
    * Try manually running `npm install` in UI resource directories
  </Accordion>

  <Accordion title="Resources not loading" icon="box">
    * Check resource directories exist in `resources/[mythic]/`
    * Verify `resources.cfg` was created
    * Check console for specific errors
    * Restart txAdmin
  </Accordion>
</AccordionGroup>

For more help, see the [Troubleshooting Guide](/installation/troubleshooting).

## Next Steps

<CardGroup cols={2}>
  <Card title="First Start" icon="rocket" href="/installation/first-start">
    Connect to your server and create your first character
  </Card>

  <Card title="Configuration" icon="gear" href="/installation/configuration">
    Customize server settings and features
  </Card>
</CardGroup>
