Don't Starve Together

Don't Starve Together

224 ratings
How to setup preconfigured servers with Steam Tools
By ToNiO and 1 collaborators
This guide is for explain how to use and configure Don't Starve Together Dedicated Server in Steam Tools

it's tools for create and start both servers (Server Overworld and Server Caves)

----

I want to clarify that I will show my method for used Don't Starve Together Dedicated Server,
maybe it's not the best method,but at least it works fine, there are lots of ways to do this.

I give just one example but you can customize your install as you wish
2
3
   
Award
Favorite
Favorited
Unfavorite
Summary
Install Don't Starve Dedicated Server in Steam Tools
We will install the software that allows you to run and configure both servers
(Overworld and Cave)

  • go in library of your steam
  • install Don't Starve Together Dedicated Server
  • wait end of download








Start both servers
here's how to start your both servers on Windows:













when you see in end of log: "Your Server Will Not Start"

stop both servers with the following command:
  • c_shutdown()


you can see we need to add token for start correctly both server (check in next step)
You need to settings both servers with cluster_token.txt, server.ini, worldgenoverride.lua
we have start both servers for first time,
it's have just created two configuration folder for each server:




so now you need to add token in cluster_token.txt for start correctly both servers

for find your token you just need to launch your game and go in your account info:
  • Go in Play

  • Go in account info




now you can see your token (Klei Dedicated Server Token)

if you don't see your token, you just need to add in the white box Klei Dedicated Server Token and click on Generate Server Token

note and keep your token for use to the next step


Put your token in cluster_token
the token is mandatory without him your server can not be online, it allows for Klei to have the option to remove the server in case of violation or problem with this server

For Server Overworld:
  • go in Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1
  • create Text Document
  • put your token and save this file with name cluster_token
  • now you can delete your Text Document










For Server Caves:
  • go in Documents\Klei\DoNotStarveTogether_EasyConfigCaves\Cluster_1
  • create Text Document
  • put your token and save this file with name cluster_token
  • now you can delete your Text Document








Add worldgenoverride.lua on both servers
worldgenoverride.lua represents the settings to generate the world for don't starve together, so you can adjust the season, monsters, or biomes and more

Server Overworld:
  • go in Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1\Master
  • create Text Document
  • open New Text Document
copy the code lua in the link below and paste in your file:
worldgenoverride.lua for server Overworld[pastebin.com]

now you need to save your file with this name: worldgenoverride.lua (check screenshots)











Server Cave:
  • go in Documents\Klei\DoNotStarveTogether_EasyConfigCaves\Cluster_1\Master
  • create Text Document
  • open New Text Document
copy the code lua in the link below and paste in your file:
worldgenoverride.lua for server Caves[pastebin.com]

now you need to save your file with this name: worldgenoverride.lua (check screenshots)









List of option for cluster.ini and server.ini
cluster.ini have settings for both servers (server name, slots, gametype)

here the option list for cluster.ini:

[MISC]

max_snapshots

  • Default: 6
  • Maximum number of snapshots to retain. These snapshots are created every time a save occurs, and are available in the “Rollback” tab on the “Host Game” screen.

[SHARD]

shard_enabled

  • Default: false
  • Enable server sharding. This must be set to true for multi-level servers. For single-level servers, it can be omitted.

bind_ip

  • Overridable in server.ini
  • Default: 127.0.0.1
  • Required: If shard_enabled = true and is_master = true
  • This is the network address the master server will listen on for other shard servers to connect to. Set this to 127.0.0.1 if all of your servers in your cluster are on the same machine, or 0.0.0.0 if the servers in your cluster are on different machines. This only needs to be set for the master server, either in cluster.ini, or the master server's server.ini.

master_ip

  • Overridable in server.ini
  • Default: none
  • Required: If shard_enabled = true and is_master = false
  • This is the I.P. address that a non-master shard will use when trying to connect to the master shard. If all servers in a cluster are on the same machine, set this to 127.0.0.1

