Some of the exact port numbers seem to be different between installations. I'm not sure if any have to be as listed, but those were a working number I used at some point
Port | Description | Place Defined | Open Port | Unique |
---|---|---|---|---|
11000 | Overworld server port | Master/server.ini | x | x |
11001 | Cave server port | Caves/server.ini | x | x |
8768 | Steam auth port for overworld | Master/server.ini | ||
8769 | Steam auth port for cave | Caves/server.ini | ||
27018 | Steam master server port for overworld | Master/server.ini | x | |
27019 | Steam master server port for cave | Caves/server.ini | x | |
10888 | Shard master port | cluster.ini | x |
sudo su - dstserver
wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh
./linuxgsm.sh dstserver
./linuxgsm.sh dstserver
mkdir -p ~/lgsm/config-lgsm/dstserver/
echo '# Installation Variables
sharding="true"
master="true"
shard="Master"
cluster="Cluster_1"
cave="false"' >> ~/lgsm/config-lgsm/dstserver/dstserver.cfg
echo '# Installation Variables
sharding="true"
master="false"
shard="Caves"
cluster="Cluster_1"
cave="true"' >> ~/lgsm/config-lgsm/dstserver/dstserver-2.cfg
mkdir -p ~/.klei/DoNotStarveTogether/Cluster_1/
echo 'INSERT_CLUSTER_TOKEN' > ~/.klei/DoNotStarveTogether/Cluster_1/cluster_token.txt
./dstserver install
./dstserver-2 install
mkdir -p ~/.klei/DoNotStarveTogether/Cluster_1/Master/
mkdir -p ~/.klei/DoNotStarveTogether/Cluster_1/Caves/
echo '[NETWORK]
server_port = 11000
[SHARD]
is_master = true
[STEAM]
authentication_port = 8768
master_server_port = 27018
[ACCOUNT]
encode_user_path = true' > ~/.klei/DoNotStarveTogether/Cluster_1/Master/server.ini
echo '[NETWORK]
server_port = 11001
[STEAM]
authentication_port = 8769
master_server_port = 27019
[SHARD]
bind_ip = 127.0.0.1
is_master = false
[ACCOUNT]
encode_user_path = true' > ~/.klei/DoNotStarveTogether/Cluster_1/Caves/server.ini
nano ~/.klei/DoNotStarveTogether/Cluster_1/cluster.ini
Change the relevant line to
shard_enabled = true
echo 'return {
override_enabled = false,
}' > ~/.klei/DoNotStarveTogether/Cluster_1/Master/worldgenoverride.lua
echo 'return {
override_enabled = true,
preset = "DST_CAVE",
}' > ~/.klei/DoNotStarveTogether/Cluster_1/Caves/worldgenoverride.lua
./dstserver start
./dstserver-2 start
File | Path | Purpose |
---|---|---|
dedicated_server_mods_setup.lua | ~/serverfiles/mods/ | Specify server mods to download next time the server starts |
modsettings.lua | ~/serverfiles/mods/ | Settings for debugging mods |
modoverrides.lua | ~/.klei/DoNotStarveTogether/Cluster_1/Master/ | Specify enabled mods for overworld and their configs |
modoverrides.lua | ~/.klei/DoNotStarveTogether/Cluster_1/Caves/ | Specify enabled mods for caves and their configs |
Get workshop ID's of desired mod. To the ~/serverfiles/mods/dedicated_server_mods_setup.lua file, add the following line for each mod.
ServerModSetup("WorkshopID#") -- Comments
To the Master and Caves shard located at ~/.klei/DoNotStarveTogether/Cluster_#, add a file
touch modoverrides.lua
and add the following lines
return {
["workshop-WorkshopID1"] = { enabled = true }, -- Mod 1
["workshop-WorkshopID2"] = { enabled = true }, -- Mod 2
. . .
["workshop-WorkshopID(n-1)"] = { enabled = true }, -- Mod (n-1)
["workshop-WorkshopIDn"] = { enabled = true } -- Mod n
}
Notice that commas are required after each mod except the last one. If there is no caves world, this process only needs to be done to the Master shard.
Auto-generate a modoverrides.lua file by creating a client hosted server with the server mods included and configuring it through the UI before generating the world. After world generation, extract the modoverrides.lua file from the Klei folder in the documents of your personal machine and replace the files created in the previous step with the auto-generated one.
I've done all the steps, but result of ./dstserver-2 dt has the same ports as ./dstserver dt. Did not try to join in game yet, but is looks strange.
./dstserver dt
`dstserver@artem-server:/mnt/serv2/dstserver$ ./dstserver dtDistro Details
Date: Пт 12 авг 2022 15:37:54 MSK
Distro: Ubuntu 20.04.2 LTS
Arch: x86_64
Kernel: 5.15.0-46-generic
Hostname: artem-server
Uptime: 0d, 1h, 30m
tmux: tmux 3.0a
glibc: 2.31
Server Resource
CPU
Model: AMD FX(tm)-8320 Eight-Core Processor
Cores: 8
Frequency: 3511.679MHz
Avg Load: 0,57, 0,25, 0,18
Memory
Mem: total used free cached available
Physical: 16GB 1,4GB 14GB 4,0GB 14GB
Swap: 2,0GB 0B 2,0GB
Storage
Filesystem: /dev/sdc1
Total: 440G
Used: 2.8G
Available: 414G
Network
Interface: lo
IP: 127.0.0.1
Internet IP: 95.131.148.128
Game Server Resource Usage
CPU Used: 95%
Mem Used: 3% 530MB
Storage
Total: 2,8G
Serverfiles: 2,8G
Don't Starve Together Server Details
Server name: Subloran host
App ID: 343050
Server IP: 127.0.0.1:11000
Internet IP: 95.131.148.128:11000
Server password: q1
Maxplayers: 6
Game mode: endless
Tick rate: 0
Sharding: true
Master: true
Shard: Master
Cluster: Cluster_1
Cave: false
Status: STARTED
dstserver Script Details
Script name: dstserver
LinuxGSM version: v22.1.0
glibc required: 2.15
Discord alert: off
Email alert: off
Gotify alert: off
IFTTT alert: off
Mailgun (email) alert: off
Pushbullet alert: off
Pushover alert: off
Rocketchat alert: off
Slack alert: off
Telegram alert: off
Update on start: off
User: dstserver
Location: /mnt/serv2/dstserver
Config file: /home/dstserver/.klei/DoNotStarveTogether/Cluster_1/Master/server.ini
Backups
No Backups created
Ports
Change ports by editing the parameters in:
/home/dstserver/.klei/DoNotStarveTogether/Cluster_1/Master/server.ini
Useful port diagnostic command:
ss -tuplwn | grep dontstarve_dedi
DESCRIPTION PORT PROTOCOL LISTEN
Game: Server 11000 udp 1
Game: Master 10889 udp 0
Steam: Auth 8768 udp 0
Steam: Master 27018 udp 1
Status: STARTED
`
./dstserver-2 dt
`dstserver@artem-server:/mnt/serv2/dstserver$ ./dstserver-2 dtDistro Details
Date: Пт 12 авг 2022 15:38:38 MSK
Distro: Ubuntu 20.04.2 LTS
Arch: x86_64
Kernel: 5.15.0-46-generic
Hostname: artem-server
Uptime: 0d, 1h, 31m
tmux: tmux 3.0a
glibc: 2.31
Server Resource
CPU
Model: AMD FX(tm)-8320 Eight-Core Processor
Cores: 8
Frequency: 3511.680MHz
Avg Load: 0,48, 0,28, 0,19
Memory
Mem: total used free cached available
Physical: 16GB 1,8GB 14GB 4,0GB 14GB
Swap: 2,0GB 0B 2,0GB
Storage
Filesystem: /dev/sdc1
Total: 440G
Used: 2.8G
Available: 414G
Network
Interface: lo
IP: 127.0.0.1
Internet IP: 95.131.148.128
Game Server Resource Usage
CPU Used: 56%
Mem Used: 3% 546MB
Storage
Total: 2,8G
Serverfiles: 2,8G
Don't Starve Together Server Details
Server name: Subloran host
App ID: 343050
Server IP: 127.0.0.1:11000
Internet IP: 95.131.148.128:11000
Server password: ***
Maxplayers: 6
Game mode: endless
Tick rate: 0
Sharding: true
Master: false
Shard: Caves
Cluster: Cluster_1
Cave: true
Status: STARTED
dstserver-2 Script Details
Script name: dstserver-2
LinuxGSM version: v22.1.0
glibc required: 2.15
Discord alert: off
Email alert: off
Gotify alert: off
IFTTT alert: off
Mailgun (email) alert: off
Pushbullet alert: off
Pushover alert: off
Rocketchat alert: off
Slack alert: off
Telegram alert: off
Update on start: off
User: dstserver
Location: /mnt/serv2/dstserver
Config file: /home/dstserver/.klei/DoNotStarveTogether/Cluster_1/Master/server.ini
Backups
No Backups created
Ports
Change ports by editing the parameters in:
/home/dstserver/.klei/DoNotStarveTogether/Cluster_1/Master/server.ini
Useful port diagnostic command:
ss -tuplwn | grep dontstarve_dedi
DESCRIPTION PORT PROTOCOL LISTEN
Game: Server 11000 udp 1
Game: Master 10889 udp 1
Steam: Auth 8768 udp 0
Steam: Master 27018 udp 1
Status: STARTED
`
It looks like shard name in dstserver-2 lgsm config is not used. May be it is just bug of 'dt' command. Will check it in this evening.
UPD:
This looks like visual bug of "dt" function. In fact caves works correctly.
Thank you a lot for this guide!