Guides/Simple Dedicated Server Setup

This is a complicated and outdated guide to setting up a dedicated server. To make things easiest, it'll be running the dedicated server through Steam on a computer that you can already use normally (i.e. not a server that you access through command line or anything).
Please follow this guide instead : https://forums.kleientertainment.com/forums/topic/64212-dedicated-server-quick-setup-guide-windows/
== Installing ==
=== Old Steam Client ===
* In Steam, hover over the Library tab and select Tools.
* Scroll to Don't Starve Together Dedicated Server, right-click and select Install Game....
* Follow the steps to install like any other Steam game.
=== New Steam Client ===
* Click the Library tab
* Click the Game dropdown menu on the left panel above all your games.
* Check the Tools Filter
* Scroll to Don't Starve Together Dedicated Server, right-click and select Install Game....
* Follow the steps to install like any other Steam game.
== Running pre-configured servers ==
In the Caves Are Now Live! update some major changes for dedicated server networking was announced:
* Caves for Don't Starve Together can only be hosted on a dedicated server
* Each world layer (Overworld and every Cave) must be run on a different dedicated server
But there is a good news! There is a pre-configured server for hosting caves which can be run from a steam directly.
Official, up-to-date guides:
Hosting Caves with the Preconfigured Servers
Understanding Shards and Migration Portals
== Configuring ==
* First, right-click Don't Starve Together Dedicated Server in Steam and select Properties.
* Click Set launch options... at the bottom and enter this: "-console -conf_dir DoNotStarveTogetherDedicated". This will let you type console commands in the dedicated server window, and make it save to a different folder from the normal game.
* Right-click Don't Starve Together Dedicated Server and select Play game.... After it stops printing stuff out, close the window it makes (this lets it generate the save folder).
* Launch Don't Starve Together normally, and open the console with the tilde (~) key. Enter "TheNet:GenerateClusterToken()", hit enter, and close the game.
* Find the folder ~/Documents/Klei folder. It should now have both the DoNotStarveTogetherDedicated and the DoNotStarveTogether folders inside. Copy both settings.ini and server_token.txt from DoNotStarveTogether folder into DoNotStarveTogetherDedicated.
* Open the copied settings.ini in a text editor (Notepad, TextEdit, Notepad++, etc-- not a rich text editor like Word).
* Make sure you have the following lines under "[network]":
 default_server_name = A unique server name
 default_server_description = A very nice server description
 server_port = 10999
 server_password = password
 max_players = 1 .. 64
 pvp = true | false
 game_mode = endless | survival | wilderness
 enable_snapshots = true
 pause_when_empty = false
 server_save_slot = 1..5
* Change the parts on the right to what you want. Note that game_mode is case-sensitive, so don't put in "Wilderness". For example, (a PvP Wilderness server with no password):
 default_server_name = Supervillain PvP
 default_server_description = Do you have what it takes?
 server_port = 10998
 server_password = 
 max_players = 6
 pvp = true
 game_mode = wilderness
 enable_snapshots = true
 pause_when_empty = true
 server_save_slot = 1
* If you want to come back and change these later, make sure you do it while the dedicated server is not running. If you change it while the server is running, it'll rewrite it with the old settings when it gets closed.
== Port Forwarding ==
You might not have to port forward, but you probably will (if you need to, but haven't yet, this will make it so that nobody else can see your server in the list and connect to it; because you're on the same computer, you should be able to see it despite that). Every router is different, but the basic idea is that you have a network in your house, with IP addresses for the computers there. You have to get your computer's local IP address (look up how to do this; you'll want to include your operating system in the search, such as "find local IP in windows 8"), and then tell your router to forward connections on the port to your computer (look up instructions for your router, such as "asus rt-n65u port forwarding").
== Playing ==
Now, when you want to play on the server, you can launch it through the Library > Tools section of Steam, then join it through Don't Starve Together normally.
== Optional Steps ==
You might want to customize your world generation settings or add mods. These both have to be done differently.
=== World Customization ===
To have custom world generation settings, you need to make a text file called worldgenoverride.lua in your DoNotStarveTogetherDedicated folder. Inside this file, you can set individual settings like this:
 return {
 	override_enabled = true,
 	season="shortboth", world_size="huge", season_start="summer",
 	flint="never", grass="never", sapling="never", trees="never"
 }