master_port

  • Overridable in server.ini
  • Default: 10888
  • This is UDP port that the master server will listen on, and that a non-master shard will use when trying to connect to the master shard. This should be set to the same value for all shards by having a single entry in cluster.ini, or omitted completely to use the default.

cluster_key

  • Overridable in server.ini
  • Default: none
  • Required if shard_enabled = true
  • This is a password used to authenticate a slave server to the master. If you are running servers on different machines that need to connect to each other, this value must be the same on each machine. For servers running on the same machine, you can just set this once in cluster.ini.

[STEAM]

steam_group_only

  • Default: false
  • When set to true, the server will only allow connections from players belonging to the steam group listed in the steam_group_id setting.

steam_group_id


steam_group_admins

  • Default: false
  • When this is set to true, admins of the steam group specified in steam_group_id will also have admin status on the server.

[NETWORK]

offline_server

  • Default: false
  • Create an offline server. The server will not be listed publicly, and only players on the local network will be able to join, and any steam-related functionality will not work.

tick_rate

  • Default: 15
  • This is the number of times per-second that the server sends updates to clients. Increasing this may improve precision, but will result in more network traffic.

whitelist_slots

  • Default: 0
  • The number of reserved slots for whitelisted players. To whitelist a player, add their Klei UserId to the whitelist.txt file (Place this file in the same directory as cluster.ini)

cluster_password

  • Default: none
  • This is the password that players must enter to join your server. Leave this blank or omit it for no password.

cluster_name

  • The name for your server cluster. This is the name that will show up in server browser.

cluster_description

  • Default: empty
  • Cluster description. This will show up in the server details area on the “Browse Games” screen.

lan_only_cluster

  • Default: false
  • When set to true, the server will only accept connections from machines on the same LAN

cluster_intention

  • Default: Varies, depending on game mode.
  • The cluster’s playstyle. This field is the equivalent of the “Server Playstyle” field on the “Host Game” screen. Valid values are cooperative, competitive, social, or madness.

[GAMEPLAY]

max_players

  • Default: 16
  • The maximum number of players that may be connected to the cluster at one time.

pvp

  • Default: false
  • Enable PVP.

game_mode

  • Default: survival
  • The cluster’s game mode. This field is the equivalent of the “Game Mode” field on the “Host Game” screen. Valid values are survival, endless or wilderness

pause_when_empty

  • Default: false
  • Pause the server when there are no players connected.

vote_kick_enabled

  • Default: false
  • Set to true to enable the “Vote to Kick” feature.

server.ini have settings for each server (server ports,steam port,activated master or slave):

here the option list for server.ini:

[SHARD]

is_master

  • Default: none
  • Required: If shard_enabled = true
  • Sets a shard to be the master shard for a cluster. There must be exactly one master server per cluster. Set this to true in your master server’s server.ini, and false in every other server.ini.

name

  • Default: none
  • Required: if shard_enabled = true and is_master = false
  • This is the name of the shard that will show up in log files. It is ignored for the master server, which always has the name [SHDMASTER].

id

  • Default: Randomly generated number.
  • This is field is automatically generated for non-master servers, and is used internally to uniquely identify a server. Altering this or removing it may cause problems on your server if anybody’s character currently resides in the world that this server manages.

[STEAM]

authentication_port

  • Default: 8766
  • Internal port used by steam. Make sure that this is different for each server you run on the same machine.

master_server_port

  • Default: 27016
  • Internal port used by steam. Make sure that this is different for each server you run on the same machine.

[NETWORK]

server_port

  • Default: 10999
  • The UDP port that this server will listen for connections on. If you are running a multi-level cluster, this port must be different for each server. This port must be between 10998 and 11018 inclusive in order for players on the same LAN to see it in their server listing. Ports below 1024 are restricted to privileged users on some operating systems.
Create and configure cluster.ini and server.ini
now I'll just going give sample configuration about settings for both servers

cluster.ini for server Overworld:
  • go in Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1
  • create Text Document
