> For the complete documentation index, see [llms.txt](https://docs.fivemstats.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fivemstats.net/panel/adding-a-server.md).

# Adding a Server

Connect your FiveM server to the panel.

Install the script first: [Installation](https://docs.fivemstats.net/tgiann-fivem-stats-script/installation.md).

1. Open [My Servers](https://www.fivemstats.net/dashboard/my-servers) and sign in with Discord.
2. Click **Add a server** and fill in the form:

| Field                     | What to enter                                       | Example           |
| ------------------------- | --------------------------------------------------- | ----------------- |
| **Name**                  | Any display name                                    | `My FiveM server` |
| **Server IP or hostname** | Your server's public IP or hostname, without a port | `203.0.113.10`    |
| **Game port**             | The port of `endpoint_add_tcp` in `server.cfg`      | `30120`           |
| **Secret key**            | The same value as `tgiann_stats_secret_key`         |                   |

3. Click **Add server**. The panel tests the connection first and only saves a server that answers.

The secret key is stored encrypted and is never shown to your members.

{% hint style="warning" %}
The panel cannot reach local addresses (`127.0.0.1`, `192.168.x.x`, `10.x.x.x`). Use the server's public IP.
{% endhint %}

## The test failed

| Message                         | Fix                                                                                                                  |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| Connection refused or timed out | Check `set sv_enableHttpServer true` and the game port. If players can join on that port, the panel can reach it too |
| 401 Unauthorized                | The key does not match `tgiann_stats_secret_key`. Keys are case-sensitive                                            |
| 429 Too many failed attempts    | 10 wrong keys within a minute. Fix the key and try again after a minute                                              |
| 404 Endpoint not found          | The resource is not started, or its folder is not named `tgiann-fivem-stats-script`                                  |

More in [Common Problems](https://docs.fivemstats.net/tgiann-fivem-stats-script/common-problems.md).

To change the IP, port or key later: [Settings > Connection](https://docs.fivemstats.net/panel/settings.md#connection).
