Dont Starve Together

Last updated 6 months ago

Authentication Token

Don't Starve Together server requires an Authentication Token.

  1. Go to the Klei website

  2. After logging into your account visit this page to get your authentication token

  3. Enter a friendly name for your server and copy the access token

DST Menu
  1. Click on the "Generate Server Token" button, copy the token, and paste it into the file.


You can quickly do this by running the following command, replacing YourServerTokenHere with your server token (Keep the quotes around the token).

echo 'YourServerTokenHere' > ~/.klei/DoNotStarveTogether/MyDediServer/cluster_token.txt

Clusters and Shards

A Don't Starve Together server consists of clusters and shards.

One cluster can contain multiple shards. A shard is basically a map/level. Multiple shards are connected by cave entrances/exits found on the map. These are functioning as portals to allow players to travel between actual game servers.

note: Each shard (level of the world) has to be run as an individual server instance.


By default the cluster will be single-sharded. So you only need one server but you will also only have one map.

Default script settings:



First of all take a look at Multiple-Servers to get a general idea on how to create multiple game servers.

There are two types of shards:

  1. master shard: the shard you enter when joining the server / the shard/server you have to join (one per cluster)

  2. slave shard: shard that will connect to the master (arbitrary number per cluster)

In this example we will only use two shards, one overworld shard and one cave shard, on the same machine using the same installation. If you want to use more shards or run the shards on different machines, take a look at the guides mentioned at the bottom. First of all we need two scripts:


Server #1

dstserver-1 (this will be the master shard with an overworld as level):

# Installation Variables


server_port = 11000
authentication_port = 8768
master_server_port = 27018

Server #2

dstserver-2 (this will be the slave shard with a cave as level):

# Installation Variables


server_port = 11001
authentication_port = 8769
master_server_port = 27019

If you want to Caves and Overworld to display on the same server, you also to change the cluster.ini, otherwise it will run two instances, one with the Overworld and another with the Caves:


shard_enabled = true

Set all installation variables BEFORE running the ./dstserver1/2 install commands. Feel free to change these settings but make sure that you set them to the same clusters. You also should not change them afterwards. If you have multiple clusters on one machine with the same shard names, you have to modify the servicename because servicename="dst-server-${shard}" (The shard name is used to differentiate service names. e.g. servicename="dst-server-${cluster}-${shard}").

For clarity reasons I recommend naming the master shard "Master".

Lastly you have to start both servers. The order does not matter because the slave server will auto-retry connecting to the master server which is listening.

Guides / Documentations: