To use Don’t Starve Together (DST) server commands, first authorize your Klei user ID in the cluster’s adminlist.txt, open the console with ~, and switch from Local to Remote mode with Ctrl when the command must affect the shared server. Use c_listallplayers() to identify players, TheNet:Kick(userid) or TheNet:Ban(userid) for moderation, c_give() for inventory items, and c_spawn() for world objects. Save before rollback, regeneration, or shutdown work. On a dedicated server with caves, administer the Master and Caves shards as separate launch processes, each with its own configuration.
This guide explains authorization, console modes, command syntax, maintenance procedures, shard setup, and recovery when commands appear to work only locally.
How do DST server admin commands work?
DST’s console is enabled by default in the game’s reference configuration. A command runs with the authority of the context in which it is entered: Local commands affect your client or the local simulation, while Remote commands are sent to the shared world and are the mode required for dedicated-server administration.
The host of a listen server already has server authority. On a dedicated server, authority is tied to the Klei user ID listed in the cluster’s adminlist.txt. Online IDs use the KU_XXXXXXXX format. If the file is missing or empty, the cluster-token owner is the only administrator on an online server; an offline server has no administrator by default.
Most command state is not permanent. After a world loads, many commands have to be entered again, so treat the console as a live administration interface rather than a configuration file.
How do I open the console and select Remote mode?
- Join the world with the account that is authorized in
adminlist.txt, or use the host account. - Press the tilde key (
~). If your keyboard layout uses another binding, check the game’s Controls settings and change the console key there. - Look at the console mode indicator. Leave it in Local for a client-only action; hold Ctrl while the console is open to switch to Remote for a shared-world or dedicated-server command.
- Enter the command exactly, including parentheses, quotation marks, capitalization, and the required player or prefab argument.
- After loading or reloading a world, verify the mode and re-enter commands that are not persistent.
If a command appears to succeed but other players see no change, the first check is the Local/Remote mode rather than the command spelling.
How do I identify, kick, or ban a player?
Start with c_listallplayers(). It prints the player names, indexes, and Klei IDs that the moderation commands need. Use the displayed Klei ID, not a display name that may be duplicated or formatted differently.
| Purpose | Command | What it does |
|---|---|---|
| List players | c_listallplayers() |
Shows names, indexes, and Klei IDs for connected players. |
| Remove a player | TheNet:Kick(userid) |
Kicks the specified Klei ID from the server without imposing a ban. |
| Permanent ban | TheNet:Ban(userid) |
Bans the specified Klei ID. |
| Timed ban | TheNet:BanForTime(userid, seconds) |
Bans the ID for the number of seconds supplied as the second argument. |
For example, if the player list returns KU_Example, enter TheNet:Kick("KU_Example"). Run these commands in Remote mode when the target is on a dedicated or shared server. Hosting-panel consoles expose the same ID-based workflow, so the syntax remains useful even when you administer the server outside the game client.
Kick or ban: which should I use?
- Use
Kickfor a one-time removal, a connection problem, or a warning that does not require blocking a return. - Use
Banwhen the account must be prevented from rejoining. - Use
BanForTimewhen you need a cooling-off period; supply a duration in seconds and choose the value before executing it.
Double-check the ID immediately before a permanent ban. A mistaken ID can punish the wrong account, and the command does not ask for a confirmation prompt.
How do I give items or spawn resources?
Use c_give() for an item that belongs in your inventory and c_spawn() for a prefab that should appear in the world at the cursor. Both require the game’s internal prefab name rather than the name shown in a translated interface.
| Command | Syntax | Result | Use it when |
|---|---|---|---|
| Give an item | c_give("prefab", amount) |
Adds the specified amount to your inventory. | The object is inventory-storable and you want it on your character. |
| Spawn a prefab | c_spawn("prefab", amount) |
Creates the prefab at the cursor location. | You need a structure, creature, resource, or other world entity. |
| Find the next matching prefab | c_gonext("prefab") |
Teleports you to the next matching prefab. | You are locating an existing object rather than creating one. |
Replace prefab with a valid internal name and use a numeric amount where that prefab accepts a quantity. If a command returns no useful result, check the spelling and whether the target is an inventory item or a world entity. A dedicated server still needs Remote mode for a spawn that everyone should see.
How do I move, kill, or revive players?
First run c_listallplayers() and note the player’s index. The index is used through the AllPlayers[number] table in movement and recovery commands.
| Action | Command | Important effect |
|---|---|---|
| Move another player to your cursor | c_move(AllPlayers[number]) |
Moves the selected player to the position under your cursor. |
| Teleport to a player | c_goto(AllPlayers[number]) |
Moves your character to the selected player. |
| Kill a selected player | AllPlayers[number]:PushEvent('death') |
Triggers the character’s death event. |
| Resurrect a ghost | AllPlayers[number]:PushEvent('respawnfromghost') |
Triggers the character’s respawn-from-ghost event. |
| Return a character to selection | c_despawn(AllPlayers[number]) |
Returns the character to the selection screen; the character’s carried items can be deleted. |
Because player indexes can change as people join or leave, do not reuse an old index after the roster changes. Run the player list again, confirm the name and ID, and then execute the action in Remote mode.
How do I enable god mode, free crafting, or stat maintenance?
These commands change the survival rules. Use them only when the group agrees, especially in Remote mode, because the resulting advantage or stat change can affect the shared experience.
c_godmode()toggles god mode and revives the player.c_supergodmode()toggles god mode while restoring stats.c_freecrafting()toggles access to all recipes.c_speedmult(multiplier)changes movement speed by the multiplier supplied.c_maintainhealth(ThePlayer),c_maintainsanity(ThePlayer),c_maintainhunger(ThePlayer),c_maintaintemperature(ThePlayer), andc_maintainmoisture(ThePlayer)continuously maintain the selected stat.c_cancelmaintaintasks(ThePlayer)cancels the continuous maintenance tasks.
Maintenance commands continue doing work until they are canceled or their context is reset. If you are testing a mechanic, record which toggles you enabled so you can reverse them deliberately rather than leaving a hidden advantage in a public world.
How do I change seasons, weather, or entities?
World events should be treated as server-wide operations. Run them remotely, announce disruptive changes, and save before experimenting with commands that remove or alter entities.
TheWorld:PushEvent("ms_setseason", "autumn|winter|spring|summer")sets the current season to one of the listed values.TheWorld:PushEvent("ms_forceprecipitation")starts rain; passfalseto stop it.TheWorld:PushEvent("ms_sendlightningstrike", ConsoleWorldPosition())calls lightning at the cursor position.TheWorld:PushEvent("ms_setseasonlength", {season="summer", length=15})sets a season length; the example sets summer to 15.ConsoleWorldEntityUnderMouse():Remove()removes the entity under the cursor in local execution.
The reference also includes commands for map revealing, meteors, rifts, and prefab cleanup. Those operations can damage or destabilize a world, so make a backup before trying an advanced command. The cursor-targeted remove form is specifically local; do not assume that a local selection command has changed the dedicated server’s copy.
How do I save, roll back, or shut down a DST server?
Use maintenance commands in a predictable order: announce the operation, save when a recoverable point is needed, then perform the change. Rollback and regeneration are not interchangeable; rollback rewinds saves, while regeneration destroys the existing world state for practical purposes.
| Maintenance goal | Command | Result and risk |
|---|---|---|
| Force a save | c_save() |
Immediately writes the current world state. |
| Rewind saves | c_rollback(count) |
Rolls back by the specified number of saves; without an argument, rolls back one save. |
| Save and stop | c_shutdown(true) |
Saves, then shuts down the server. |
| Stop without saving | c_shutdown(false) |
Exits without writing the current state. |
| Warn players | c_announce("Restarting in five minutes") |
Sends a maintenance announcement to everyone currently connected. |
| Stop new joins | TheNet:SetAllowIncomingConnections(false) |
Temporarily blocks incoming connections; use true to allow them again. |
| Reload without saving | c_reset() |
Reloads the world without saving; the reference warns that it can crash clients. |
A safe rollback sequence
- Run
c_announce("Rolling back after the next save")or another clear notice. - Run
c_save()if you need a known recovery point, and record the intended rollback count. - Prevent new joins with
TheNet:SetAllowIncomingConnections(false)if players are still connecting. - Run
c_rollback(count)in Remote mode. - Allow joins again with
TheNet:SetAllowIncomingConnections(true)after checking the world.
Do not treat regeneration as an ordinary reset. Hosting-panel documentation describes regeneration as destroying existing world state, so consider it irreversible unless you have an independent backup.
How do Master and Caves shards change administration?
A two-level DST server is not one interchangeable process. The Master and Caves are separate dedicated-server shards, launched separately with the -cluster and -shard options. Each process reads its own server.ini under the cluster directory, so a command aimed at one shard does not automatically configure the other.
Shard administration checklist
- Identify whether the affected object or player is on Master or Caves.
- Confirm the launch process uses the intended cluster directory and shard name.
- Use the cluster’s
adminlist.txtfor the authorized Klei ID. - Target the console or hosting panel attached to the correct shard.
- Repeat configuration checks for the second shard rather than assuming its
server.inimatches.
| Dedicated-server figure | Klei documentation value | Qualification |
|---|---|---|
| Player limit | 1–64 | Named by Klei Entertainment in 2026 documentation. |
| UDP port range | 1024–65535 | Valid range named by Klei Entertainment in 2026 documentation. |
| Tick rate | 15–60 updates per second | Klei lists 15 updates per second as the recommended rate in 2026 documentation. |
Klei’s dedicated-server guidance warns that command-line use is at the operator’s own risk. Keep the Master and Caves launch commands, configuration paths, and maintenance notes together so a restart does not accidentally bring up only one shard.
Why do my commands work locally but not on the server?
Local execution is the most common explanation: the console accepted the command, but it ran against your client context. Work through these checks in order.
- Verify authorization. Confirm your exact
KU_XXXXXXXXID is in theadminlist.txtbelonging to the active cluster. An ID in another cluster’s file does not authorize this server. - Switch to Remote. Open the console and use Ctrl to change from Local before running a shared-world command.
- Check the shard. On a Master-and-Caves setup, make sure you are connected to the process that owns the world or player you are trying to change.
- Refresh the command state. Many commands must be re-entered after the world loads. A restart can leave the console open while clearing earlier toggles.
- Validate the argument. Run
c_listallplayers()again for a current index or Klei ID, and check prefab spelling for item commands. - Check file access. If the server cannot read or write its files, verify permissions on the Klei configuration directory and the dedicated-server executable paths documented by Klei.
- Protect the world. Save before rollback, removal, reset, or regeneration, and announce planned maintenance so players stop acting during the change.
Symptoms and likely causes
| Symptom | Likely cause | First corrective action |
|---|---|---|
| Only your character changes | Console is in Local mode. | Switch to Remote and repeat the command. |
| Kick or ban finds no target | Stale index or incorrect Klei ID. | Run c_listallplayers() and copy the current ID. |
| Master changes but Caves does not | Separate shard process or configuration. | Target the Caves launch process and its server.ini. |
| Save or rollback fails | File permissions or wrong server process. | Check Klei directory access and the active shard paths. |
| Players lose progress after maintenance | Shutdown without saving or destructive regeneration. | Use c_shutdown(true) when saving is required and keep backups before regeneration. |
Which command approach is safest for a live server?
Choose commands by who they affect and whether the result can be reversed. This makes it easier to decide whether to run immediately, announce first, or take a backup.
| Decision axis | Lower-risk pattern | Higher-risk pattern |
|---|---|---|
| Execution scope | Local action for a client-only test. | Remote action that changes the shared world. |
| Target | One identified player or inventory. | World-wide season, weather, cleanup, or shard operation. |
| Reversibility | Announcement, kick, temporary ban, or save. | Rollback, entity removal, reset, or regeneration. |
| Server topology | Single-shard administration. | Coordinated Master-and-Caves administration. |
For routine moderation, list players, copy the ID, and use the narrowest command that solves the problem. For world editing, announce the change and create a recovery point first. For a multi-shard server, document which process you changed so a later restart does not undo or misapply the fix.
Frequently Asked Questions
What does the seconds value in BanForTime mean?
The second argument is a duration in seconds, not a clock time or a date. Convert the intended suspension period before entering the command, and use a permanent ban only when a temporary restriction is not sufficient.
Can I use a player name instead of a Klei ID?
The moderation calls are ID-based. Run c_listallplayers(), match the displayed name to the corresponding Klei ID, and pass that ID as the quoted userid argument.
Does a rollback create a backup I can keep indefinitely?
Rollback selects an earlier save; it is not a substitute for an independent backup of the cluster files. Save deliberately before maintenance and preserve a copy before any operation that can remove or regenerate world data.
Why are my god-mode or stat commands gone after a restart?
Many console changes are session operations and must be entered again after the world loads. Keep a short, agreed list of enabled toggles and reapply only those the group has approved.