01
Become an admin with adminlist.txt
Permissions go through three optional text files, stored in the cluster folder next to cluster.ini (for example ~/.klei/DoNotStarveTogether/MyDediServer):
adminlist.txt: the admins;
whitelist.txt: players with a reserved slot (the whitelist_slots setting in cluster.ini);
blocklist.txt: banned players.
All three use the same format: one player ID per line. On an online server, this is the Klei account ID, in the form KU_ followed by letters, digits or underscores. On an offline server, it takes the form OU_ followed by digits.
Without adminlist.txt, or with an empty file, the only admin of an online server is the account that created the cluster token. An offline server then has no admin at all.
The easiest way to find a player's ID is the server log: a line like this one appears at each connection.
[00:00:20]: [Shard] Read save location file for (KU_XXXXXXXX)
Add the line to the file as the server user, then restart the server so it reads the list again:
sudo -iu dst
nano ~/.klei/DoNotStarveTogether/MyDediServer/adminlist.txt
These paths and the dst user come from the guide creating a Don't Starve Together server; adapt them to your setup. The change is made over SSH, see connecting to a VPS over SSH.
02
Where to type commands
Don't Starve Together commands are Lua calls: you type the parentheses, and text goes between quotes. There are three places to send them from.
The server console. With the -console option, which Klei's script already adds, the server window accepts Lua with full rights. In the setup from the creation guide, the screen session gives you the forest console (the Master world):
sudo -iu dst
screen -r dst
c_save()
Leave the session without stopping the server with Ctrl+A then D. The caves, started in the background by the script, have no keyboard-accessible console in this setup.
The in-game console. A connected admin opens it with the ~ key (ù on an AZERTY keyboard). By default, a command runs on your own game: press Ctrl with the console open to switch to remote mode and send it to the server. This is required for server commands, and the command then applies to the world you are in.
Chat commands. The game also has commands starting with a slash, which also appear in the game's menus:
/kick (or /boot) followed by a player: kicks them;
/ban followed by a player, and optionally a duration in seconds: bans them, permanently or for that duration;
/rollback, with an optional number of saves, and /regenerate: roll back or recreate the world, with a confirmation prompt;
/stopvote (or /veto): cancels the current vote.
If votes are enabled, other players can put a kick, a rollback or a regeneration to a vote. A Klei developer explains on the official forums how to turn them off: the line vote_enabled = false in the [GAMEPLAY] section of cluster.ini, then a restart.
03
Save, roll back, warn players
The game management commands, according to the game wiki and the comments in Klei's command file:
c_save(): saves the game right away. The server already saves on its own at the end of each night.
c_shutdown(): saves, then stops the server. c_shutdown(false) stops it without saving.
c_reset(): reloads the world from the last save, without saving what happened since.
c_rollback(1): goes back to the last save; c_rollback(3) goes back three saves, within the snapshots kept (the max_snapshots setting). In game, it only works in remote mode.
c_announce("message"): shows an announcement to all players, for example before a restart. c_announce("message", 600) repeats it every 600 seconds, and c_announce() stops the repetition.
TheNet:SetAllowIncomingConnections(false): refuses new connections, for example during maintenance; set it back to true afterwards.
A clean maintenance looks like this, in the forest console:
c_announce("Server restart in 5 minutes")
c_save()
c_shutdown()
Before a rollback, keep a copy of the cluster folder outside the VPS: the archiving method is in the creation guide, and a daily copy can be scheduled with a scheduled task.
04
List, kick and ban players
Two commands list players:
c_listallplayers(): the players in the world, with their number, ID, name and character, in the form [2] (KU_AABBCCDD) Player2 <wolfgang>;
c_listplayers(): the connected players, with an asterisk in front of admins.
The output appears in the server console. With the ID you got:
TheNet:Kick("KU_AABBCCDD")
TheNet:Ban("KU_AABBCCDD")
TheNet:BanForTime("KU_AABBCCDD", 3600)
TheNet:Kick: kicks the player, who can come back;
TheNet:Ban: bans them;
TheNet:BanForTime: bans them for a duration in seconds, here one hour. The wiki advises typing this command on both worlds, forest and caves.
You can also target a player by number, with AllPlayers[2].userid instead of the ID. Banning by ID is still safer: the number changes from one connection to the next.
The cluster's blocklist.txt file lists banned players, one ID per line. To lift a ban, stop the server, remove the player's line, then start it again.
05
Forest, caves and world regeneration
A server with caves is a cluster of two worlds, called shards: the forest (Master), which is the main world, and the caves (Caves). Each is a separate process, with its own console. A command acts on the world where it is typed: the server console for the forest in the guide's setup, the in-game console in remote mode for the world the admin is in.
Two commands recreate the world. They erase the game for good, with no confirmation prompt:
c_regenerateworld(): deletes all worlds in the cluster and generates new ones. According to Klei's comment, it does not work properly if one of the worlds is stopped or loading: run it while both the forest and the caves are running.
c_regenerateshard(): only recreates the world where it is typed. Klei advises against using it instead of c_regenerateworld(), unless you really need to regenerate a single world.
Before either one, stop the server and archive the cluster folder.
Cheat commands (c_godmode(), c_spawn(), c_give()…) also work for an admin in remote mode: keep admin rights to a few accounts. Other games have their own logic, see Valheim admin commands.
06
On CloudFive
CloudFive has no ready-made Don't Starve Together plan: the server is installed on a VPS, and you run it as described in this guide. The Ryzen VPS, from €5.99 per month, is a good fit:
- an AMD Ryzen 9 9950X, with DDR5 memory and NVMe storage, to run the forest and the caves side by side;
- a Linux container (LXC) with root access and a dedicated IPv4 address;
- basic DDoS protection included (see protecting a game server against DDoS).
The servers are in France, billed monthly with no commitment, with support in French 7 days a week by tickets and on Discord. To choose the VPS size, see which VPS for a game server; for the ports to open, game server ports.
07
Frequently asked questions
How do I become an admin on a Don't Starve Together server?
Write your Klei ID, in the form KU_ followed by characters, in the adminlist.txt file of the cluster folder, next to cluster.ini, one ID per line, then restart the server. Without this file, only the account that created the cluster token is an admin.
How do I find a player's KU_ ID?
The server log shows it at each connection, in a line ending with (KU_…). In the console, c_listallplayers() also shows the number, ID, name and character of each player in the world.
How do I type an admin command from the game?
Open the console with the ~ key (ù on an AZERTY keyboard), then press Ctrl to switch to remote mode: the command is then sent to the server, on the world you are in. Without remote mode, most server commands do nothing.
How do I roll back a Don't Starve Together server?
Type c_rollback(1) to go back to the last save, or a larger number to go further back, within the snapshots kept (max_snapshots). In game, the command only works in remote mode; an admin can also use /rollback in the chat.
How do I ban a player on Don't Starve Together?
Type TheNet:Ban("KU_…") with the player's ID, or TheNet:BanForTime("KU_…", 3600) for a one-hour ban, to be typed on both the forest and the caves. Banned players are listed in blocklist.txt, in the cluster folder.