# How to Set Up a Whitelist on Your Project Zomboid Server (/docs/project-zomboid/whitelist)



A whitelist restricts your server to pre-approved players only. This is ideal for private communities, roleplay servers, or events.

Enable the Whitelist [#enable-the-whitelist]

<div className="fd-steps">
  <div className="fd-step">
    Open your server config [#1-open-your-server-config]

    On XGamingServer, go to **Files** and open:

    ```
    Zomboid/Server/[servername].ini
    ```
  </div>

  <div className="fd-step">
    Set the server to closed [#2-set-the-server-to-closed]

    ```ini title="[servername].ini"
    Open=false
    ```

    When `Open` is set to `false`, only whitelisted players can join.
  </div>

  <div className="fd-step">
    Configure whitelist behavior [#3-configure-whitelist-behavior]

    ```ini title="[servername].ini"
    AutoCreateUserInWhiteList=false
    DropOffWhiteListAfterDeath=false
    ```

    | Setting                      | Default | Description                                              |
    | ---------------------------- | ------- | -------------------------------------------------------- |
    | `Open`                       | true    | `false` = whitelist mode, only approved players can join |
    | `AutoCreateUserInWhiteList`  | false   | Automatically add new accounts to the whitelist          |
    | `DropOffWhiteListAfterDeath` | false   | Remove players from whitelist when their character dies  |
  </div>

  <div className="fd-step">
    Restart your server [#4-restart-your-server]
  </div>
</div>

Add Players to the Whitelist [#add-players-to-the-whitelist]

Via Admin Command [#via-admin-command]

While logged in as admin, use:

```
/adduser "PlayerName" "password"
```

This creates an account and adds the player to the whitelist.

Via Server Files [#via-server-files]

Navigate to `Zomboid/Server/[servername]_whitelist.txt` and add player names, one per line.

Remove Players from the Whitelist [#remove-players-from-the-whitelist]

Via Admin Command [#via-admin-command-1]

```
/removeuserfromwhitelist "PlayerName"
```

Via Server Files [#via-server-files-1]

Edit `[servername]_whitelist.txt` and remove the player's name.

Whitelist with Death Consequences [#whitelist-with-death-consequences]

For hardcore servers, enable `DropOffWhiteListAfterDeath`:

```ini
Open=false
DropOffWhiteListAfterDeath=true
```

When a player's character dies, they're removed from the whitelist and can't rejoin until an admin re-adds them.

Related Guides [#related-guides]

See also: [Set a Password](/docs/project-zomboid/server-password) | [Become a Server Admin](/docs/project-zomboid/become-admin) | [Ban and Unban Players](/docs/project-zomboid/ban-players)

If you need help, join our [Discord](https://discord.xgamingserver.com/).