The override_enabled part determines whether custom settings are used at all. Change "true" to "false" there if you want to turn off all customization (or delete the file)-- this won't affect worlds that have already been generated, though. Here are all possible options :
 return {
 override_enabled = true,
 preset = "SURVIVAL_TOGETHER", -- "SURVIVAL_TOGETHER", "MOD_MISSING", "SURVIVAL_TOGETHER_CLASSIC", "SURVIVAL_DEFAULT_PLUS", "COMPLETE_DARKNESS", "DST_CAVE", "DST_CAVE_PLUS"
 overrides = {
 -- MISC
 task_set = "default", -- "classic", "default", "cave_default"
 start_location = "default", -- "caves", "default", "plus", "darkness"
 world_size = "default", -- "small", "medium", "default", "huge"
 branching = "default", -- "never", "least", "default", "most"
 loop = "default", -- "never", "default", "always"
 specialevent = "default", -- "none", "default", "hallowed_nights", "winters_feast", "year_of_the_gobbler"
 autumn = "default", -- "noseason", "veryshortseason", "shortseason", "default", "longseason", "verylongseason", "random"
 winter = "default", -- "noseason", "veryshortseason", "shortseason", "default", "longseason", "verylongseason", "random"
 spring = "default", -- "noseason", "veryshortseason", "shortseason", "default", "longseason", "verylongseason", "random"
 summer = "default", -- "noseason", "veryshortseason", "shortseason", "default", "longseason", "verylongseason", "random"
 season_start = "default", -- "default", "winter", "spring", "summer", "autumnorspring", "winterorsummer", "random"
 day = "default", -- "default", "longday", "longdusk", "longnight", "noday", "nodusk", "nonight", "onlyday", "onlydusk", "onlynight"
 weather = "default", -- "never", "rare", "default", "often", "always"
 earthquakes = "default", -- "never", "rare", "default", "often", "always"
 lightning = "default", -- "never", "rare", "default", "often", "always"
 frograin = "default", -- "never", "rare", "default", "often", "always"
 wildfires = "default", -- "never", "rare", "default", "often", "always"
 regrowth = "default", -- "veryslow", "slow", "default", "fast", "veryfast"
 touchstone = "default", -- "never", "rare", "default", "often", "always"
 boons = "default", -- "never", "rare", "default", "often", "always"
 cavelight = "default", -- "veryslow", "slow", "default", "fast", "veryfast"
 disease_delay = "default", -- "none", "random", "long", "default", "short"
 prefabswaps_start = "default", -- "classic", "default", "highly random"
 petrification = "default", -- "none", "few", "default", "many", "max"
 
 -- RESOURCES
 flowers = "default", -- "never", "rare", "default", "often", "always"
 grass = "default", -- "never", "rare", "default", "often", "always"
 sapling = "default", -- "never", "rare", "default", "often", "always"
 marshbush = "default", -- "never", "rare", "default", "often", "always"
 tumbleweed = "default", -- "never", "rare", "default", "often", "always"
 reeds = "default", -- "never", "rare", "default", "often", "always"
 trees = "default", -- "never", "rare", "default", "often", "always"
 flint = "default", -- "never", "rare", "default", "often", "always"
 rock = "default", -- "never", "rare", "default", "often", "always"
 rock_ice = "default", -- "never", "rare", "default", "often", "always"
 meteorspawner = "default", -- "never", "rare", "default", "often", "always"
 meteorshowers = "default", -- "never", "rare", "default", "often", "always"
 mushtree = "default", -- "never", "rare", "default", "often", "always"
 fern = "default", -- "never", "rare", "default", "often", "always"
 flower_cave = "default", -- "never", "rare", "default", "often", "always"
 wormlights = "default", -- "never", "rare", "default", "often", "always"
 
 -- UNPREPARED
 berrybush = "default", -- "never", "rare", "default", "often", "always"
 carrot = "default", -- "never", "rare", "default", "often", "always"
 mushroom = "default", -- "never", "rare", "default", "often", "always"
 cactus = "default", -- "never", "rare", "default", "often", "always"
 banana = "default", -- "never", "rare", "default", "often", "always"
 lichen = "default", -- "never", "rare", "default", "often", "always"
 
 -- ANIMALS
 rabbits = "default", -- "never", "rare", "default", "often", "always"
 moles = "default", -- "never", "rare", "default", "often", "always"
 butterfly = "default", -- "never", "rare", "default", "often", "always"
 birds = "default", -- "never", "rare", "default", "often", "always"
 buzzard = "default", -- "never", "rare", "default", "often", "always"
 catcoon = "default", -- "never", "rare", "default", "often", "always"
 perd = "default", -- "never", "rare", "default", "often", "always"
 pigs = "default", -- "never", "rare", "default", "often", "always"
 lightninggoat = "default", -- "never", "rare", "default", "often", "always"
 beefalo = "default", -- "never", "rare", "default", "often", "always"
 beefaloheat = "default", -- "never", "rare", "default", "often", "always"
 hunt = "default", -- "never", "rare", "default", "often", "always"
 alternatehunt = "default", -- "never", "rare", "default", "often", "always"
 penguins = "default", -- "never", "rare", "default", "often", "always"
 cave_ponds = "default", -- "never", "rare", "default", "often", "always"
 ponds = "default", -- "never", "rare", "default", "often", "always"
 bees = "default", -- "never", "rare", "default", "often", "always"
 angrybees = "default", -- "never", "rare", "default", "often", "always"
 tallbirds = "default", -- "never", "rare", "default", "often", "always"
 slurper = "default", -- "never", "rare", "default", "often", "always"
 bunnymen = "default", -- "never", "rare", "default", "often", "always"
 slurtles = "default", -- "never", "rare", "default", "often", "always"
 rocky = "default", -- "never", "rare", "default", "often", "always"
 monkey = "default", -- "never", "rare", "default", "often", "always"
 
 -- MONSTERS
 spiders = "default", -- "never", "rare", "default", "often", "always"
 cave_spiders = "default", -- "never", "rare", "default", "often", "always"
 hounds = "default", -- "never", "rare", "default", "often", "always"
 houndmound = "default", -- "never", "rare", "default", "often", "always"
 merm = "default", -- "never", "rare", "default", "often", "always"
 tentacles = "default", -- "never", "rare", "default", "often", "always"
 chess = "default", -- "never", "rare", "default", "often", "always"
 lureplants = "default", -- "never", "rare", "default", "often", "always"
 walrus = "default", -- "never", "rare", "default", "often", "always"
 liefs = "default", -- "never", "rare", "default", "often", "always"
 deciduousmonster = "default", -- "never", "rare", "default", "often", "always"
 krampus = "default", -- "never", "rare", "default", "often", "always"
 bearger = "default", -- "never", "rare", "default", "often", "always"
 deerclops = "default", -- "never", "rare", "default", "often", "always"
 goosemoose = "default", -- "never", "rare", "default", "often", "always"
 dragonfly = "default", -- "never", "rare", "default", "often", "always"
 antliontribute = "default", -- "never", "rare", "default", "often", "always"
 bats = "default", -- "never", "rare", "default", "often", "always"
 fissure = "default", -- "never", "rare", "default", "often", "always"
 wormattacks = "default", -- "never", "rare", "default", "often", "always"
 worms = "default", -- "never", "rare", "default", "often", "always"
 },
 }
