Don't Starve Together

Configuration

Goes over the file structure and file based configuration options for DST servers

Configuration

Cluster Configuration

Cluster.ini

The cluster.ini is the primary configuration file for cluster wide options. The server will look in <persistent_storage_root>/<conf_dir>/<cluster>/ for the existence of this file.

An example of the file

[GAMEPLAY]
game_mode = endless
max_players = 12
pvp = false
pause_when_empty = true

[NETWORK]
cluster_description = Silence Miranda
cluster_name = Mirandaville
cluster_intention = madness
cluster_password = password1234

[MISC]
console_enabled = true

[SHARD]
shard_enabled = true
master_port = 10889

Gameplay

Name

Default

Options

Description

game_mode

survival endless, survival, wilderness Sets the game mode: Reference

max_players

6 2, 4, 6, 8, 10, ... No functional limit

pvp

false true, false Enable/Disable player-vs-player

pause_when_empty

true true, false Wether the game will pause with no players online.

Network

Name

Default

Options

Description

cluster_description

empty Anything The description of your server seen when someone selects your server in the server browser.

cluster_name

None Anything The name of your server seen on the server browser.

cluster_intention

cooperative cooperative, competitive, social, or madness Basically deprecated

cluster_password

None Anything This sets the password people need to input to enter your server.

Misc

Name

Default

Options

Description

console_enabled

true true, false DST runs with an interactive console that you can send commands to locally on the server itself. This option enables or disables that.

max_snapshots

6 Any Integer Maximum number of snapshots to retain.

Shard

Name

Default

Options

Description

shard_enabled

false true, false Enables sharding, aka multi world. If you want caves enabled you need this, and the cave shard enabled.

master_port

10888 Any integer The port slave shards will connect to the master shard on.

Cluster Token

This file just contains a token that you generate from Klei's Website

The server will look for the token in <persistent_storage_root>/<conf_dir>/<cluster>/cluster_token.txt

Configuration

Shard Configuration

Server.ini

The server.ini is where the individual shards that comprise a cluster load their server side configurations from. The server will look in <persistent_storage_root>/<conf_dir>/<cluster>/<shard>/ for the existence of this file. Official Reference

An example of the file for the master shard:

[NETWORK]
server_port = 11000


[STEAM]
authentication_port = 8766
master_server_port = 27016

[SHARD]
bind_ip = 0.0.0.0
master_ip = 0.0.0.0
cluster_key = shardpassword1234
name = Master
is_master = true

Network

Name

Default

Options

Description

server_port

10999 Any integer 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 on the same machine. This port must be between 10998 and 11018 inclusive in order for players on the same LAN to see it in their server listing.

Steam

Name

Default

Options

Description

authentication_port

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

master_server_port

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

Shard

Name

Default

Options

Description

bind_ip

127.0.0.1 Public or Private IP 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 shard.

master_ip

none Public or Private IP 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

cluster_key

none Anything This is a password used to authenticate a slave server to the master.

name

none Anything 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].

is_master

none true, false 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.
Configuration

Runtime Configuration

Runtime Options

These are flags you can pass to dontstarve_dedicated_server_nullrenderer that impact the server's behaviour.

These are the most common options

Name

Default

Description

persistent_storage_root

~/.klei The directory that your configuration directory resides in. Has to be an absolute path.

conf_dir

DoNotStarveTogether Changes the name of the configuration directory. Cannot contain slashes. This directory is what follows the perisstent_storage_root in your config path. <persistent_storage_root>/<conf_dir>

cluster

Cluster_1 The directory specifies where your cluster configs will be (cluster.ini). It follows after the conf_dir <persistent_storage_root>/<conf_dir>/<cluster>/cluster.ini

shard

Master Name of the shard you're launching. This also corresponds to where the shard configurations will be. <persistent_storage_root>/<conf_dir>/<cluster>/<shard>/server.ini

The full list can be seen here on Klei's Site (Though its likely out of date)

