# How to Ban and Kick Players on Your Valheim Server (/docs/valheim/ban-and-kick-players)



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

As a server admin, you can kick or ban players who break your rules. Kicks disconnect a player immediately while bans prevent them from reconnecting. Both can be done in-game or by editing files.

Kick a Player [#kick-a-player]

Kicked players are disconnected but can rejoin.

<Steps>
  <Step>
    Authenticate as admin [#authenticate-as-admin]

    Join the server, press **F5** to open the console (player must have `-console` in Steam launch options).
  </Step>

  <Step>
    Run the kick command [#run-the-kick-command]

    ```
    kick PlayerName
    ```

    Or by SteamID64:

    ```
    kick 76561198012345678
    ```
  </Step>
</Steps>

Ban a Player [#ban-a-player]

Banned players are disconnected and **cannot rejoin** until unbanned.

<Tabs items={['In-Game (Fastest)', 'Edit bannedlist.txt']}>
  <Tab value="In-Game (Fastest)">
    <Steps>
      <Step>
        Open the in-game console [#open-the-in-game-console]

        Press **F5** as an admin.
      </Step>

      <Step>
        Run the ban command [#run-the-ban-command]

        ```
        ban PlayerName
        ```

        Or by SteamID64:

        ```
        ban 76561198012345678
        ```

        The player is disconnected immediately and added to `bannedlist.txt`.
      </Step>
    </Steps>
  </Tab>

  <Tab value="Edit bannedlist.txt">
    <Steps>
      <Step>
        Stop the server [#stop-the-server]

        In the [XGamingServer Panel](https://panel.xgamingserver.com), go to **Console** and stop your server.
      </Step>

      <Step>
        Open bannedlist.txt [#open-bannedlisttxt]

        Click **Files** in the sidebar and open `bannedlist.txt` in the server root.
      </Step>

      <Step>
        Add SteamIDs [#add-steamids]

        One SteamID64 per line:

        ```
        76561198012345678
        76561198087654321
        ```
      </Step>

      <Step>
        Save and start [#save-and-start]

        Click **Save Content** and start the server from **Console**.
      </Step>
    </Steps>
  </Tab>
</Tabs>

Unban a Player [#unban-a-player]

<Tabs items={['In-Game', 'Edit File']}>
  <Tab value="In-Game">
    ```
    unban 76561198012345678
    ```
  </Tab>

  <Tab value="Edit File">
    Open `bannedlist.txt` in **Files** and delete the player's SteamID line. Save and restart.
  </Tab>
</Tabs>

View Banned Players [#view-banned-players]

In the in-game console:

```
banned
```

This lists all currently banned players with their SteamIDs.

Find a Player's SteamID [#find-a-players-steamid]

| Method                  | How                                                                                  |
| ----------------------- | ------------------------------------------------------------------------------------ |
| **Press F2 in-game**    | Shows all connected players with their SteamID64                                     |
| **steamid.io lookup**   | Enter the Steam profile URL at [steamid.io](https://steamid.io) and copy `steamID64` |
| **Server console logs** | When a player connects, their SteamID appears in the **Console** output              |

Dealing With Griefers [#dealing-with-griefers]

<Steps>
  <Step>
    Kick immediately [#kick-immediately]

    ```
    kick PlayerName
    ```
  </Step>

  <Step>
    Ban to prevent return [#ban-to-prevent-return]

    ```
    ban PlayerName
    ```
  </Step>

  <Step>
    Force a save [#force-a-save]

    Type `save` in the console to preserve the current state before any further damage.
  </Step>

  <Step>
    Restore if needed [#restore-if-needed]

    If the griefer caused damage, [restore from a backup](/docs/valheim/backup-restore).
  </Step>
</Steps>

> **Tip:** For a more secure server, set up a [whitelist](/docs/valheim/whitelist) so only approved players can join in the first place.

Related Guides [#related-guides]

* [Admin Setup](/docs/valheim/admin-setup)
* [Console Commands](/docs/valheim/console-commands)
* [Whitelist Setup](/docs/valheim/whitelist)
* [Backup & Restore](/docs/valheim/backup-restore)
