# How To Configure Your FiveM Server (/docs/fivem/configure-your-server)



FiveM server configuration is handled through the `server.cfg` file. Here is an overview of the key settings.

Using Startup Settings [#using-startup-settings]

<div className="fd-steps">
  <div className="fd-step">
    Open the Startup Page [#1-open-the-startup-page]

    Log in to the [XGamingServer Panel](https://panel.xgamingserver.com) and select your FiveM server. In the sidebar, click **Startup**.
  </div>

  <div className="fd-step">
    Adjust Settings [#2-adjust-settings]

    The Startup page provides fields for common settings including license key, server name, max players, and more.
  </div>

  <div className="fd-step">
    Restart Your Server [#3-restart-your-server]

    After making changes, restart from the **Console** page.
  </div>
</div>

Editing server.cfg [#editing-servercfg]

<div className="fd-steps">
  <div className="fd-step">
    Open Files [#1-open-files]

    In the sidebar, click **Files** and open `server.cfg`.
  </div>

  <div className="fd-step">
    Edit the Configuration [#2-edit-the-configuration]

    Here is an example of common `server.cfg` settings:

    ```
    # Server Identity
    sv_hostname "My FiveM Server"
    sv_projectName "My Server Project"
    sv_projectDesc "A custom FiveM server"

    # License Key
    sv_licenseKey "your_license_key_here"

    # Network Settings
    sv_maxclients 32
    endpoint_add_tcp "0.0.0.0:30120"
    endpoint_add_udp "0.0.0.0:30120"

    # OneSync (improved player synchronization)
    onesync on

    # Security
    sv_scriptHookAllowed 0

    # Resources
    ensure mapmanager
    ensure chat
    ensure spawnmanager
    ensure sessionmanager
    ensure basic-gamemode
    ensure hardcap

    # Permissions
    add_ace group.admin command allow
    add_ace group.admin command.quit deny
    add_principal identifier.steam:110000xxxxxxxxx group.admin
    ```
  </div>

  <div className="fd-step">
    Save and Restart [#3-save-and-restart]

    Save the file and restart your server.
  </div>
</div>

Key Settings Explained [#key-settings-explained]

| Setting                | Description                                    |
| ---------------------- | ---------------------------------------------- |
| `sv_hostname`          | Server name in the browser                     |
| `sv_maxclients`        | Maximum player count                           |
| `sv_licenseKey`        | Your cfx.re license key                        |
| `onesync`              | Enables improved sync for higher player counts |
| `sv_scriptHookAllowed` | Allow ScriptHook (0 = disabled, 1 = enabled)   |
| `ensure`               | Starts a resource when the server boots        |

> ⚠️ **Warning:** Keep `sv_scriptHookAllowed` set to `0` unless you specifically need it. Enabling it allows clients with modding tools to potentially exploit your server.

> 📝 **Note:** The `ensure` command loads resources in order. Make sure dependencies are loaded before resources that require them.
