How to Kick and Ban Players on a Valheim Server
There are two ways to remove someone from a Valheim server, and you want both. The fast one is
the in-game console: if you’re on the server’s admin list and have the console enabled, kick
removes a player immediately and ban blocks them from coming back. The durable one is editing
bannedlist.txt on the server, which works whether or not anyone is online and survives
restarts unambiguously. Neither undoes the damage a griefer already did — that’s what backups
are for.
Prerequisites: be an admin, have a console
Admin rights come from adminlist.txt in the server’s Valheim data directory — one
SteamID64 per line. Without an entry there, the moderation commands do nothing for you.
The console is a client-side setting. Add the console launch option to Valheim in Steam (right-click the game → Properties → Launch Options) and open it in-game with F5. This is about your client, not the server, and it’s easy to forget after reinstalling.
Setup detail is in Essential Valheim Admin Commands and Automated Backups.
Kicking someone
A kick disconnects a player without preventing them from rejoining. It’s the right tool for “you’re being annoying, take a break” or for clearing a stuck connection:
kick <player>
Identify the player by name or by ID. Prefer the ID. Names can contain spaces, unusual characters, or look-alike glyphs, and a name-based kick that silently matches nothing is indistinguishable from one that worked. If a kick appears to do nothing, that’s usually why.
A kicked player can walk straight back in. If you want them gone, ban.
Banning from the console
ban <player>
This kicks and blocks. To reverse it:
unban <id>
And to see who’s currently blocked:
banned
Run banned after any ban to confirm the entry landed, and after any unban to confirm it’s
gone. It’s the only feedback loop you get, and it catches the case where a name-based command
matched nothing.
If you’re unsure which commands your build supports, type help in the console — it prints the
list the server actually accepts, which is more reliable than any article, including this one.
Banning by file
The console needs you in-game. The file doesn’t. bannedlist.txt sits next to the other
permission files:
Windows: %USERPROFILE%\AppData\LocalLow\IronGate\Valheim\bannedlist.txt
Linux: ~/.config/unity3d/IronGate/Valheim/bannedlist.txt
Docker: <your config mount>/bannedlist.txt
One SteamID64 per line:
76561198000000009
Add the ID, then restart the server to be certain it’s loaded. Removing a line and restarting is the file-based unban.
Be careful about editing while the server runs. If the server rewrites the file when a ban happens through the console, your hand-edit can be overwritten, or you can clobber a console-issued ban. Pick one channel per session: either do it in the console, or stop the server and edit the file. Don’t interleave them.
Getting the right ID
Bans are only as good as the ID. Sources, best first:
- The server log at the moment they connected. Definitive, and it ties the ID to the name
you saw. On systemd,
journalctl -u valheim | grep -i steam; in Docker,docker compose logs valheim. - A SteamID lookup tool, using their profile URL. Take the 17-digit 64-bit value.
- Asking another player who has them on their friends list.
Don’t ban on a display name alone if you can avoid it — names are changeable and not unique, which makes a name-based ban trivially easy to evade and easy to misapply to the wrong person.
What a ban can’t do
Be realistic about the limits:
- A determined stranger can return on a new account. A ban stops nuisances, not determination.
- It doesn’t repair the world. Torn-down builds and emptied chests stay torn down and empty. Roll back from a backup if the damage is real: How to Restore a Valheim World From a Backup.
- It doesn’t remove their character’s stuff or structures from the world.
- It doesn’t stop connection attempts, just successful joins.
If you had a griefing incident, the ban is step one of three: ban, restore from backup, then close the door properly.
Closing the door properly
Reactive bans are a treadmill. If uninvited people are finding your server at all, fix the cause instead:
- Stop advertising it. An unlisted server doesn’t appear in the community browser, so nobody stumbles onto it.
- Change the password, especially if it’s been in a screenshot or a public message: How to Change a Valheim Server’s Name and Password.
- Switch to an allow-list. With entries in
permittedlist.txt, only listed players can join and the ban list stops mattering: How to Whitelist Players on a Valheim Server.
For a friend-group server, the allow-list is the end of the problem rather than a mitigation of it.
Handling it well socially
Most “moderation” on a small server isn’t strangers, it’s a friend-of-a-friend who doesn’t share the group’s norms. Some things that help more than commands:
- Agree the rules before inviting people — building near others, taking from communal chests, whether cheat commands are acceptable.
- Talk first, kick second. A kick is a blunt instrument and it’s remembered.
- Take a backup before inviting anyone new. Cheap, and it turns a potential disaster into an inconvenience.
- Keep more than one admin. If you’re the only admin and you’re asleep, nobody can act.
Quick reference
| Goal | Console | File |
|---|---|---|
| Remove now, allow return | kick <player> |
— |
| Remove and block | ban <player> |
add ID to bannedlist.txt |
| Reverse a block | unban <id> |
remove the line |
| See the block list | banned |
read the file |
Confirm every action with banned, prefer IDs to names, and remember that the real fix for
repeat trouble is the allow-list, not a longer ban list.