# Server Setup Guide

**Ensure you have the necessary system requirements and dependencies installed:**

* **Operating System**: remote Desktop Connection or vps ( remote Desktop recommended).
* **Software**: Git, MySQL or MariaDB (for database), Visual Studio (if you need to compile resources).\
  Download the latest FiveM server artifacts from the official [FiveM website](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/).

**Installation Procedure**\
\
Step 1: Setting Up the Server Files

* Extract the downloaded server artifacts into your preferred server directory.<br>
* Create a folder called `server-data` for storing your resources, scripts, and configuration files.<br>

Step 2: Creating the CFX Key

* Go to keymaster.fivem.net.
* Log in with your CFX account and navigate to "Register" to create a new server key.
* Fill in the necessary details, such as server name, IP address, and country.
* Copy the generated key and save it for later use.<br>

**Step 3: Configuring the `server.cfg`**

* In the `server-data` folder, create a file named `server.cfg` if it doesn’t exist.<br>
* Open `server.cfg` in a text editor and paste the following template:<br>

  > ```cfg
  > # Server Configuration
  > endpoint_add_tcp "0.0.0.0:30120"
  > endpoint_add_udp "0.0.0.0:30120"
  >
  > sv_licenseKey "YOUR_CFX_KEY_HERE"
  > sv_hostname "Your Server Name"
  > ```

**Step 4: Adding the Database**\ <br>

* Install MySQL or MariaDB and set up a new database for your server.
* Use a tool like phpMyAdmin or MySQL Workbench for easy database management.
* Create a new user with permissions to access this database.
* Update your server resources to connect to this database, typically by editing configuration files within resource folders that require database access.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tchentro-tech-organization.gitbook.io/tchentro.tech-organization/server-setup-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
