How to Host a Don't Starve Together Dedicated Server with Caves
A normal hosted world disappears when its owner closes the game. A dedicated Don't Starve Together server keeps the same world online for the whole group, but a complete setup has more moving parts than the menu suggests. Forest and Caves are separate server processes, each needs its own UDP port, and Klei requires an account-owned cluster token before the world can register online.
This guide builds the official native Linux server with both shards. The examples use Ubuntu and a service account named game. Use equivalent paths if your machine is arranged differently.
1. Install the official dedicated server
Valve distributes the server as Steam app 343050. It supports anonymous SteamCMD login, so you do not put a personal Steam password on the host:
steamcmd +@sSteamCmdForcePlatformType linux +@sSteamCmdForcePlatformBitness 64 +force_install_dir /srv/dst +login anonymous +app_update 343050 validate +quit
The current 64-bit executable is under /srv/dst/bin64. Run it as an unprivileged account, not root. Keep the Steam installation separate from the Klei data directory so updates do not replace worlds or player saves.
2. Create a Klei cluster token
An online dedicated server must authenticate with a token generated from a Klei account that owns Don't Starve Together. Sign in at Klei Accounts, open the game servers section, add or configure a server, and download its settings. The archive contains cluster_token.txt.
Place that file at the root of your cluster. Treat it as a credential: do not paste it into screenshots, public logs, Git repositories or forum posts. A KU user ID is not a cluster token. A missing or invalid token leaves the process unable to register online.
3. Understand the cluster layout
Use one cluster directory with a shared config and one subdirectory per shard:
~/.klei/DoNotStarveTogether/MyCluster/
cluster.ini
cluster_token.txt
Master/
server.ini
Caves/
server.ini
The Master directory is the Forest. Caves is a second world with its own save, log and network socket. Migration portals connect them through a private shard port. Starting only the Master process gives you a Forest-only world even if a Caves directory exists.
4. Write cluster.ini
A useful private co-op configuration looks like this:
[GAMEPLAY]
game_mode = endless
max_players = 8
pvp = false
pause_when_empty = true
[NETWORK]
cluster_name = The Long Winter
cluster_description = Persistent Forest and Caves
cluster_password = choose-a-password
cluster_intention = cooperative
autosaver_enabled = true
enable_vote_kick = true
[MISC]
console_enabled = true
max_snapshots = 10
[SHARD]
shard_enabled = true
bind_ip = 127.0.0.1
master_ip = 127.0.0.1
master_port = 10889
cluster_key = choose-an-internal-key
Survival resets after the whole group dies. Endless keeps the world and makes resurrection easier. Wilderness respawns dead players into the world. Pause when empty is especially useful for a private server because seasons, hunger and threats do not advance while nobody is present.
5. Give Forest and Caves separate ports
Each shard needs a unique public UDP server port plus unique internal Steam ports. For example:
# Master/server.ini
[NETWORK]
server_port = 11000
[SHARD]
is_master = true
[STEAM]
authentication_port = 8768
master_server_port = 27018
# Caves/server.ini
[NETWORK]
server_port = 11001
[SHARD]
is_master = false
name = Caves
[STEAM]
authentication_port = 8769
master_server_port = 27019
Allow and forward UDP 11000 and 11001. The shard port 10889 only links two processes on the same machine, so bind it to 127.0.0.1 and do not publish it. Klei notes that LAN discovery expects server ports in the 10998 to 11018 range, but direct internet connections can use other non-privileged ports when the firewall and router agree.
6. Seed the Caves world
Create Caves/worldgenoverride.lua before the first start:
return {
override_enabled = true,
settings_preset = "DST_CAVE",
worldgen_preset = "DST_CAVE",
overrides = {}
}
Use the same structure with SURVIVAL_TOGETHER for both preset values in the Forest. World-generation overrides affect a new world. Changing them after terrain exists does not safely rebuild the existing save, so back up the cluster before regenerating anything.
7. Start both processes as one service
Both commands share the cluster but name a different shard:
./dontstarve_dedicated_server_nullrenderer_x64 -console -cluster MyCluster -shard Caves
./dontstarve_dedicated_server_nullrenderer_x64 -console -cluster MyCluster -shard Master
Run Caves in the background and keep Master in the foreground of a systemd wrapper. The wrapper should stop both when either process exits and send a graceful interrupt before a forced kill. Do not create two unrelated services that can leave one shard running after the other has failed.
A healthy online log contains an account communication success, an online server start for each public port, and a shard connection. If the Forest socket is open but cave entrances do not work, inspect the Caves log, its server port, the shared cluster key and the private master port.
8. Back up and update safely
Stop both shards cleanly, then copy the complete cluster directory. It contains the Forest and Caves sessions, player data, snapshots, token, permissions and mod overrides. The executable directory can be downloaded again, but the cluster cannot.
To update, stop the service, run SteamCMD app_update 343050 validate, restore any managed mod download file that validation replaced, and start both shards. Compare the dedicated server build with Steam before troubleshooting a client version mismatch.
Managed hosting option
A GHosting Don't Starve Together server runs Forest and Caves together with two reserved UDP ports. The panel handles the native Steam install, shard service, Workshop files, version checks, graceful restarts and live console. You paste your Klei cluster token once, and worlds remain available through Files and SFTP. Plans are prepaid and never renew automatically.
The upstream behavior in this guide follows Klei's official command-line options reference, Forest and Caves explanation and the dedicated server settings guide on Klei's forum.