# How to Ban and Whitelist Players on Your Don't Starve Together Server (/docs/dont-starve-together/ban-whitelist)



import { Step, Steps } from 'fumadocs-ui/components/steps';

Don't Starve Together has two separate player-control files alongside `adminlist.txt`:

* **`blocklist.txt`** — players who can never join (the ban list)
* **`whitelist.txt`** — players who get a reserved slot even when the server is full

Both live in the cluster directory and use one Klei User ID per line.

File Locations [#file-locations]

```
DoNotStarveTogether/Cluster_1/blocklist.txt
DoNotStarveTogether/Cluster_1/whitelist.txt
DoNotStarveTogether/Cluster_1/adminlist.txt
```

If a file doesn't exist, create it. They're plain text — one `KU_xxxxxxxx` ID per line, no commas, no quotes.

Ban a Player (blocklist.txt) [#ban-a-player-blocklisttxt]

From In-Game (Easiest) [#from-in-game-easiest]

If you're an admin, the in-game console handles banning automatically — and the result is written to `blocklist.txt` for you.

```lua
TheNet:Ban("KU_xxxxxxxx")
```

Or by player list index:

```lua
c_ban(1)
```

The player is kicked immediately and their Klei ID gets appended to `blocklist.txt`. They can never reconnect.

Manually via blocklist.txt [#manually-via-blocklisttxt]

<Steps>
  <Step>
    Stop the server from **Console**.
  </Step>

  <Step>
    In **Files**, navigate to `DoNotStarveTogether/Cluster_1/`. Open `blocklist.txt` (create if missing).
  </Step>

  <Step>
    Add one Klei ID per line:

    ```
    KU_xxxxxxxx
    KU_yyyyyyyy
    ```
  </Step>

  <Step>
    Save and start the server. Listed players are blocked from connecting.
  </Step>
</Steps>

Unban a Player [#unban-a-player]

Stop the server, remove the Klei ID line from `blocklist.txt`, and restart. The player can now reconnect.

Whitelist a Player (whitelist.txt) [#whitelist-a-player-whitelisttxt]

The whitelist **does not restrict who can join** by itself — it **reserves a slot** for listed players. If your server is full and a whitelisted player tries to join, the most recently joined non-whitelisted player gets booted to make room.

Add to Whitelist [#add-to-whitelist]

<Steps>
  <Step>
    Stop the server.
  </Step>

  <Step>
    Open `DoNotStarveTogether/Cluster_1/whitelist.txt` (create if missing). Add one Klei ID per line:

    ```
    KU_aaaaaaa1
    KU_bbbbbbb2
    ```
  </Step>

  <Step>
    Save and start the server.
  </Step>
</Steps>

The listed players now bypass the player count cap.

Whitelist-Only Server (Closed Group) [#whitelist-only-server-closed-group]

To make your server **only** accept whitelisted players (a closed friends-only server), set a cluster password instead — that's the supported pattern. There is no native "whitelist-only" mode without a password.

For a fully invite-only server:

1. Set a `cluster_password` in `cluster.ini` (or use the Startup tab)
2. Share the password only with people you want
3. Use `whitelist.txt` to reserve their slots so they can always get in

Find a Player's Klei ID [#find-a-players-klei-id]

Players can find their own ID by opening the in-game console and typing:

```lua
TheNet:GetUserID()
```

Admins can list all connected players' IDs with:

```lua
for i,v in ipairs(AllPlayers) do print(i, v.name, v.userid) end
```

The output looks like:

```
1  PlayerName  KU_xxxxxxxx
2  OtherName   KU_yyyyyyyy
```

Files Summary [#files-summary]

| File            | Purpose                | Effect                            |
| --------------- | ---------------------- | --------------------------------- |
| `adminlist.txt` | Grant admin privileges | Listed IDs can use admin commands |
| `blocklist.txt` | Ban list               | Listed IDs cannot connect         |
| `whitelist.txt` | Slot reservation       | Listed IDs bypass full-server cap |

Related Guides [#related-guides]

* [Adding Admins](/docs/dont-starve-together/adding-admins)
* [Admin Commands](/docs/dont-starve-together/admin-commands)
* [Set a Password](/docs/dont-starve-together/set-a-password)
* [Configure Your Server](/docs/dont-starve-together/configure-your-server)