=== Mods ===
For mods, you need to make two files. One, dedicated_server_mods_setup.lua, tells the dedicated server which mods it needs to download and update. The other, modoverrides.lua, tells it which to have active and what configuration options to use for them.
The first one needs to be created in the game files for the dedicated server. Open up the Library > Tools tab in Steam and right-click on Don't Starve Together Dedicated Server, select Properties, then go to the Local Files tab in the popup and click Browse local files.... In the window that opens, go to the mods folder, and inside, create the text file dedicated_server_mods_setup.lua if it does not exist already, then open it in a text editor. For each mod you want, go to their page on the Steam Workshop and get the URL of that page (if it doesn't show at the top, you can right-click anywhere and select Copy Page URL). There will be a number at the end of the URL; for example, Always On Status's number is 376333686. Inside dedicated_server_mods_setup.lua, add a line for each mod that looks like this:
 ServerModSetup("376333686") -- Write the name of the mod here so you remember
The second one needs to be created in your DoNotStarveTogetherDedicated folder. Make the text file modoverrides.lua with this inside:
 return {
 
 }
For each mod you want to enable, add a line in the middle for it like this (make sure it has the comma at the end):
 return {
 ["workshop-427002021"] = { enabled = true }, -- put the mod name here so you remember
 }
If you want to change options for the mod, you'll have to look at that mod's files. Go back to the mods folder where you made dedicated_server_mods_setup.lua. If you haven't run the dedicated server since last editing that file, run it so it downloads the mods. Then, you should have a folder like workshop-427002021 for each mod. Look inside, and open the modinfo.lua file in a text editor. Usually you'll find options listed like this:
 configuration_options =
 {
 {
 name = "starting_day",
 label = "Starting day",
 hover = "After this day, this mod will start to block certain \nactions from limited players.",
 options =
 {
 {description = "10", data = 10},
 {description = "15", data = 14},
 {description = "21", data = 20},
 {description = "36", data = 35}
 },
 default = 10,
 },
 {
 name = "min_days",
 label = "Minimum player days",
 hover = "Players need to spend this amount of days to no \nlonger be limited.",
 options =
 {
 {description = "1", data = 1},
 {description = "2", data = 2},
 {description = "3", data = 3},
 {description = "5", data = 5}
 },
 default = 1,
 },
 }
label shows the name for the option that you'd see on the mods page, and for each option description is what that choice is called, and data is the actual value that the mod uses for that option. Using that information, you can change the line in modoverrides.lua to look like this:
 	["workshop-378160973"] = { enabled = true,
 		configuration_options =
 		{
 			description1 = data1,
 			description2 = data2,
 		},
 	}, -- mod name here so you remember
For example, this is a configuration for Global Positions:
 	["workshop-378160973"] = { enabled = true,
 		configuration_options =
 		{
 			SHOWPLAYERSOPTIONS = 1,
 			SHOWPLAYERICONS = false,
 			FIREOPTIONS = 1,
 			SHOWFIREICONS = true,
 			SHAREMINIMAPPROGRESS = false,
 		},
 	}, -- Global Positions
Made by Builder
Category:Dedicated Servers