DustBowl.Games

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

Firewall summary: For same-host clusters, forward UDP 10999, 10998, 8766, 8767, 27016, 27017. Shard communication (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

1

Generate your Klei cluster token

Go to accounts.klei.com, sign in, and generate a token. Copy the full token string.

# Place it in cluster_token.txt (no quotes, no newlines)
echo "pds-g^KU_XXXX^XXXXXXXXXX..." > MyCluster/cluster_token.txt

Without this file the server silently refuses to start. Token guide & validator

2

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/Master
mkdir -p ~/.klei/DoNotStarveTogether/MyCluster/Caves
3

Write cluster.ini (cluster root)

Key shard settings — these must be correct or shards won't communicate.

[SHARD]
shard_enabled = true
bind_ip = 127.0.0.1
master_port = 11002
cluster_key = MySharedSecret

Use Server Config Generator to build the full file.

4

Write Master/server.ini

[NETWORK]
server_port = 10999

[SHARD]
is_master = true
name = Master

[STEAM]
master_server_port = 27016
authentication_port = 8766
5

Write Caves/server.ini

[NETWORK]
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
6

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.

cp MyCluster/Master/modoverrides.lua MyCluster/Caves/modoverrides.lua

Use the modoverrides.lua Generator to build the file.

7

Launch both processes

Start Master first (it is the authority), then Caves. Run each in its own screen/tmux session or as a service.

# Master
./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_ip and master_ip should both be 127.0.0.1 when both shards run on the same machine.
  • • cluster_key in cluster.ini must 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.lua must 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.

Connection interrupted

We are restoring your session

Your account remains secure while we reconnect you.

Attempt in progress

A fresh reload verifies your session and pulls current content and security updates from the server.

Unsaved changes may be lost while your session is interrupted.

View system status

Need help? Home · Support · Discord

Check your connection, then try again or review our system status.

A fresh reload verifies your session and pulls current content and security updates from the server.

Unsaved changes may be lost while your session is interrupted.

View system status

Need help? Home · Support · Discord

The server rejected this session. Reload to continue securely.

A fresh reload verifies your session and pulls current content and security updates from the server.

Unsaved changes may be lost while your session is interrupted.

View system status

Need help? Home · Support · Discord

Connection status and recovery controls.