DST Shard Setup Guide & Port Calculator
Running Master + Caves shards is the #1 most-confused DST server topic. Enter your base game port below — all derived ports calculate automatically — then follow the step-by-step guide to get both shards online.
Port Calculator
Master server_port
10999
UDP — open on firewall
Caves server_port
10998
UDP — open on firewall
master_port (shard comm)
11002
Internal only — do NOT expose
Master Steam ports
Auth: 8766 / Master: 27016
UDP — distinct per shard
Caves Steam ports
Auth: 8767 / Master: 27017
UDP — distinct per shard
Shard Bind / Target
127.0.0.1
Loopback for same-host cluster
master_port = 11002) stays internal on loopback (127.0.0.1).
Folder Structure
~/.klei/DoNotStarveTogether/
MyCluster/
cluster.ini <-- cluster settings (game mode, max players, etc.)
cluster_token.txt <-- Klei auth token (required)
Master/
server.ini <-- is_master = true, name = Master, server_port = 10999
modoverrides.lua <-- mods (copy identical file to both shards)
Caves/
server.ini <-- is_master = false, name = Caves, master_ip = 127.0.0.1, server_port = 10998
modoverrides.lua <-- same mods file as Master
The cluster_token.txt file must sit at the cluster root — not inside Master/ or Caves/.
Step-by-Step Setup
Generate your Klei cluster token
Go to accounts.klei.com, sign in, and generate a token. Copy the full token string.
echo "pds-g^KU_XXXX^XXXXXXXXXX..." > MyCluster/cluster_token.txt
Without this file the server silently refuses to start. Token guide & validator
Create the folder structure
Create the directory tree shown above. Both Master/ and Caves/ must exist before you start either process.
mkdir -p ~/.klei/DoNotStarveTogether/MyCluster/Caves
Write cluster.ini (cluster root)
Key shard settings — these must be correct or shards won't communicate.
shard_enabled = true
bind_ip = 127.0.0.1
master_port = 11002
cluster_key = MySharedSecret
Use Server Config Generator to build the full file.
Write Master/server.ini
server_port = 10999
[SHARD]
is_master = true
name = Master
[STEAM]
master_server_port = 27016
authentication_port = 8766
Write Caves/server.ini
server_port = 10998
[SHARD]
is_master = false
name = Caves
master_ip = 127.0.0.1
[STEAM]
master_server_port = 27017
authentication_port = 8767
[TERRAIN]
world_file = levels/cave
Copy modoverrides.lua to BOTH shards
If you use mods, the modoverrides.lua file must be identical in Master/ and Caves/. Placing it only in one shard causes the other to run without mods.
Use the modoverrides.lua Generator to build the file.
Launch both processes
Start Master first (it is the authority), then Caves. Run each in its own screen/tmux session or as a service.
./dontstarve_dedicated_server_nullrenderer_x64 \
-cluster MyCluster -shard Master
# Caves
./dontstarve_dedicated_server_nullrenderer_x64 \
-cluster MyCluster -shard Caves
Both processes share cluster.ini and the token file at the cluster root.
Key Rules to Remember
- •
bind_ipandmaster_ipshould both be127.0.0.1when both shards run on the same machine. - •
cluster_keyincluster.inimust match in both shards — any mismatch causes a silent connection failure. - • Always start Master before Caves. Caves will retry the connection, but starting in the right order avoids confusing log errors.
- •
modoverrides.luamust be present in both Master/ and Caves/. - • The
master_port(shard comms, 11002) does not need to be open on your external firewall — it only binds on loopback.
