# How to Configure Your Sons of the Forest Server (dedicatedserver.cfg) (/docs/sons-of-the-forest/server-config)



import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
import { Step, Steps } from 'fumadocs-ui/components/steps';
import { Files, Folder, File } from 'fumadocs-ui/components/files';

Sons of the Forest uses `dedicatedserver.cfg` — a JSON file that controls all server settings. This guide covers every setting including the granular Custom game mode options.

Server File Structure [#server-file-structure]

<Files>
  <Folder name="(server root)" defaultOpen>
    <File name="dedicatedserver.cfg" />

    <File name="ownerswhitelist.txt" />

    <Folder name="Saves" defaultOpen>
      <Folder name="DedicatedServer" defaultOpen>
        <Folder name="Multiplayer" defaultOpen>
          <Folder name="0000000001">
            <File name="SaveData.zip" />
          </Folder>
        </Folder>
      </Folder>
    </Folder>
  </Folder>
</Files>

How to Edit [#how-to-edit]

<Steps>
  <Step>
    Stop your server [#stop-your-server]

    Go to **Console** in the [XGamingServer Panel](https://panel.xgamingserver.com) and stop the server.

    {/* Screenshot needed: Console page with Stop button */}
  </Step>

  <Step>
    Open the config [#open-the-config]

    Click **Files** in the sidebar and open `dedicatedserver.cfg`. This is a JSON file — make sure your edits maintain valid JSON syntax (quotes around strings, commas between fields).

    {/* Screenshot needed: File Manager showing dedicatedserver.cfg */}
  </Step>

  <Step>
    Save and start [#save-and-start]

    Click **Save Content** and start from **Console**.
  </Step>
</Steps>

Full Configuration Reference [#full-configuration-reference]

<Tabs items={['Server Settings', 'Game Mode & Difficulty', 'Custom Difficulty', 'Performance & Saves', 'Network & Ports']}>
  <Tab value="Server Settings">
    ```json
    {
      "ServerName": "My SotF Server",
      "MaxPlayers": 8,
      "Password": "",
      "LanOnly": false
    }
    ```

    | Setting      | Default                       | Description                                                             |
    | ------------ | ----------------------------- | ----------------------------------------------------------------------- |
    | `ServerName` | `"Sons Of The Forest Server"` | Name displayed in the server browser                                    |
    | `MaxPlayers` | `8`                           | Maximum players. **Hard cap of 8** — cannot go higher                   |
    | `Password`   | `""`                          | Join password (up to 40 characters). Empty = public                     |
    | `LanOnly`    | `false`                       | When `true`, the server only appears on LAN, not the public server list |
  </Tab>

  <Tab value="Game Mode & Difficulty">
    ```json
    {
      "GameMode": "Normal",
      "GameSettings": {
        "Gameplay.TreeRegrowth": true,
        "Structure.Damage": true
      }
    }
    ```

    Game Modes [#game-modes]

    | Mode           | Description                                               |
    | -------------- | --------------------------------------------------------- |
    | `Normal`       | Standard survival experience                              |
    | `Hard`         | Tougher enemies, scarcer resources                        |
    | `HardSurvival` | **Permadeath** — death deletes your character progress    |
    | `Peaceful`     | No enemy spawns, relaxed survival                         |
    | `Creative`     | Building-focused, no survival threats                     |
    | `Custom`       | Unlocks all granular settings (see Custom Difficulty tab) |

    GameSettings (Apply to Any Mode) [#gamesettings-apply-to-any-mode]

    These global settings work regardless of which GameMode you pick:

    | Setting                 | Default | Description                                          |
    | ----------------------- | ------- | ---------------------------------------------------- |
    | `Gameplay.TreeRegrowth` | `true`  | Cut trees regrow over time                           |
    | `Structure.Damage`      | `true`  | Player-built structures can take damage from enemies |
  </Tab>

  <Tab value="Custom Difficulty">
    When `GameMode` is set to `"Custom"`, you can fine-tune every aspect of the game via `CustomGameModeSettings`. These settings **only apply to new saves** — you can't change them on an existing world.

    ```json
    {
      "GameMode": "Custom",
      "CustomGameModeSettings": {
        "GameSetting.Vail.EnemySpawn": true,
        "GameSetting.Vail.EnemyHealth": "Normal",
        "GameSetting.Vail.EnemyDamage": "Normal",
        "GameSetting.Vail.EnemyArmour": "Normal",
        "GameSetting.Vail.EnemyAggression": "Normal",
        "GameSetting.Vail.AnimalSpawnRate": "Normal",
        "GameSetting.Vail.EnemySearchParties": "Normal",
        "GameSetting.Environment.StartingSeason": "Summer",
        "GameSetting.Environment.SeasonLength": "Default",
        "GameSetting.Environment.DayLength": "Default",
        "GameSetting.Environment.PrecipitationFrequency": "Default",
        "GameSetting.Survival.ConsumableEffects": "Normal",
        "GameSetting.Survival.PlayerStatsDamage": "Off",
        "GameSetting.Survival.ColdPenalties": "Off",
        "GameSetting.Survival.BuildingResistance": "Normal",
        "GameSetting.Survival.ReducedFoodInContainers": false,
        "GameSetting.Survival.SingleUseContainers": false,
        "GameSetting.Survival.CreativeMode": false,
        "GameSetting.Survival.PlayersImmortalMode": false,
        "GameSetting.Survival.OneHitToCutTree": false,
        "GameSetting.Multiplayer.Cheats": false,
        "GameSetting.Multiplayer.PvpDamage": "Normal"
      }
    }
    ```

    Enemy Settings [#enemy-settings]

    | Setting              | Values              | Description                           |
    | -------------------- | ------------------- | ------------------------------------- |
    | `EnemySpawn`         | true / false        | Toggle all enemy spawning             |
    | `EnemyHealth`        | Low / Normal / High | Enemy hit point pools                 |
    | `EnemyDamage`        | Low / Normal / High | Damage enemies deal to players        |
    | `EnemyArmour`        | Low / Normal / High | Enemy damage resistance               |
    | `EnemyAggression`    | Low / Normal / High | How aggressively enemies hunt players |
    | `AnimalSpawnRate`    | Low / Normal / High | Frequency of animal spawns            |
    | `EnemySearchParties` | Low / Normal / High | Frequency and size of enemy patrols   |

    Environment Settings [#environment-settings]

    | Setting                  | Values                             | Description                      |
    | ------------------------ | ---------------------------------- | -------------------------------- |
    | `StartingSeason`         | Spring / Summer / Autumn / Winter  | Season when the world starts     |
    | `SeasonLength`           | Short / Default / Long / Realistic | Duration of each season          |
    | `DayLength`              | Short / Default / Long / Realistic | Length of a full day/night cycle |
    | `PrecipitationFrequency` | Low / Default / High               | Rain and snow frequency          |

    Survival Settings [#survival-settings]

    | Setting                   | Values              | Description                              |
    | ------------------------- | ------------------- | ---------------------------------------- |
    | `ConsumableEffects`       | Normal / Hard       | Severity of hunger/thirst damage         |
    | `PlayerStatsDamage`       | Off / Normal / Hard | Damage from spoiled food                 |
    | `ColdPenalties`           | Off / Normal / Hard | Cold effects on health and stamina regen |
    | `BuildingResistance`      | Low / Normal / High | Structure durability                     |
    | `ReducedFoodInContainers` | true / false        | Less food in world containers            |
    | `SingleUseContainers`     | true / false        | Containers can only be looted once       |
    | `PlayersImmortalMode`     | true / false        | Players cannot die                       |
    | `OneHitToCutTree`         | true / false        | Trees fall in a single hit               |

    Multiplayer Settings [#multiplayer-settings]

    | Setting     | Values       | Description                        |
    | ----------- | ------------ | ---------------------------------- |
    | `Cheats`    | true / false | Enable console commands for admins |
    | `PvpDamage` | Normal       | Player vs player damage scaling    |
  </Tab>

  <Tab value="Performance & Saves">
    ```json
    {
      "SaveSlot": 1,
      "SaveMode": "Continue",
      "SaveInterval": 600,
      "IdleDayCycleSpeed": 0.0,
      "IdleTargetFramerate": 5,
      "ActiveTargetFramerate": 60,
      "LogFilesEnabled": false
    }
    ```

    | Setting                 | Default      | Description                                                                                                 |
    | ----------------------- | ------------ | ----------------------------------------------------------------------------------------------------------- |
    | `SaveSlot`              | `1`          | Which save slot to use (1, 2, 3, 4...). Each slot is a separate world                                       |
    | `SaveMode`              | `"Continue"` | `"Continue"` = load existing save. `"New"` = create fresh world (auto-switches to Continue after first run) |
    | `SaveInterval`          | `600`        | Seconds between auto-saves. Lower = less data loss on crash but more disk I/O                               |
    | `IdleDayCycleSpeed`     | `0.0`        | Time speed when no players are online. `0.0` = paused, `1.0` = normal speed                                 |
    | `IdleTargetFramerate`   | `5`          | FPS cap when no players are connected. Saves CPU while idle                                                 |
    | `ActiveTargetFramerate` | `60`         | FPS cap with players online. Minimum `10`                                                                   |
    | `LogFilesEnabled`       | `false`      | Enable server log files for debugging                                                                       |

    > **Tip:** Keep `IdleDayCycleSpeed` at `0.0` and `IdleTargetFramerate` at `5` to save resources when the server is empty.
  </Tab>

  <Tab value="Network & Ports">
    | Port      | Protocol | Purpose                                                     |
    | --------- | -------- | ----------------------------------------------------------- |
    | **8766**  | UDP      | Game traffic (gameplay netcode)                             |
    | **27016** | UDP      | Steam query (server browser discovery)                      |
    | **9700**  | UDP      | BlobSync (game state synchronization during player connect) |

    All three ports must be accessible for the server to function. They are typically pre-configured by XGamingServer.

    ```json
    {
      "IpAddress": "0.0.0.0",
      "GamePort": 8766,
      "QueryPort": 27016,
      "BlobSyncPort": 9700,
      "SkipNetworkAccessibilityTest": false
    }
    ```

    | Setting                        | Description                                                                                        |
    | ------------------------------ | -------------------------------------------------------------------------------------------------- |
    | `SkipNetworkAccessibilityTest` | Skip the port check on startup. Set to `true` if the startup check fails but the server works fine |
  </Tab>
</Tabs>

Admin Setup [#admin-setup]

Sons of the Forest uses `ownerswhitelist.txt` to designate server owners/admins.

<Steps>
  <Step>
    Find the player's Steam ID [#find-the-players-steam-id]

    Get their **SteamID64** from [steamid.io](https://steamid.io).
  </Step>

  <Step>
    Edit ownerswhitelist.txt [#edit-ownerswhitelisttxt]

    In **Files**, open `ownerswhitelist.txt`. Add one SteamID64 per line:

    ```
    76561198012345678
    ```
  </Step>

  <Step>
    Restart the server [#restart-the-server]

    Restart from **Console**. The listed players will have full admin access on next join.
  </Step>
</Steps>

Admins can use the **in-game admin panel** to kick, ban, teleport players, and promote/demote other admins. See [Admin Commands](/docs/sons-of-the-forest/admin-commands) if available.

Console Commands [#console-commands]

With `GameSetting.Multiplayer.Cheats` set to `true`, admins can open the console by typing `cheatstick` and pressing **F1**:

| Command               | Description                           |
| --------------------- | ------------------------------------- |
| `godmode on/off`      | Toggle invincibility                  |
| `invisible on/off`    | Enemies can't detect you              |
| `addallitems`         | Add every item to inventory           |
| `settimeofday <0-23>` | Set time of day                       |
| `season <name>`       | Change to summer/autumn/winter/spring |
| `killradius <number>` | Kill all enemies within radius        |
| `aidisable on/off`    | Disable all enemy AI                  |

Related Guides [#related-guides]

* [Connect to Your Server](/docs/sons-of-the-forest/join-server)
* [Difficulty Settings](/docs/sons-of-the-forest/difficulty-settings)
* [Upload a Save](/docs/sons-of-the-forest/import-save)
