Don't Starve Together Admin Console Commands Reference

Complete admin console command reference for Don't Starve Together — c_save, c_rollback, c_spawn, c_give, c_shutdown, kick, ban, and more.

Once you're an admin on a Don't Starve Together server, the in-game console (~) gives you a Lua REPL with access to the entire game state. This page is the complete reference for the day-to-day admin commands you actually need: rolling back grief, force-saving, spawning items, kicking, banning, and shutting down cleanly.

Prerequisites

Before any of this works:

  1. Your Klei ID (KU_xxxxxxxx) must be in Cluster_1/adminlist.txt — see Adding Admins
  2. cluster.ini must have console_enabled = true under [MISC]
  3. You must be connected to the server in-game

Opening the Console

Press the tilde key (~) to open the console. Type a command and press Enter.

By default commands run client-side only. To run a command on the server (which is what most admin actions need), press Ctrl+Enter instead — or toggle the "Remote" mode by clicking the icon at the top of the console.

Save & Rollback

The most-used commands. These are how you protect against grief.

CommandDescription
c_save()Force a save right now
c_rollback()Roll back to the most recent save
c_rollback(N)Roll back N snapshots (default max is 6)
c_reset()Reload the world from the last save (no rollback)

Workflow: before something risky (boss fight, mod test, big build), run c_save(). If it goes wrong, c_rollback(1).

Server Lifecycle

CommandDescription
c_shutdown()Save and shut the server down
c_shutdown(true)Same — saves before exiting
c_shutdown(false)Shut down without saving (use only if save is corrupted)
c_announce("message")Broadcast a message to all players
c_regenerateworld()Wipes the current world and generates a new one. No undo.
c_regenerateshard()Regenerate just the current shard (Master or Caves)

Spawning Items & Creatures

CommandDescription
c_spawn("prefab")Spawn a single entity at your cursor
c_spawn("prefab", N)Spawn N entities
c_give("prefab")Give yourself one item
c_give("prefab", N)Give yourself N items
c_give("prefab", N, AllPlayers[1])Give the item to a specific player by index

Examples:

c_give("log", 40)
c_give("twigs", 40)
c_give("rocks", 20)
c_spawn("deerclops")
c_spawn("pigman", 5)

The full prefab name list is on the DST wiki.

Player Management

CommandDescription
TheNet:GetClientTable()List every connected client (returns a Lua table)
TheNet:Kick("KU_xxx")Kick a player by Klei ID
TheNet:Ban("KU_xxx")Permanently ban a player by Klei ID
TheNet:GetUserID()Print your own Klei ID (run as a player to see your ID)
c_listplayers()Print the player list to the console (shorter alias)
c_kick(N)Kick the player at index N in the player list
c_ban(N)Ban the player at index N

c_kick(1) is faster than TheNet:Kick("KU_...") when you just want to boot the most-recently-joined player.

Time & Weather

CommandDescription
LongUpdate(N)Skip N seconds of game time forward
LongUpdate(480)Skip one in-game day
TheWorld:PushEvent("ms_setseason", "winter")Force change the season
TheWorld:PushEvent("ms_forceprecipitation", true)Start rain
TheWorld:PushEvent("ms_setphase", "night")Force night
c_godmode()Toggle godmode on yourself

Health, Sanity, Hunger

CommandDescription
ThePlayer.components.health:SetPercent(1)Heal yourself to full
ThePlayer.components.sanity:SetPercent(1)Restore sanity to full
ThePlayer.components.hunger:SetPercent(1)Fill hunger
c_godmode()All three at once + invincibility
c_supergodmode()Godmode + free crafting + revive on death

Useful One-Liners

-- Give every connected player 20 logs
for i,v in ipairs(AllPlayers) do v.components.inventory:GiveItem(SpawnPrefab("log"), 20) end

-- Set everyone's HP to full
for i,v in ipairs(AllPlayers) do v.components.health:SetPercent(1) end

-- Find your Klei ID
print(TheNet:GetUserID())

-- Print the player list
for i,v in ipairs(AllPlayers) do print(i, v.name, v.userid) end

Common Issues

ProblemCauseFix
"You don't have admin privileges"Not in adminlist.txt, or didn't restart after addingAdd yourself, restart
Commands have no effectRunning client-side, not server-sidePress Ctrl+Enter instead of Enter, or toggle Remote mode
c_rollback(N) rolls back fewer days than expectedDST keeps a max of 6 snapshots by defaultIncrease max_snapshots in cluster.ini [GAMEPLAY]
c_spawn("prefab") spawns nothingWrong prefab name (case-sensitive)Check the DST wiki
c_regenerateworld() regenerated everything you wanted to keepThere is no undo.Always back up before running this. See Backup & Restore

How is this guide?

40% Off — Limited TimeGet your Dont Starve Together server todayInstant setup, DDoS protection, and 24/7 support included.
Get a Server

On this page