Don't Starve Together guide

Set up and join a Don't Starve Together dedicated server

Download the Don't Starve Together server with SteamCMD, add your Klei token, write cluster.ini, run the surface and Caves, open the ports and move your world.

Updated · By the HostForge team

A Don't Starve Together dedicated server keeps your world going when the host logs off. Klei publishes it free on Steam. It runs each world as its own process: the surface (called Master) and, if you want them, the Caves, linked so players can go down sinkholes. It needs one thing from you before it starts: a server token from your Klei account.

1. Download the server

On Windows, install Don't Starve Together Dedicated Server from the Tools section of your Steam library. On Linux, SteamCMD downloads it without an account that owns the game:

steamcmd +force_install_dir /srv/dst +login anonymous +app_update 343050 validate +quit

It is about 4.4 GB. The Linux server is bin64/dontstarve_dedicated_server_nullrenderer_x64; on Debian 13 it also needs the libcurl3t64-gnutls package. The file version.txt holds the version players' games must match.

2. Get a server token

Klei lets a dedicated server start only with a server token from a Klei account. Without one, it logs Your Server Will Not Start and stops. Make one on your Klei account's Game Servers page and save it as cluster_token.txt in the cluster folder; how to get a Don't Starve Together server token has the steps.

3. Make the cluster folder

The server's settings and worlds live in a cluster folder. With the options in step 4 it is /srv/dst-data/DoNotStarveTogether/Cluster_1:

Cluster_1/
  cluster.ini          the whole server
  cluster_token.txt    your Klei server token
  Master/server.ini    the surface world
  Caves/server.ini     the Caves world

cluster.ini holds what players see and the link between the worlds:

[GAMEPLAY]
game_mode = survival
max_players = 6
pvp = false
pause_when_empty = true

[NETWORK]
cluster_name = My DST Server
cluster_description = Day one, every day
cluster_password = change-me

[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 = any-secret-the-two-worlds-share

game_mode is survival, endless or wilderness. Each world's server.ini gives it its own port; the Caves also say they are not the master:

# Master/server.ini
[NETWORK]
server_port = 10999

[SHARD]
is_master = true

[STEAM]
master_server_port = 27018
authentication_port = 8768

# Caves/server.ini
[NETWORK]
server_port = 11000

[SHARD]
is_master = false
name = Caves

[STEAM]
master_server_port = 27019
authentication_port = 8769

For the Caves to generate as caves, add Caves/worldgenoverride.lua:

return {
  override_enabled = true,
  preset = "DST_CAVE",
}

Without the Caves, set shard_enabled = false and leave out the Caves folder.

4. Start both worlds and open the ports

Start each world from the bin64 folder, in its own terminal:

./dontstarve_dedicated_server_nullrenderer_x64 -console \
  -persistent_storage_root /srv/dst-data -conf_dir DoNotStarveTogether \
  -cluster Cluster_1 -shard Master

./dontstarve_dedicated_server_nullrenderer_x64 -console \
  -persistent_storage_root /srv/dst-data -conf_dir DoNotStarveTogether \
  -cluster Cluster_1 -shard Caves

Players connect to each world's server_port over UDP, so forward both (10999 and 11000 in the example) on your router and allow them in your firewall. The link between the worlds (master_port) stays on the machine.

Join a Don't Starve Together server

In the game, choose Browse Games, search for the server's cluster_name and enter the password if it has one. The Caves are part of the same server: players reach them through sinkholes in the world.

Admins and the console

Put one Klei user ID per line (they start with KU_) in adminlist.txt in the cluster folder to make those players admins; blocklist.txt keeps banned players out. With -console, each world reads commands from its terminal, such as c_announce("Hello"), c_save() or c_rollback(1).

Stop it without losing progress

Type c_shutdown(true) in each world's console: the world saves and the program exits, in a few seconds. Closing the terminal can lose what changed since the last save, which the game makes at the start of each day.

Move your world to a dedicated server

A world you hosted from the game is a cluster folder too, in Documents/Klei/DoNotStarveTogether/<number>/Cluster_<n> on your PC, with the same cluster.ini, Master and Caves folders. Stop the server, copy that folder's Master/save and Caves/save folders over the server's, and start it again. Keep the server's own server.ini files and token.

On HostForge

Skip the setup

HostForge runs both worlds for you: paste your Klei server token, pick a region, a game mode and a password. It writes cluster.ini and each world's server.ini, opens the ports, saves both worlds before every stop and backs them up daily. To bring a world, stop the server, open Save and upload a ZIP of its Cluster folder; it becomes the server's world.

Don't Starve Together server hosting

More Don't Starve Together guides