# Artifacts and configuration

Pick and switch the FXServer artifact, choose the .cfg the server starts with, edit .cfg files without exposing their secrets and schedule the server's restarts from the panel.

Source: https://fivedash.fivex.gg/docs/en/server/artifacts-and-config

All of this lives in **Server → Resources**, above the resource list: the **Startup** and **Restarts** cards side by side and, below them, **Artifacts**. The **artifact** is FXServer, the program that runs the FiveM server. You edit `.cfg` files in **Resources → Folder**. It all needs the [FiveDash Agent](https://fivedash.fivex.gg/docs/en/server/agent).

## Before you start

* **Agent:** installed and **Connected**.
* **Access level:**
  * **Configuration** for **Startup** and **Restarts**, and **Artifacts** for the artifacts: **View** level to look and **Configure** to change.
  * **Files** for the `.cfg` files in **Folder**: **Manage** level to open and **Configure** to save.
* **Cfx.re license:** to download an artifact for the first time, you accept Cfx.re's [Platform License Agreement](https://fivem.net/terms), which applies to whoever downloads and runs FXServer.

## Artifacts

The card shows the artifact **In use** and the ones available:

| Tag                      | What it means                                                          |
| ------------------------ | ---------------------------------------------------------------------- |
| **FiveDash recommended** | Tested by FiveDash with the `fivedash` resource, with the file checked |
| **Cfx.re recommended**   | What Cfx.re recommends now                                             |
| **Newest**               | The latest version Cfx.re published                                    |

Each one shows until when Cfx.re supports it. A warning shows when the artifact in use is no longer supported: servers on an artifact unsupported for over 3 months drop off the server list.

### Pick the artifact

Click **Download and use** on the artifact you want, or **Use** on one already on the machine.

### Confirm

The first time, tick that you accept the Platform License Agreement. The agent downloads the artifact from Cfx.re (about 100 MB) and restarts the server on it. Follow it on the **Console**.

The files come **straight from Cfx.re** to the machine: FiveDash doesn't store or modify FXServer. If the new artifact crashes **3 times in 10 minutes**, the agent goes back to the previous one by itself and the **Console** says so. The machine keeps up to 3 artifacts.

## Startup

| Option                                     | What it does                                                                                                                                                                                          |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Main .cfg file**                         | The file the server starts with, inside the server folder (such as `server.cfg` or `cfg/main.cfg`). Empty, the installation's one applies. In **Folder**, it shows in blue with the **Default** tag   |
| **Install and keep the fivedash resource** | If there's no `fivedash` resource in `resources`, the agent installs it, connects it to the panel and adds `ensure fivedash` to the `.cfg`. One that's already there is left alone: it updates itself |

Click **Save** for it to apply: it stays gray until you change something on the card. The new `.cfg` applies from the next restart.

## .cfg files

In **Resources → Folder**, click the file, such as `server.cfg` or `cfg/permissions.cfg`. The list slides to the left and the file opens in an editor beside it, with the commands in color.

* **Hidden secrets.** `sv_licenseKey`, `steam_webApiKey`, `mysql_connection_string`, `rcon_password` and other values named like a key, password or token show as `********`. Leave the asterisks to keep the value: it never leaves the machine. To change a secret, delete the asterisks and type the new one.
* **Save.** Click **Save** or press Ctrl+S (⌘S on a Mac). The agent keeps a copy of the previous file on the machine and writes the new one. If someone changed the file on the machine after you opened it, the panel says so and doesn't write, without overwriting the other person's change: close the file and open it again.
* **Apply.** Changes to `.cfg` files apply from the next restart. Restart from the **Console**.

## Restarts

| Option                                       | What it does                                                             |
| -------------------------------------------- | ------------------------------------------------------------------------ |
| **Start again if it crashes or hangs**       | The agent starts the city again when FXServer closes or stops answering  |
| **Start the server when the machine starts** | After a machine restart, starts the server if it was running before      |
| **Scheduled restarts**                       | Every day, at the times you pick (up to 12), in the city's **Time zone** |

Click **Save** for it to apply: it stays gray until you change something on the card.

**Coming restarts** lists those in the next 24 hours. **Skip the next one** cancels only the next one (and **Undo the skip** brings it back); **Restart once in** sets a one-off restart a few minutes from now (up to 1439). Saving new times undoes the skip and the one-off.

With agent 0.1.7 and resource 0.9.0 or newer, players are warned in game 30, 15, 10, 5, 4, 3, 2 and 1 minute before, and scripts get the `scheduledRestart` event (see [Players](https://fivedash.fivex.gg/docs/en/server/players#events-for-scripts)). Before stopping or restarting from the panel, the agent tells the server and waits 5 seconds for scripts to save.

## Frequently asked questions

### Why can't I pick any build?

The agent only downloads artifacts Cfx.re publishes, and FiveDash can block an artifact that took servers down. If the one you want isn't there, Cfx.re no longer offers it or it was blocked.

### Where are the artifacts and the server.cfg copies?

On the machine, in `C:\ProgramData\FiveDash\Agent`: artifacts in `builds`, `.cfg` copies in `backups` (the 20 most recent of each file).

## Next steps

[Console, resources and players](https://fivedash.fivex.gg/docs/en/server/console-and-players)Start, restart and follow the city.
[FiveDash Agent](https://fivedash.fivex.gg/docs/en/server/agent)How the agent works and how it protects the machine.
