The Don't Starve Together Dedicated Server runs the surface world (Master) and underground caves (Caves) as two independent processes. This substantially distributes single-core computation and prevents the whole group disconnecting when the host leaves. This article covers standard cluster configuration, shard communication, token validation, and mod loading.
1. Two-shard architecture and ports
A DST dedicated server consists of one Cluster and multiple Shards. Each shard uses a separate CPU core and listens on its own communication ports:
| Architecture layer | Default port | Protocol | Purpose |
|---|---|---|---|
| Internal cluster communication (Master) | 10888 |
UDP | Internal cluster port listened to by the surface process (Caves synchronizes state through it) |
| Surface player connection (Master) | 10999 |
UDP | Direct game port for clients connecting to the surface world |
| Caves player connection (Caves) | 10998 |
UDP | Communication port when clients move into caves through wormholes/sinkholes |
| Steam authentication ports | 27018 ~ 27019 |
UDP | Server listing and heartbeat synchronization with the Steam backend |
2. SteamCMD installation and Klei authentication
1. Download the server
The dedicated server AppID is 343050:
steamcmd +login anonymous +app_update 343050 validate +quit
2. Obtain a Klei server token (Cluster Token)
DST requires every dedicated server to provide a token linked to a Klei account:
- Visit the Klei account center and sign in with Steam:
https://accounts.klei.com/account/game/servers?game=DontStarveTogether - Click "Add New Server" at the bottom of the page and enter a display name.
- Copy the generated long token string and save it as
cluster_token.txt.
3. Configuration and shard directory structure
Cluster data is saved by default at:
- Windows:
C:\Users\<username>\Documents\Klei\DoNotStarveTogether\MyDediServer\ - Linux:
~/.klei/DoNotStarveTogether/MyDediServer/
1. Root cluster.ini (global cluster settings)
[GAMEPLAY]
game_mode = survival
max_players = 8
pvp = false
pause_when_empty = true
[NETWORK]
cluster_name = LanGame DST Private Server
cluster_description = Welcome to Don't Starve Together!
cluster_password = your_password
cluster_intention = cooperative
[MISC]
console_enabled = true
[SHARD]
shard_enabled = true
bind_ip = 127.0.0.1
master_ip = 127.0.0.1
master_port = 10888
cluster_key = defaultSecretKey123
2. Surface shard Master/server.ini
[NETWORK]
server_port = 10999
[SHARD]
is_master = true
name = Master
[STEAM]
master_server_port = 27018
authentication_port = 8768
3. Caves shard Caves/server.ini
[NETWORK]
server_port = 10998
[SHARD]
is_master = false
name = Caves
[STEAM]
master_server_port = 27019
authentication_port = 8769
Also declare the caves world properties in Caves/worldgenoverride.lua:
return {
override_enabled = true,
preset = "DST_CAVE",
}
4. Workshop mod configuration
Automated mod loading has two steps:
1. Register server downloads: dedicated_server_mods_setup.lua
In mods/ under the server installation directory, add the Workshop IDs to download:
ServerModSetup("378160970") -- Example: the classic food properties display mod
ServerModSetup("375859599") -- Example: Geometric Placement
2. Activate and configure each shard: modoverrides.lua
Place this in both Master/ and Caves/:
return {
["workshop-378160970"] = { enabled = true },
["workshop-375859599"] = { enabled = true }
}
5. Choose an approach: manual configuration or LanGame Server Manager (LGSM)
Manual DST setup requires startup scripts for two child processes, token files, and manually edited Lua mod mappings. On a first attempt, an incorrect directory level can easily prevent caves connectivity.
We recommend the official open-source dedicated server management platform to automate cluster operations:
- Tool overview and client: LanGame Server Manager (LGSM) product page
- Open-source repository: GitHub - SZSLGJCOM/LanGame-Server-Manager
LGSM provides extensive support for DST's two-shard architecture:
- Coordinated one-click surface/caves start and stop: Starts both Master and Caves automatically, synchronizing internal communication within seconds.
- Graphical token and password input: Paste a token and set the room password and world rules directly in the control panel without navigating document hierarchies.
- Visual mod management: Enter a Workshop link to populate both
dedicated_server_mods_setup.luaandmodoverrides.luaautomatically. - Pause when empty and save backups: Controls suspension of empty rooms and creates daily lossless rotating backups to protect against Bearger raids and save corruption.
6. Common issues during long-term operations
1. Caves loading hangs indefinitely or transition fails
- Cause: Caves cannot reach Master's internal cluster port (
10888), orcluster_keyvalues differ. - Solution: Check that
cluster_keymatches incluster.iniand that both shards run on the same LAN or local loopback127.0.0.1.
2. "Invalid Server Token"
- Cause:
cluster_token.txtcontains extra line breaks or spaces, or the token was deleted/revoked on the Klei page. - Solution: Generate a new token on the Klei account page and ensure the file contains only one line of plain token characters.