Docker setup for Dont Starve Together dedicated server including caves!
To play caves please make sure you opt-in to the Don't Starve Together beta via steam
These instructions assume a debian based server, please skip to the volume instructions if you already have docker installed on your machine.
For ubuntu installation click here
For anything else
-
$HOME/ dstvolumes/ master/ slave/
-
Copy server_token.txt into
dstvolumes/master
anddstvolumes/slave
$HOME/ dstvolumes/ master/ server_token.txt slave/ server_token.txt
-
Create settings.ini for
dstvolumes/master
NOTE: settings file is different than the slave's settings.ini
$HOME/ dstvolumes/ master/ server_token.txt settings.ini slave/ server_token.txt
-
Create settings.ini for
dstvolumes/slave
NOTE: settings file is different than the master's settings.ini
$HOME/ dstvolumes/ master/ server_token.txt settings.ini slave/ server_token.txt settings.ini
-
Create worldgenoverride.lua in
dstvolumes/slave
$HOME/ dstvolumes/ master/ server_token.txt settings.ini slave/ server_token.txt settings.ini worldgenoverride.lua
-
Create docker-compose.yml in
dstvolumes/
NOTE: only needed if intending to use docker-compose to launch servers$HOME/ dstvolumes/ docker-compose.yml master/ server_token.txt settings.ini slave/ server_token.txt settings.ini worldgenoverride.lua
-
Launch dst dedicated servers
-
Navigate to volumes folder and run docker-compose
cd $HOME/dstvolumes sudo docker-compose up
-
Start the master server
sudo docker run -it --name="dst" -p 10999:10999/udp -v $HOME/dstvolumes/master:/home/steam/.klei/DoNotStarveTogether ryshe/dst
-
After the master server is done booting up, detatch from master server by pressing
ctrl+p ctrl+q
-
Start the slave server linked to the master server
sudo docker run -it --name="dstslave" -p 10998:10998/udp -v $HOME/dstvolumes/slave:/home/steam/.klei/DoNotStarveTogether --link dst:master ryshe/dst
-
After the slave server is done booting up, detatch from slave server by pressing
ctrl+p ctrl+q
-
Find the container name running the master
sudo docker ps -a
It will look something like:
-if running from docker-compose:
dstvolumes_dst_1
-if running from docker-engine:dst
-
Attach back on to the master server so that we can regenerate the world
In order to generate cave entrances we need to regenerate the world
sudo docker attach <container_name_from_last_step>
-
Invoke the world to regenerate in order to get caves entrances
NOTE: you should be connected to the server and able to see output when you type
c_regenerateworld()
- Detatch from your server with
ctrl+p ctrl+q
- Enjoy your dedicated server! Do not forget to opt into the beta on your DST client in steam, or you wont see your server!
-
with docker-compose
shell sudo docker-compose restart
-
with docker-engine
sudo docker restart dst sudo docker restart dstslave
NOTE: This is experimental
- Create a new folder to act as a volume for the mods
cd $HOME mkdir dstmods cd dstmods touch mods.txt
- Edit
dstmods/mods.txt
- each line in mods.txt should contain the id of the mod you wish to install
- you can get the id of the mod from the url in community hub workshop
- example: http://steamcommunity.com/sharedfiles/filedetails/?id=`522117250`
- Add the additional volume to the containers
- with docker-compose
- Edit docker-compose.yml
- Under both
volumes:
blocks add$HOME/dstmods:/mods
- with docker-engine add an additional
-v $HOME/dstmods:/mods
to bothdocker run
commands
- with docker-compose
- Run the Don't Starve Together client located in your steam library
- Press
~
key to open the console in game - Enter
TheNet:GenerateServerToken()
which will generate a server_token.txt file- Linux: located in ~/.klei/DoNotStarveTogether
- Windows: located in C:\Users<your name>\Documents\Klei\DoNotStarveTogether Go back
Use your favorite text editor and create a file "settings.ini". Fill it with the following contents.
[network]
default_server_name = My DST Server with caves
default_server_description = We have caves!
;must be unique per server in cluster
server_port = 10999
;change this password
server_password = password123
max_players = 4
pvp = false
game_mode = survival
enable_snapshots = false
enable_autosaver = true
tick_rate = 30
connection_timeout = 10000
server_save_slot = 1
pause_when_empty = true
dedicated_lan_server = false
server_intention = cooperative
[shard]
;required true for shard features
shard_enable = true
is_master = true
;required for slave
master_ip = 127.0.0.1
;do not touch
master_port = 10888
bind_ip = 0.0.0.0
;change to whatever, helpful in logs
shard_name = master
;change the cluster key to something unique
cluster_key = secret_cluster_key
[MISC]
CONSOLE_ENABLED = true
autocompiler_enabled = true
Change to your preference:
default_server_name
default_server_description
cluster_key
server_password
or remove it for public server- do not change
master_port
- any other configuration option that you wish
Use your favorite text editor and create a file "settings.ini". Fill it with the following contents.
[network]
default_server_name = My DST Server with caves
default_server_description = We have caves!
;must be unique per server in cluster
server_port = 10998
;change this password
server_password = password123
max_players = 4
pvp = false
game_mode = survival
enable_snapshots = false
enable_autosaver = true
tick_rate = 30
connection_timeout = 10000
server_save_slot = 1
pause_when_empty = true
dedicated_lan_server = false
server_intention = cooperative
[shard]
;required true for shard features
shard_enable = true
is_master = false
;required for slave will get auto set by scripts
master_ip = 127.0.0.1
;do not touch
master_port = 10888
bind_ip = 0.0.0.0
;change to whatever, helpful in logs
shard_name = slave
;change the cluster key to something unique
cluster_key = secret_cluster_key
[MISC]
CONSOLE_ENABLED = true
autocompiler_enabled = true
cluster_key
must match the server's settings.inicluster_key
value- DO NOT CHANGE
master_port
save as worldgenoverride.lua
return {
override_enabled = true,
preset="DST_CAVE",
}
dstslave:
image: ryshe/dst:latest
ports:
- 10998:10998/udp
restart: always
links:
- dst:master
volumes:
- ./slave:/home/steam/.klei/DoNotStarveTogether
dst:
image: ryshe/dst:latest
ports:
- 10999:10999/udp
restart: always
volumes:
- ./master:/home/steam/.klei/DoNotStarveTogether
sudo apt-get install -y git
cd ~
git clone https://github.com/ryansheehan/dst.git
cd dst
sudo docker build -t <container_name_here> .