Sons of the Forest Server Settings
Every option in the Sons of the Forest dedicatedserver.cfg explained: ports, game mode, saving, password and custom game rules, with examples.
Quick answer: The settings live in dedicatedserver.cfg inside the server's user data folder. Despite the .cfg extension it is a JSON file. Restart the server after every change.
Where is dedicatedserver.cfg?
The server creates a user data folder on its first start. It contains:
dedicatedserver.cfg– the server settingsownerswhitelist.txt– owners/admins (SteamID64, one per line)SonsGameSettings.cfg– game settingsSaves/– the save games
On Windows the default path is C:\Users\<user>\AppData\LocalLow\Endnight\SonsOfTheForestDS. The start parameter -userdatapath "path/to/folder" sets a different folder. On a rented game server you find the folder in the panel's file manager or via SFTP – the folder in use is shown in the start command under Startup (parameter -userdatapath).
The default configuration
{
"IpAddress": "0.0.0.0",
"GamePort": 8766,
"QueryPort": 27016,
"BlobSyncPort": 9700,
"ServerName": "Sons Of The Forest Server (dedicated)",
"MaxPlayers": 8,
"Password": "",
"LanOnly": false,
"SaveSlot": 1,
"SaveMode": "Continue",
"GameMode": "Normal",
"SaveInterval": 600,
"IdleDayCycleSpeed": 0.0,
"IdleTargetFramerate": 5,
"ActiveTargetFramerate": 60,
"LogFilesEnabled": false,
"TimestampLogFilenames": true,
"TimestampLogEntries": true,
"SkipNetworkAccessibilityTest": false,
"GameSettings": {},
"CustomGameModeSettings": {}
}
No key is mandatory: a missing key falls back to its default, and the order does not matter. If the file is not valid JSON (a missing comma or quote, for example), the start-up self-test fails and the server does not start.
Network and ports
IpAddress– interface the server listens on. Default0.0.0.0(all). Leave it alone on a rented server.GamePort– game traffic, default 8766 UDP.QueryPort– Steam server list, default 27016 UDP.BlobSyncPort– data sync of the game systems, default 9700 UDP.LanOnly–trueshows the server on the LAN only. Alwaysfalsefor a rented server.SkipNetworkAccessibilityTest– skips the public IP and port checks at start-up. Expert-only according to the developer, not recommended.
On a rented server the ports are assigned for you. Do not change them in the file, or they will no longer match the open ports.
Name, slots and password
ServerName– name in the server list.MaxPlayers– maximum number of players, 1 to 8.Password– server password, up to 40 characters. Empty = no password.
Save game and game mode
SaveSlot– number of the save slot (1 or higher).SaveMode–"Continue"loads the save in the slot, or creates it if it is missing."New"creates a new game and overwrites the slot – on every restart, for as long as the value staysNew. Switch it back toContinueafter the first start.GameMode–Normal,Hard,HardSurvival,Peaceful,CreativeorCustom. Only applies when a new save is created; ignored when an existing save is loaded.SaveInterval– seconds between autosaves, default 600 (10 minutes).
Idle and performance
IdleDayCycleSpeed– time speed while no player is online (0 to 1). Default0.0: time stands still.IdleTargetFramerate– server frame rate without players, default 5.ActiveTargetFramerate– server frame rate with players, default 60 (minimum 10).
The defaults are sensible. Higher values do not improve gameplay but cost CPU.
Logs
LogFilesEnabled–truewrites log files to<user data folder>/logs.TimestampLogFilenames–truecreates a new filesotf_log_<date>.txtper start,falsealways overwritessotf_log.txt.TimestampLogEntries– timestamp in front of every log line.
When troubleshooting, set LogFilesEnabled to true.
GameSettings: trees and building damage
GameSettings applies in every game mode. The official guide lists two keys:
"GameSettings": {
"Gameplay.TreeRegrowth": true,
"Structure.Damage": true
}
Gameplay.TreeRegrowth– felled trees grow back (triggered when sleeping).Structure.Damage– buildings can be damaged.
CustomGameModeSettings: your own rules
Only used when "GameMode": "Custom" is set and a new save is created. Example from the official guide:
"CustomGameModeSettings": {
"GameSetting.Multiplayer.Cheats": false,
"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.StatRegenerationPenalty": "Off",
"GameSetting.Survival.ReducedFoodInContainers": false,
"GameSetting.Survival.SingleUseContainers": true,
"GameSetting.Survival.BuildingResistance": "Normal",
"GameSetting.Survival.CreativeMode": false,
"GameSetting.Survival.PlayersImmortalMode": false,
"GameSetting.FreeForm.ForcePlaceFullLoad": false,
"GameSetting.Construction.NoCuttingsSpawn": false,
"GameSetting.Survival.OneHitToCutTrees": false
}
Allowed values according to the guide:
- Enemies (
EnemyHealth,EnemyDamage,EnemyArmour,EnemyAggression,AnimalSpawnRate,EnemySearchParties):Low,Normal,High StartingSeason:Spring,Summer,Autumn,WinterSeasonLength,DayLength:Short,Default,Long,RealisticPrecipitationFrequency:Low,Default,HighConsumableEffects:Normal,HardPlayerStatsDamage,ColdPenalties,StatRegenerationPenalty:Off,Normal,HardBuildingResistance:Low,Normal,High- all other entries:
trueorfalse
Overriding settings with start parameters
Every value in the file can be overridden at start-up – handy if you don't want to edit the file:
SonsOfTheForestDS.exe -dedicatedserver.ServerName "My Server" -dedicatedserver.MaxPlayers "4"
Common mistakes
- Server won't start after a change: check the JSON – separate every key/value pair with a comma, put text in quotes, no comma after the last entry.
- Save game is gone:
SaveModewas set toNew. Set it back toContinue; only a backup can restore the overwritten slot. - Custom settings have no effect: they only apply to a new save with
GameMode: Custom.
Related guides
Source: official Endnight dedicated server guide (Steam, linked in the patch notes) · Rent a server: Sons of the Forest server at NexoraHost