Guides/Don’t Starve Together Dedicated Servers

A Dedicated Server is an optimized version of our game designed to be run for longer periods of time, with none of the graphical overhead.

The server is available through Steam and SteamCMD on Windows and Linux.

Requirements
You must own a copy of Don’t Starve Together to host an online Dedicated Servers. But, a single copy of Don’t Starve Together can host many Dedicated Server instances.

Dedicated Servers do not use the same punchthrough technology that our client hosted servers use. You must add proper port forwarding for your server to be reachable by game clients. The server uses UDP traffic on port 10999 by default.

To create a reliable/performant Dedicated Server experience you will want to ensure that your system has the following properties:
 * Internet (Upload) = 8Kbytes / player / s
 * Ram =  around 65Mbytes/player
 * CPU?

Installing
We currently offer two methods of downloading our server.

Downloading through SteamCMD
Learn more about SteamCMD here: https://developer.valvesoftware.com/wiki/SteamCMD

On Windows:  On Linux (Debian): Note: After the application becomes public, you will be able to use anonymous downloading (i.e: login anonymous)

Downloading through Steam (Only on Windows or “Desktop Linux” = requires a GUI)

If you own Don’t Starve Together, the Dedicated Server download will appear in the ‘tools’ subsection of your library.

In order to run a public Dedicated Server, you are required to enter your “server token”. This token proves ownership of Don’t Starve Together and allows us to moderate servers that violate our terms of service.

To generate a server token, do the following:

Run Don’t Starve Together. Click Play Multiplayer.

Press tilde (~) (or ù on Azerty keyboards) to open the developer console.

Type:  TheNet:GenerateServerToken

The server token is written to your log.txt file located in:

On Windows: /My Documents/Klei/DoNotStarveTogether /log.txt

On Linux: //.klei/DoNotStarveTogether/log.txt

 

Grab the token from (near) the bottom of your log.txt file.

 

Add your server token to your servers settings.ini

On Windows: Documents/Klei/DoNotStarveTogether/Settings.ini

On Linux: //.klei/DoNotStarveTogether/Settings.ini

 

Look for a heading that reads [account]  if this heading does not exist, add it to the bottom of the file.

 

Under [account] add this line:

server_token = Server token Generated From TheNet:GenerateServerToken

NOTE: You can re-use a single server_token on multiple servers

NOTE: Your save directory, log.txt and settings.ini files are created the first time you start the server or game client.

NOTE: We will attempt to automate this in the future.

Running
 

Windows: dontstarve_dedicated_server_nullrenderer.exe [-conf_dir ]

Linux: ./dontstarve_dedicated_server_nullrenderer [-conf_dir ]

Configuration
 

The main method for configuring your dedicated server is through the settings.ini file.

On Windows: Documents/Klei/DoNotStarveTogether/Settings.ini

On Linux: //.klei/DoNotStarveTogether/settings.ini

Settings are divided by different categories,  make sure to put your changes under the appropriate category:

 

[network]

default_server_name = Your unique server name

 

default_server_description = A very nice server description

 

server_port = 10999

 

server_password = PasswordString

 

max_players = 1 .. 64

 

pvp = true|false

 

game_mode = endless|survival|wilderness

 

enable_snapshots =true | false

Snapshots allow you to full roll back a server to an older state. This feature is pretty new and has been observed to cause problems on some servers. I have been disabling this on most of my servers right now.

 

enable_autosaver = true | false

The auto saver creates a save at the start of each day, which will be resumed from when your server restarts.

 

tick_rate = 30 [ 10 | 15 | 30 | 60 ]

Tick rate determines the quality of your server. A higher tick rate consumers more bandwidth and CPU, but can result in smooth gameplay for clients.

 

connection_timeout = 8000

A time in milliseconds that we should wait before dropping a non responsive client.

 

[account]

server_token = Generated with TheNet:GenerateServerToken

dedicated_lan_server = [ true | false ]

 

If you wish to run multiple servers on the same machine, or have your server co-exist with the client, you will want to launch your server with an alternative configuration directory.

 

To see an alternative configuration directory, you can launch the server (or client) with this command line argument:

-conf_dir DoNotStarveServerDirectory

 

This would change your configuration directory to

Documents/Klei/DoNotStarveServerDirectory/

You will have a unique set of save slots,  log.txt and settings.ini files.

Mods
Currently mods have to be installed and updated manually by downloading them from the Steam Workshop on your client, and then moving them to the server’s mods folder. Then to enable the mod on your server, you will need to modify the file modsettings.lua to force enable the mods you desire. For example this would would enable three mods from the workshop.

ForceEnableMod("workshop-345692228")

ForceEnableMod("workshop-346968521")

ForceEnableMod("workshop-352373173")

 

To ensure that clients will be able to download the corresponding mods from the Workshop, you must not change the mod directory names.

 

Administration
Dedicated servers can be remotely administered through the game client.

 

The user who generated the server token is automatically granted administrator privileges.

An administrator has the ability to kick and ban users in the game, as well as to execute arbitrary lua on the server. WARNING: Only grant administrator rights to those who you would trust with full access to your server / machine. We may add a moderator mode with reduced powers in the future.

 

If you wish to provide administrator to additional users, you need to add an adminlist.txt file to your save directory:

On Windows: Documents/Klei/DoNotStarveTogether/Save/

On Linux: //.klei/DoNotStarveTogether/Save/

 

In this directory add the user identifiers for the users you wish to grant admin to. List the KU_’s one per line.

 

As an admin, you may issue a remote command to your server by doing the following:  
 * connect to the world through the game client
 * open the developer console (~)
 * press left CTRL to enter remote execution mode (REMOTE: appears to the left)
 * The command you enter will be executed on the server, assuming you have sufficient administrator rights

c_reset( true )

Deletes the current world and regenerates a new one. Pass false to reload the current world/

c_shutdown( true )

Saves and terminates the server application. Pass false to skip saving the world.

c_spawn( “prefab name” )

Spawn something at the mouse position

c_give(“item name”)

Give an item to you

 

FAQ
Is it possible to run my dedicated server in LAN mode?

Yes,  LAN mode can be configured in settings.ini by adding this line under the [account] heading:

dedicated_lan_server = true

Please remember LAN servers do not appear in the online server listings.

 

Is it possible to host multiple servers on a single (powerful) machine?

Yes, in order to host multiple servers you will want to have multiple configurations.

You can launch a server with a different configuration directory by passing in this command line option:   -conf_dir 

 

Which save slot does the dedicated server use?

Currently, Save slot 1.

 

Troubleshooting
In C:\Users\Mark\Documents\Klei\DoNotStarveTogether\save\ delete survival_1. When you restart a new world will be generated
 * If you ran the dedicated server before you put a token in the settings.ini you may need to delete your world data.  Shutdown the server or client,

http://my.jacklul.com/dstservers/ You will have to manually update the listing at the bottom of the page
 * If your server is running correctly, but you still can’t see it.  Confirm it’s listing here:

If it’s still not visible from inside the game client, it’s because the client can’t ping your server. Did you make sure to forward UDP traffic on port 10999 to your machine

 
 * If you get the error Account Failed (6): "E_EXPIRED_TOKEN" you’ll want to verify that your saved the settings.ini file with the server token after you closed the game client, or your change will get overwritten.