> Intel // field guide_
How to Set Up a Don't Starve Together Dedicated Server (With Caves)
Winter is coming, somebody's laptop just went to sleep, and the whole camp got kicked mid-boss-fight. A dedicated Don't Starve Together server fixes that: the world keeps ticking on its own machine, and your group joins whenever they like.
This guide covers installing the server with SteamCMD, getting a Klei token, building a cluster with both a surface (Master) and a caves shard, opening ports, handling admins and rollbacks, and fixing the usual errors. The community-run Don't Starve wiki dedicated server guide and its Simple Dedicated Server Setup page are the references behind it. Klei changes the game often, so check them if a step looks different on your machine.
Why Run a Dedicated Don't Starve Together Server?
The world outlives the host. Hosting from your own client means the world dies when you close the game. A dedicated server keeps running, so the Constant keeps going while you sleep.
Caves without the client tax. A cluster runs the surface and the caves as separate server processes (shards). On a dedicated box they do not compete with your game for CPU.
Your rules. Pick the game mode, set a password, name your admins, and decide who is on the whitelist.
Many servers, one copy of the game. The wiki notes that one copy of the game can host any number of online server instances.
What You'll Need
- A copy of Don't Starve Together. The server software can be installed without owning the game, but the wiki says hosting an online server requires owning it. Offline servers do not.
- A Klei account for the server token.
- A Windows or Linux machine. The wiki says official builds exist only for Windows and Linux, in x86 and x86_64.
- SteamCMD, or the Steam client's Tools library.
- Port access. Players connect over UDP, and 10999 is the port the wiki tells you to forward.
- RAM and CPU. Klei does not publish official server specs that we could find. Plan for two server processes, since the surface and caves each run their own, and watch usage as your world grows.
- A text editor. Everything is configured in plain
.ini,.txtand.luafiles.
Step 1: Install the Dedicated Server
The dedicated server is Steam app ID 343050.
With the Steam client
- Open your Steam Library.
- Tick the Tools filter in the game dropdown.
- Right-click Don't Starve Together Dedicated Server and choose Install Game...
- Note the install folder. You will need its
binfolder later.
With SteamCMD
login anonymous
force_install_dir /path/to/installation/directory
app_update 343050 validate
Install SteamCMD from Valve's developer wiki if you do not have it yet. Run those three lines, then quit.
Step 2: Get a Server Token
An online server needs a cluster token. The wiki says offline clusters ignore it. There are two ways to get one.
From Klei's website. Go to accounts.klei.com, type a name for the server in the cluster name box, click add, and copy the token it lists.
From the game client. Start Don't Starve Together, press ~ to open the console (or ù on an AZERTY keyboard), and run:
TheNet:GenerateClusterToken()
That writes cluster_token.txt into the Klei folder:
- Windows:
Documents/Klei/DoNotStarveTogether/ - Linux:
~/.klei/DoNotStarveTogether/ - macOS:
~/Documents/Klei/DoNotStarveTogether/
Treat the token like a password and do not share it. Paste it into a file named cluster_token.txt in your cluster folder, and make sure nothing else is in the file. The wiki says an E_EXPIRED_TOKEN error can come from extra characters, including invisible ones, at the end of the file.
Step 3: Build the Cluster Folder
A server is a cluster of shards. The usual layout is one master shard named Master (the surface, which the game calls the Forest) and one secondary shard named Caves. Make a folder for the cluster, for example MyDSTServer, and arrange it like this:
MyDSTServer/
Master/
server.ini
worldgenoverride.lua
Caves/
server.ini
worldgenoverride.lua
cluster.ini
cluster_token.txt
cluster.ini
[GAMEPLAY]
pause_when_empty = true
game_mode = survival
[NETWORK]
cluster_password = changeme
cluster_name = Our Camp
cluster_description = Bring a flower garland
autosaver_enabled = true
[SHARD]
shard_enabled = true
cluster_key = pick-something-long
game_mode must be survival, endless or wilderness. Leave cluster_password empty for no password. The Simple Setup page uses defaultPass1 as the cluster_key, which is the shared secret the shards use to talk to each other, so change it. The wiki also lists max_players under [GAMEPLAY] and tick_rate (15 to 60, with 15 recommended) under [NETWORK].
Master/server.ini
[NETWORK]
server_port = 10998
[SHARD]
is_master = true
name = Master
id = 1
[STEAM]
master_server_port = 27016
authentication_port = 8766
[ACCOUNT]
encode_user_path = true
Caves/server.ini
[NETWORK]
server_port = 10999
[SHARD]
is_master = false
name = Caves
id = 2
[STEAM]
master_server_port = 12346
authentication_port = 10166
[ACCOUNT]
encode_user_path = true
Each shard on one machine needs its own server_port, master_server_port and authentication_port, so do not copy one file over the other without changing them.
worldgenoverride.lua
This picks the world preset for each shard.
return {
override_enabled = true,
preset = "SURVIVAL_TOGETHER",
}
For the Master shard, the Simple Setup page lists SURVIVAL_TOGETHER, SURVIVAL_TOGETHER_CLASSIC, SURVIVAL_DEFAULT_PLUS, COMPLETE_DARKNESS and TERRARIA. For Caves, use DST_CAVE, DST_CAVE_PLUS or TERRARIA_CAVE.
Step 4: Move the Cluster Into Place
The server looks for clusters at <storage root>/<conf_dir>/<cluster>/<shard>/. The wiki gives the defaults for the storage root:
- Windows:
%USERPROFILE%/Documents/Klei - Linux:
~/.klei - macOS:
~/Documents/Klei
The default conf_dir is DoNotStarveTogether and the default cluster name is Cluster_1. You can point the server anywhere with -persistent_storage_root, -conf_dir and -cluster. Whatever you choose, the folder you built in Step 3 must end up at <storage root>/<conf_dir>/<cluster>.
Step 5: Open the Ports
On a home network, forward UDP traffic to the machine and allow it through the firewall. The wiki's troubleshooting section says to forward UDP 10999. The Simple Setup example gives the Master shard 10998 and the Caves shard 10999, so if friends cannot connect, forward and allow UDP for both. The -port option takes 1024 to 65535 for online servers, and LAN-only servers must use 10998 to 11018.
Step 6: Start Both Shards
Each shard is its own process. Start the server executable once per shard, with its working directory set to the install's bin folder. The executable is named dontstarve_dedicated_server_nullrenderer, with a platform and architecture suffix on some builds. Pass the storage root, config directory, cluster and shard:
dontstarve_dedicated_server_nullrenderer -persistent_storage_root /home/you/dst -conf_dir config -cluster MyDSTServer -shard Master
dontstarve_dedicated_server_nullrenderer -persistent_storage_root /home/you/dst -conf_dir config -cluster MyDSTServer -shard Caves
Run them in two terminals, or two background sessions. With those arguments the cluster lives at /home/you/dst/config/MyDSTServer. Wait for both to finish loading. Other options from the wiki worth knowing:
-bind_ip: the address the server listens on for players.-players: maximum players, an integer from 1 to 64.-tick: overridestick_rate.-console: enables a command-line console on the server that runs privileged Lua.-backup_logs: keeps the previous logs in a backup folder each run.
Step 7: Join and Test
Open Don't Starve Together, go to the server browser, and search for your cluster name. A server with a bad token will not list publicly. Join, then check that you can travel between the surface and the caves.
Admins, Whitelist and Blocklist
Three optional files sit in the cluster folder, one User ID per line:
adminlist.txtwhitelist.txtblocklist.txt
Online User IDs look like KU_XXXXXXXX. The server console logs a player's ID when they log in. If adminlist.txt is empty, an online server makes the owner of the cluster token the admin. Match whitelist_slots in cluster.ini to the number of whitelisted players. The wiki also warns of a known bug where only the last User ID in whitelist.txt is respected.
Console Commands: Save, Rollback, Announce
Admins run console commands from the in-game console. On a dedicated server, hold Ctrl while the console is open to send commands remotely. The wiki's console page describes these:
c_save()forces an immediate save. Servers otherwise autosave when night ends.c_rollback(3)reverts the server three saves.c_rollback()goes back one.c_announce("Restarting in five")posts a server-wide message, handy before a restart.c_shutdown(true)saves and shuts down.c_shutdown(false)exits without saving.TheNet:Kick(userid)andTheNet:Ban(userid)remove or ban a player.
Rollback is your friend after a Deerclops wipes the base or someone feeds the whole stockpile to a pig king.
Mods
Installation is global to the server, and enabling and configuration are per shard. For Workshop mods, add lines to dedicated_server_mods_setup.lua in the server install:
ServerModSetup("<workshop id>")
Use ServerModCollectionSetup("<id>") for a collection. Then turn the mod on in each shard's modoverrides.lua with enabled = true. The wiki says mods should generally match across all shards, so edit both Master and Caves. Hand-editing config values that the in-game screen does not allow can cause malfunctions.
Mods are your responsibility to keep compatible with the current game version. The wiki also notes that Workshop mods update only when their Workshop version changes.
Updating the Server
Rerun the SteamCMD install line, app_update 343050 validate. Verification removes files that do not belong to the game, so leave validate off if you installed mods manually. If you use the Steam client, update the tool like any other game. Stop both shards before updating.
Backups
The server autosaves when the night ends, and c_save() forces a save. For an off-machine copy, stop both shards or run c_save() first, then copy the whole cluster folder, including cluster.ini, the shard folders and the lists. Keep a few dated copies. Do not copy cluster_token.txt anywhere public.
Troubleshooting
The server does not show in the browser
Check that the token is valid, that UDP 10999 is forwarded to the machine, and that offline_cluster and lan_only_cluster are not set. Confirm the server is not running with -lan, which forces offline and LAN mode.
E_EXPIRED_TOKEN
Re-copy the token into cluster_token.txt and check for trailing characters, including invisible ones. Generate a new token if needed.
Players cannot reach the caves
Both shards must be running with the same cluster_key and unique ports. Make sure shard_enabled = true in cluster.ini.
Workshop mods fail to download
The wiki notes that V2 mods download separately for each shard by default. To share a copy, use -ugc_directory ../ugc_mods. To avoid race conditions, run once with -only_update_server_mods, then start the shards with -skip_update_server_mods.
Lag when many players are online
Check CPU and RAM on the machine. The wiki recommends a tick_rate of 15. Remember that each shard is a separate process using its own memory.
FAQ: Don't Starve Together Dedicated Server Setup
How do I make a Don't Starve Together dedicated server?
Install app 343050 with SteamCMD, get a cluster token from Klei, build a cluster folder with cluster.ini, cluster_token.txt and Master and Caves shard folders, then start both shards.
Do I need a Klei token?
For an online server, yes. Offline clusters do not need one. The token proves you own the game, and you generate it on your Klei account page or in the game client.
How do I add caves?
Add a second shard named Caves with its own server.ini, set shard_enabled = true and a shared cluster_key, and start it alongside Master.
What ports does it use?
UDP 10999 is the one the wiki says to forward. The setup example also gives the Master shard 10998, plus separate Steam ports for each shard.
How many players can join?
The -players option takes an integer from 1 to 64.
How do I become admin?
Add your KU_ User ID to adminlist.txt. If the file is empty, the owner of the cluster token is admin on online servers.
Can I run more than one server?
Yes. Give each its own -port, -steam_master_server_port and -steam_authentication_port.
Final Thoughts
A Don't Starve Together server is a token, a handful of text files and two processes. Get the shard ports unique, keep the cluster_key private, and back up the cluster folder before you try anything fancy in the caves.
Don't Starve Together Hosting on EZ Game Host
If you would rather skip the shard juggling, EZ Game Host offers Don't Starve Together server hosting where every server runs both the surface and caves shards. You create a server token in your Klei account and paste it at checkout, set a server name and a maximum player count, and manage the world from the panel with its console, file manager and schedules. Every plan has 3 backup slots and 24/7 support, plans start at $12 a month, and monthly plans can be cancelled any time.
Intel
Related guides
- Game Server DDoS Protection: Why It Matters and How It WorksGame server DDoS protection explained: the attacks that target game servers, how filtering and scrubbing work, and how to keep your community online.
- What Is a Dedicated Server? Everything Gamers Need to KnowWhat is a dedicated server? A guide to how they work, the main hosting types, the specs that matter, cost factors, and how to choose for your community.
- How Much Does Game Server Hosting Cost? Full Pricing GuideWhat drives game server hosting cost: RAM, CPU, storage, mods and billing interval, with real plan prices as a worked example and tips to avoid overpaying.