# Connect your city to FiveDash

Your FiveM or RedM city linked to the dashboard, with the fivedash resource installed and the server showing as Connected.

Source: https://fivedash.fivex.gg/docs/en/tutorials/connect-your-city

In this tutorial you create your account, set up the organization and the first server in the dashboard, and install the `fivedash` resource on your city. At the end, the dashboard shows **Connected** and the server's modules open. It's for the owner or admin who has access to the server's files.

## What you need

* An e-mail you can open right now: the verification code goes there.
* Access to the server's `resources` folder and `server.cfg`.
* Your city's framework starting before `fivedash`. For whitelist and store delivery, a started MySQL driver: `oxmysql`, `mysql-async` or `ghmattimysql`.
* Your city's public address (`cfx.re/join/...` or `IP:port`) if you want to show status and players. It's optional.

> **RedM**
>
> On RedM, `server.cfg` must have `set gamename rdr3`, and `oxmysql` must start before `fivedash`.

## 1. Create your account

Go to `/cadastro`. Fill in **E-mail**, **Password** and **Confirm password** and click **Create account**. The **Password strength** bar must reach at least **Good**.

Type the 6-digit code from your e-mail into **Verification code** and click **Verify e-mail**. It worked when **Account created** shows and the dashboard opens on the **Get started** screen.

## 2. Set up the organization and the server

The **Get started** screen (`/comecar`) has four steps:

| Step             | What to fill in                                                                       | Button                                               |
| ---------------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| **You**          | **Name** and, optionally, your **Discord** username                                   | **Continue**                                         |
| **Organization** | **Organization name** and **Address** (e.g. `cidade-exemplo`). Wait for **Available** | **Continue**                                         |
| **Server**       | **Game** (**FiveM** or **RedM**), **Server name** and, optionally, the **Address**    | **Add server**                                       |
| **Team**         | E-mails and each person's **Role**, or nobody                                         | **Invite 1 person**, **Finish** or **Do this later** |

Pick the right **Game**: it sets what the store delivers and the bot's words. You can change it later in **Manage servers**.

When you're done, **All set** shows. Every field is in [Your first city](https://fivedash.fivex.gg/docs/en/getting-started/first-city).

## 3. Choose the plan

The dashboard opens with **Choose your organization's plan**. Pick the **Tier**, the **Modules** and, if you want, **FiveDash AI**. Click **Start 7-day free trial**: no card needed.

It worked when the trial card shows at the bottom of the sidebar (e.g. **Pro trial**). Only the **Owner** and **Admins** choose the plan. See [Plans and billing](https://fivedash.fivex.gg/docs/en/getting-started/plans-and-billing).

## 4. Generate the key and download the resource

Open any of the server's modules, for example **Discord**. Instead of the pages, **Connect** + the server name shows (e.g. **Connect Cidade Exemplo**).

1. Click **Generate key**. The key starts with `fdk_`.
2. Under **Download the resource**, click **Download fivedash.zip**. The zip's `config.lua` already has this server's key.

The same path is in **Server → Overview** → **Game connection** card → **Connect server**. Only the organization's **Owner** and **Admin** can connect the server.

> The key is only shown when it's generated and gives access to the server on FiveDash. Don't publish `config.lua` or send it in tickets or chats. If the key leaks, click **Generate new key**: the old one stops working right away.

## 5. Install the resource on your city

Unzip it and put the `fivedash` folder inside `resources`. Keep the name `fivedash`: scripts call `exports.fivedash:…`.

In `server.cfg`, start `fivedash` after the database and the framework:

> **FiveM**
>
> ```bash
> ensure oxmysql
> ensure qb-core
> ensure fivedash
> ```
>
> Replace `qb-core` with your framework's line (e.g. `ensure es_extended` or `ensure vrp`).

> **RedM**
>
> ```bash
> set gamename rdr3
> ensure oxmysql
> ensure vorp_core
> ensure vorp_inventory
> ensure fivedash
> ```
>
> On RSG, replace the two in the middle with `ensure rsg-core` and `ensure rsg-inventory`.

## 6. Restart and check

Restart the city, or type `refresh` and then `ensure fivedash` in the console. The dashboard shows **Waiting for the server to connect…** and switches to **Connected** on its own. The modules open right away.

The server console shows:

```text
[FiveDash] Connected to FiveDash as "Example City".
```

In **Server → Overview**, the **Game connection** card shows:

| Field                      | What you should see                                                 |
| -------------------------- | ------------------------------------------------------------------- |
| Status                     | **Connected**                                                       |
| **Framework**              | Your city's framework. **None detected** means it wasn't recognized |
| **Whitelist via FiveDash** | **Active**, **Unavailable** or **Not supported yet**                |
| **Last sync**              | **just now**                                                        |
| **Resource**               | The installed resource version                                      |

### If it doesn't connect

Run `fivedash status` in the console: it shows the framework, the dashboard connection and the syncs. Every line from the resource starts with `[FiveDash]`. The most common messages:

| Console message                                                         | What to do                                                                                     |
| ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| "No dashboard key: this server isn't connected to FiveDash."            | Paste the key into `Key` in `fivedash/config.lua`                                              |
| "The dashboard key doesn't look right (it starts with fdk\_)."          | Copy the whole key again                                                                       |
| "key refused by the dashboard"                                          | The key was replaced or the server was disconnected. Generate a new one and replace `Key`      |
| "this key is already in use by another server that's running right now" | Each server has its own key. If you just restarted, it gets back in by itself in a few seconds |
| "No known framework found…"                                             | Run `fivedash detect` and check that the framework starts before `fivedash`                    |

After changing `config.lua`, run `restart fivedash`. More cases in [Troubleshooting](https://fivedash.fivex.gg/docs/en/help/troubleshooting).

## Next steps

[Install the resource](https://fivedash.fivex.gg/docs/en/getting-started/install-resource)

config.lua, console commands and the Game connection card.

[Frameworks](https://fivedash.fivex.gg/docs/en/developers/frameworks)

How each framework is detected and what works on it.

[Bot](https://fivedash.fivex.gg/docs/en/discord/bot)

Connect your city's Discord bot.

[RedM](https://fivedash.fivex.gg/docs/en/getting-started/redm)

What changes on a RedM server.
