Admin rights come from a text file
Valheim has no admin password. Iron Gate's server guide describes three plain text files that decide who is who: adminlist.txt for admins, bannedlist.txt for banned players and permittedlist.txt for an allow list. Each holds one Platform User ID per line.
The files sit in the server's save path, next to the worlds folder. By default that is AppData/LocalLow/IronGate/Valheim inside the user folder on Windows and ~/.config/unity3d/IronGate/Valheim on Linux. If the server is started with -savedir, Iron Gate says that option moves both the worlds and the permission files, so look in the folder it names instead. On a rented server the files are reached through the file manager or SFTP, and how game server hosting works explains both.
Treat permittedlist.txt with care. Iron Gate warns that adding a person to it bans everyone else from the server, so leave it empty unless you really want an allow list, and add yourself and every friend first if you do.
- adminlist.txt: players who may use admin commands
- bannedlist.txt: players who may not join
- permittedlist.txt: when not empty, only these players may join
- Windows: %USERPROFILE%\AppData\LocalLow\IronGate\Valheim
- Linux: ~/.config/unity3d/IronGate/Valheim
Find your Platform User ID
Valheim identifies players by platform as well as account, because Steam, Xbox and other platforms can share a crossplay server. Iron Gate gives the format as [Platform]_[User ID] and stresses that it is case sensitive, so copy it exactly rather than typing it out.
There are two places to read it. In game, while connected to the server, the F2 panel shows the connected players with their IDs. On the server side, the server log records each connecting player's ID. Either way you get the full string in the right form, which is safer than building it from a Steam profile number yourself.
- In game: press F2 while on the server
- Server side: read the server log when the player connects
- Copy the whole [Platform]_[User ID] string, capitals included
Make yourself admin, step by step
The order is simple, and the one mistake to avoid is a stray character. The community wiki warns that each line is read as a whole, so a space or a comment on the same line as an ID stops it matching.
The console has to be switched on in your own game too. Since patch 0.221.4 the developer console is disabled by default and is turned on with an option in the game's settings menu, and the -console launch argument still works and overrides that setting.
- Join the server once and copy your ID from the F2 panel or the server log
- Stop the server
- Open adminlist.txt in the save path and put your ID on a line of its own
- Save the file with nothing else on that line
- Start the server and join
- Turn on the developer console in your game's settings, or launch with -console
- Press F5 and type help to see what is available
The admin commands
Iron Gate's guide lists four admin commands for the F5 console: Kick, Ban, Unban and Banned. The community wiki adds that kick, ban and unban accept a player name, an IP address or a user ID. A ban by ID is the safest, because names can change and two players can share one. You can also ban by adding an ID to bannedlist.txt with the server stopped.
A few more admin commands came later. Patch 0.214.300 made the manual save command callable on a dedicated server by anyone on the admin list, which is the command to run before a backup or a risky change. Patch 0.217.38 fixed kicking from the player list on dedicated servers, so admins can also kick from there.
- kick <name, IP or ID>: removes a player, who can rejoin
- ban <name, IP or ID>: bans a player
- unban <name, IP or ID>: lifts a ban
- banned: lists everyone who is banned
- save: saves the world now, for admins on a dedicated server
World modifiers and the other admin commands
Patch 0.217.22 made a longer list of console commands available to admins: setworldpreset, resetworldkeys, setworldmodifier, players, setkey, removekey, resetkeys, listkeys, sleep, skiptime, restartparty and genloc. Iron Gate notes that listkeys displays its list on a dedicated server, and warns that genloc takes time and may cause disconnects, so run it when few people are online.
The world modifier commands are the ones most servers use. They change difficulty, death penalty, raids and portals on a running world without editing the start line. Our world modifiers guide explains each preset and value, and the Valheim server settings generator writes the start line for a server you set up from scratch.
Take a copy of the world before changing modifiers or running genloc. The server keeps automatic backups, and our guide to moving a world explains where they sit and the backup options you can set on the start line.
- setworldpreset and setworldmodifier: change world modifiers
- setkey, removekey, resetkeys and listkeys: manage world keys
- resetworldkeys: reset the world modifiers to default
- genloc: places missing locations, takes time and may disconnect players
What admin does not give you
Admin on a dedicated server is a moderation role, not a cheat switch. The community Valheim wiki states that admin rights allow only the admin console commands, such as kick and ban, and not cheats or debug mode. It also notes that devcommands, the switch for cheat commands such as god mode and flying, only works in singleplayer or in a game hosted from the menu, and not on a dedicated server.
If a command refuses to run, check three things in order: that the console is enabled in your game, that your ID in adminlist.txt matches the F2 panel exactly, and that the server was restarted after you saved the file. For BepInEx mods that add their own admin tools, see our Valheim mods and RAM guide. The Valheim game page shows the plan a dedicated world runs on.