and add this:

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

[NETWORK]
cluster_name = TEST Server
cluster_description = Welcome
cluster_password =
cluster_intention = social
autosaver_enabled = true
enable_vote_kick = false

[MISC]
console_enabled = true

[SHARD]
shard_enabled = true
bind_ip = 127.0.0.1
master_ip = 127.0.0.1
master_port = 11001
cluster_key = dst

now you need to save your file with this name: cluster.ini
(check screenshots) after that you can delete New Text Document












cluster.ini for server Cave:
  • go in Documents\Klei\DoNotStarveTogether_EasyConfigCaves\Cluster_1
  • create Text Document
and add this:

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

[NETWORK]
cluster_name = TEST Server
cluster_description = Welcome
cluster_password =
cluster_intention = social
autosaver_enabled = true
enable_vote_kick = false

[MISC]
console_enabled = true

[SHARD]
shard_enabled = true
bind_ip = 127.0.0.1
master_ip = 127.0.0.1
master_port = 11001
cluster_key = dst

now you need to save your file with this name: cluster.ini
(check screenshots) after that you can delete New Text Document












server.ini for server Overworld:
  • go in Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1\Master
  • open server.ini
and add this:

[NETWORK]
server_port = 10999


[SHARD]
is_master = true


[STEAM]
master_server_port = 12346
authentication_port = 12345

after that save your server.ini







server.ini for server Caves:
  • go in Documents\Klei\DoNotStarveTogether_EasyConfigCaves\Cluster_1\Master
  • open server.ini
and add this:

[NETWORK]
server_port = 11000


[SHARD]
is_master = false
name = Caves


[STEAM]
master_server_port = 12348
authentication_port = 12347

after that save your server.ini





Testing both servers
start your both servers:













If you get the result below, it's means both servers are synchronized



if you have this error '[200] Account Failed (6): "E_EXPIRED_TOKEN"'

it's look like problem with token:

Do not simply copy and paste the contents of this file from one machine to another. Move the actual file from one machine to another.

The cluster_token.txt is a null byte terminated ASCII file (no line endings). If the GSA attempts to copy-paste the contents of the token file, the null byte will be omitted and a line ending will be appended to the end. The dedicated server software will not be able to properly parse the cluster_token.txt file in this case.


we will now see if access to the server is running and if caves works

start your game and search server with name: TEST Server











you can now stop your both servers with this command:
  • c_shutdown()
FAQ - How to reset the map on dedicated server?
when you are in your server DST:

- Press TAB
- Click on Server Actions
- Click on Regenerate World








FAQ - How to make rollback on dedicated server?
when you are in your server DST:

- Press TAB
- Click on Server Actions
- Click on Rollback

this function allows returns to the previous day










FAQ - How banned player if he is not on my dedicated server?
if some players report troll have destroy camp on your server but he is not on the server right now!

you can banned him with SteamID

so you just need name of player and find him in your server_log.txt:


  • Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1\Master\



now you need copy this SteamID in blocklist.txt

create blocklist.txt here:


  • Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1\blocklist.txt

just put the SteamID in blocklist.txt:



now restart your server :















check now in your server_log.txt if your blocklist.txt is loading correctly on your server:

  • Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1\Master\server_log.txt

you need to find this in your server_log.txt:

  • OnLoadPermissionList: APP:Klei//DoNotStarveTogether_EasyConfigOverworld/blocklist.txt (Success)

so now if player try to join the server, he can't because he is banned!

i have make this test with my SteamID and you can see im banned on my server:




so that's can works for all players
FAQ - How add admin on your dedicated server?
so for add new admin on your server

you need to create adminlist.txt here:


  • Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1\adminlist.txt

you need to find KU_****** of player in log of your server:

  • Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1\Master\server_log.txt