Configuration

Mod Configuration

modoverrides.lua

Location: <persistent_storage_root>/<conf_dir>/<cluster>/<shard>/modoverrides.lua

This is the file that enables and configures mods for a particular shard. If you have more than one shard, and you want the enable the mod for both then you will have to edit two files:

<persistent_storage_root>/<conf_dir>/<cluster>/<shard_1>/modoverrides.lua
<persistent_storage_root>/<conf_dir>/<cluster>/<shard_2>/modoverrides.lua

This is an example of the file:

return {
        ['workshop-1947298962'] = { enabled = true },
        ['workshop-1615274304'] = { enabled = true },
        ['workshop-378160973'] = { enabled = true },
        ['workshop-2281925291'] = { enabled = true },
        ['workshop-2853529208'] = { enabled = true },
        ['workshop-361994110'] = { enabled = true },
        ['workshop-1595631294'] = { enabled = true },
        ['workshop-1898292532'] = { enabled = true },
        ['workshop-588560555'] = { enabled = true },
        ['workshop-1185229307'] = { enabled = true },
        ['workshop-1839858501'] = { enabled = true },
        ['workshop-2665334506'] = { enabled = true },
        ['workshop-1460627047'] = { enabled = true },
        ['workshop-1535658505'] = { enabled = true },
        ['workshop-2634350802'] = { enabled = true },
        ['workshop-1504778958'] = { enabled = true },
        ['workshop-1207269058'] = { enabled = true },
        ['workshop-2208128427'] = { enabled = true },
        ['workshop-2659067616'] = { enabled = true },
        ["workshop-352499675"] = { enabled = true,   --DST Resurrection Shelter
        configuration_options =
          {
            ["Mode"] = "Hard", 
            ["ShelterUses"] = 1000000,
            ["ShelterLight"] = "yes",
          }
        },
        ["workshop-385006082"] = { enabled = true, --DST Path Lights
        configuration_options =
          {
            ["path_lightrecipe"] = "normal", 
            ["light_color"] = "color4",
            ["FueledLights"] = "no",    
          }
        }
}

As you can see the configuration for individual mods uses internal names referenced by the mod itself making it hard to discover exactly what you need to type in, because of this I suggest booting up a local server with the mods configured the way you want them, and then inspect the file on your local machine and copy it over to the dedicated server.

dedicated_server_mods_setup.lua

Location: <steam_install_dir>/mods/dedicated_server_mods_setup.lua

This file is responsible for downloading and updating mods onto your server. You can either specify individual mods or collections.

--#Global Position
ServerModSetup("378160973")

--#Ancient Altar
ServerModSetup("481765222")

--#Health Info
ServerModSetup("375859599")

ServerModCollectionSetup("2865405455")

modsettings.lua

Location: <steam_install_dir>/mods/modsettings.lua

This is purely for enabling mods. This can be done instead of using modoverrides.lua to enable mods across all shards, however it does not allow you to configure any of the settings that the mods would have.

-- Use the "ForceEnableMod" function when developing a mod. This will cause the
-- game to load the mod every time no matter what, saving you the trouble of
-- re-enabling it from the main menu.
--
-- Note! You shout NOT do this for normal mod loading. Please use the Mods menu
-- from the main screen instead.

-- ForceEnableMod("kioskmode_dst")


-- Use "EnableModDebugPrint()" to show extra information during startup.

EnableModDebugPrint()

ForceEnableMod("workshop-375859599")  --Health Info
ForceEnableMod("workshop-378160973")  --Global Positions
ForceEnableMod("workshop-382177939")    --DST Storm Cellar
ForceEnableMod("workshop-439115156")    --[DST] Musha [5.8 F]
ForceEnableMod("workshop-451559807")    --cave mod
ForceEnableMod("workshop-363989569")      --Growable Marble Trees

DST Multihost Docker Server

Source: https://github.com/Kareth-io/dst-docker-multihost/