This guide walks you through enabling and configuring caves for a dedicated Don’t Starve Together (DST) server. You’ll learn how to generate a cave world, adjust its settings, and ensure your server runs both the surface and cave shards smoothly. You’ll need access to your server’s command line or file manager, and a basic understanding of DST server configuration files.
What You’ll Need
- A dedicated DST server (Windows or Linux) with the base game files installed.
- Server administration access (SSH, remote desktop, or a control panel).
- Basic familiarity with editing text files (like
settings.iniandworldgenoverride.lua). - Optional: A tool like WinSCP or a terminal editor (nano, vim) for file editing.
Step-by-Step
- Stop your server if it’s currently running. You’ll be modifying configuration files that are read at startup, so make sure the process is fully stopped.
- Locate your server’s configuration directory. This is usually the folder where your
settings.iniandcluster.inifiles are stored. On a typical Linux install, this is under~/.klei/DoNotStarveTogether/followed by your cluster name (e.g.,MyDedicatedServer). - Open
cluster.iniin a text editor. This file controls the overall cluster settings. Look for the[SHARD]section. If it doesn’t exist, create it. Add or modify the following lines:[SHARD] shard_enabled = trueThis enables the shard system, which is required for caves.
- Create a new folder for the caves shard. Inside your cluster folder, create a directory named
Caves. The name is case-sensitive on Linux. This is where the cave world data and configuration will live. - Create the cave shard configuration. Inside the
Cavesfolder, create a file namedserver.ini. Paste the following basic configuration:[NETWORK] server_port = 11000 [SHARD] is_master = false name = Caves id = 1 [ACCOUNT] encode_user_path = true [STEAM] master_server_port = 27018 authentication_port = 8768 [SETTINGS] intent = cooperativeNote: The
server_portandmaster_server_portmust be different from the surface shard’s ports. The surface typically uses 10999 and 27017, so 11000 and 27018 are safe choices. If you have multiple caves (e.g., a second cave), increment these numbers. - Create the cave world generation file. In the same
Cavesfolder, create a file namedworldgenoverride.lua. This file defines the cave world’s settings. A minimal example:return { override_enabled = true, presets = { "DST_CAVE", }, }This uses the default cave preset. You can customize cave-specific options later, like
cave_preview,start_location, orbranching, by adding them under theworldgentable. For now, the preset is enough to get started. - Set up the surface shard (if not already done). Your main world (the surface) should already have a
server.iniin its own folder (e.g.,Master). Ensure that in that file, the[SHARD]section hasis_master = trueand anid = 0. Also, make sure theserver_portis set (e.g., 10999) and themaster_server_portis set (e.g., 27017). - Start your server. Launch your server as you normally would. The server will now attempt to start both shards. The first time you start, it will generate the cave world based on
worldgenoverride.lua. This can take a few minutes. - Verify caves are running. Check your server logs. You should see messages indicating that the Caves shard has started. In the game client, when you join the server, you’ll see a cave entrance (a large hole in the ground) that you can jump into to access the caves.
Common Mistakes
- Forgetting to enable sharding in
cluster.ini. Ifshard_enabledis missing or false, the server will only run the surface and ignore the Caves folder. - Using the same ports for both shards. This causes a conflict and the server will fail to start. Always use distinct port numbers for each shard.
- Incorrect folder name. The cave shard folder must be named
Caves(capital C) on Linux. A typo likecaveswill cause the server to not recognize it. - Missing
worldgenoverride.lua. Without this file, the cave shard may generate a default world, but it’s better to be explicit. If the file is absent, the server might generate a cave with default settings, which is fine, but you lose control. - Not stopping the server before editing files. The server reads these files at startup. If you edit them while the server is running, changes won’t take effect until a restart, and you might accidentally overwrite your changes if the server writes to the same files.
Tips
- Back up your world files before making major changes. Copy the entire cluster folder to a safe location. This saves you from a corrupted world.
- Use a dedicated server tool like
dontstarve_dedicated_server_nullrendereron Linux or the Windows batch files to manage shard startup. They handle the shard boot order automatically. - Tune cave settings in
worldgenoverride.luato your liking. For example, you can setbranching = "most"for more cave branches, or adjustcave_previewto control how much of the cave map is visible at start. Refer to the DST wiki for a full list of options. - Monitor memory usage. Caves add a significant amount of memory overhead. Ensure your server has enough RAM (at least 2GB for a small server with caves, more for larger groups).
- Test with a small group first. Before opening to the public, join with a friend to make sure the cave entrance works and the world is stable.
Troubleshooting
- Server won’t start after adding caves. Check the server logs for errors. Common issues include port conflicts (change the ports in
server.ini), missing files (ensureworldgenoverride.luaexists), or incorrect folder permissions. Also verify thatshard_enabled = trueis incluster.ini. - Caves are not generating. If the server starts but you don’t see a cave entrance, the Caves shard might have failed to start. Look for errors in the log that mention “Caves” or “shard”. Make sure the
server.iniin the Caves folder hasis_master = falseand a uniqueid. Also, ensure theworldgenoverride.luais valid Lua syntax. - Players get disconnected when entering caves. This usually indicates a network issue. Check that the cave shard’s ports are reachable from the client. If you’re using a firewall, open the TCP and UDP ports you assigned (e.g., 11000 and 27018). Also, ensure
encode_user_path = trueis set in the cave’sserver.ini. - Cave world is too small or too big. Adjust the world size in
worldgenoverride.luaby adding aworld_sizeparameter. For example,world_size = "medium"or"large". You’ll need to regenerate the cave world (delete theCavesfolder’s save data) to apply changes. - Mods not working in caves. If you use mods, they need to be enabled on both shards. Check that the
modoverrides.luafile is present in the Caves folder, or add the same mods to the cave’sserver.iniunder[MODS]section. Some mods are not cave-compatible; check the mod’s description.
Frequently Asked Questions
Do I need a separate server for caves?
No, the same server process can run both the surface and caves as separate shards. You just need to configure them properly as described above.
Can I add caves to an existing world without losing progress?
Yes, you can enable caves on an existing cluster. The surface world will remain intact, and the cave world will be generated fresh when you start the server with the new configuration. Your surface progress is preserved.
What are the default ports for DST shards?
The surface shard typically uses server_port = 10999 and master_server_port = 27017. The first cave shard should use server_port = 11000 and master_server_port = 27018. If you add a second cave, increment to 11001 and 27019, and so on.
How do I change cave world settings after generation?
You can edit worldgenoverride.lua in the Caves folder, but changes only apply to a newly generated world. To regenerate, delete the save folder inside the Caves directory (be careful—this erases all cave progress). Alternatively, you can use the in-game console to change some settings on the fly, but that’s more advanced.
Why does my server use more RAM with caves enabled?
Caves are a separate world that runs simultaneously, doubling the world simulation. This requires more memory and CPU. Ensure your server has enough resources; 2GB RAM is a minimum for a small group, but 4GB is safer.
Can I run multiple caves (e.g., two cave levels)?
Yes, DST supports multiple cave shards. You would create additional folders (e.g., Caves2) with their own server.ini and worldgenoverride.lua, and assign unique IDs and ports. However, the game client only supports one cave level per server, so additional caves are not accessible in standard gameplay. This feature is mainly for modding or experimental setups.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- How to Choose an Amplifier for Magico A3 Speakers
- How to Ban a Player from Your FiveM Server
- Pokemon Go Friend Codes: How to Add & Use Them33.33 XP/day
- Google Algorithm Change: Original Reporting Boost
- Create Folder for Selected Item on Mac: Full Guide
- Data Center Location Questions for AI Workloads