( KU_***** matches its identifier on server don't starve together as SteamID on steam )



now you need to add KU_***** in your adminlist.txt:



restart your server:















check now if your adminlist.txt is loading correctly on your server:

  • Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1\Master\server_log.txt

you need to find this in your server_log.txt:

  • OnLoadUserIdList:APP:Klei//DoNotStarveTogether_EasyConfigOverworld/Cluster_1/adminlist.txt (Success)

so now you can test with your friend if he have admin permission

you can see if your friend is admin on your server like the following screenshots:




FAQ - How to reserved slots on your dedicated server?
this allows to reserve a number of slots for your friends or an admin of server,

this based on number slots of your server example if you reserved 5 slots and you have 15 slots on your server only 10 players from public can connect on the server

so for my example i going put 2 slots on my server and going put 2 KU_***** in my whitelist.txt

you need to create whitelist.txt here:

  • Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1\whitelist.txt

as adminlist.txt you need to find KU_***** in server_log.txt of your server:



now you need to add KU_***** in your whitelist.txt:



(i have add also another KU_***** of other friend for make this test)

so you need also to add this option in your cluster.ini:

below of [NETWORK] add this:

  • whitelist_slots = 2


now restart your server:















check now if your whitelist.txt is loading correctly on your server:
  • Documents\Klei\DoNotStarveTogether_EasyConfigOverworld\Cluster_1\Master\server_log.txt

you need to find this in your server_log.txt:
  • OnLoadUserIdList: APP:Klei//DoNotStarveTogether_EasyConfigOverworld/whitelist.txt (Success)

so now you can test with your friend if reserved slots works

my friend connect on the server before me and then when I try to connect:




that's mean your reserved slots work fine now

this was just an example, but you can change the number of slots as you want
241 Comments
☼⛤zZaRra⛤☼ May 7, 2023 @ 7:25am 
Hello, I have followed instructions for adding my friends to the adminlist.txt and whitelist.txt. It works fine for whitelist, however for some reason it fails to load adminlist :

[00:00:00]: THREAD - started 'StreamInput' (15276)
[00:00:00]: OnLoadPermissionList: APP:Klei//DoNotStarveTogether_EasyConfigOverworld/Cluster_1/adminlist.txt (Failure)
[00:00:00]: OnLoadUserIdList: APP:Klei//DoNotStarveTogether_EasyConfigOverworld/Cluster_1/whitelist.txt (Success)

adminlist and whitelist are same IDs. Could that be an issue?

Both lists are containing 3 IDs only (including mine) in following format:
KU_########
KU_########
KU_########

Can anyone assist me in fixing this problem and placing a proper setup to the server (adding 2 more friends as admins) ? :)
Thanks
Psycho Feb 3, 2021 @ 3:26am 
for those that have problems finding their list. Try change the filter setting in browse games to LAN. i laughed hard after trying over and over restarting the server becous i thougt there where something wrong.
Frost Vanilla Dec 9, 2020 @ 10:09am 
Bro You are a legend!:nepnep:
Calanon Dec 2, 2020 @ 10:14am 
I've followed this exactly, but it will not show up in the server list - any idea why this might be?
Bedshaker Nov 8, 2020 @ 10:30am 
Thank you! This guide was really helpful!
TonyXGames Sep 9, 2020 @ 11:55am 
it is showing me ''Registering master server in US lobby'' how can i change the region of the lobby? my friend is lagging
Mefitek Jun 16, 2020 @ 10:25am 
server.ini HAS TO BE IN THE MASTER FOLDER TO WORK!!!!!!!!
cluster.ini is fine
DarkSabreLord Mar 28, 2020 @ 4:37pm 
I had the same issue as @100LKY and @Candy-Sama - removing the password allowed this to work. We created a custom group and set the server to only allow members instead.
Unt3rwasserm4n Mar 20, 2020 @ 3:10am 
I have same problem as @Candy-Sama - キャンディ様

But my slave server is running ok only master is showing "Registering master server in Sing Lobby"

UPDATE: after removing password its showing on LAN
Volensia Jun 27, 2019 @ 9:48pm 
Is it possible to have multiple save slots? I want to switch to another world without completely regenerating the current one.