Essential Valheim Admin Commands and Automated Backups
Once your Valheim dedicated server is running, two jobs keep it healthy: managing who’s on it, and making sure a crash or a bad night never wipes your world. Both are straightforward once you know where the files live and which commands matter. This guide covers granting admin rights, the console commands you’ll actually use, and a backup routine you can set and forget.
Granting admin rights
Server permissions live in three plain-text files in your Valheim data folder — the same
folder that holds worlds_local:
adminlist.txt— players with admin powers (kick, ban, and console commands).permittedlist.txt— an allow-list; if it has any entries, only those players may join.bannedlist.txt— players who are blocked.
Each file takes one SteamID64 per line. A SteamID64 is the 17-digit number you can find by pasting a player’s profile URL into a “SteamID” lookup site, or from the server log when they connect. Add the IDs, one per line:
76561198000000001
76561198000000002
Changes to these files are picked up without reinstalling anything; a server restart
guarantees they load. On the Docker setup, these same files live in your mounted config
folder.
Using the console
To run commands, a player needs the developer console enabled on their client. Add
-console to Valheim’s launch options in Steam (right-click the game → Properties →
Launch Options). In-game, press F5 to open the console.
If you’re on the server’s admin list, these commands work:
help— lists available commands.kick [name/ID]— removes a player from the server.ban [name/ID]— kicks and blocks a player (also editable viabannedlist.txt).unban [ID]— reverses a ban.banned— prints the current ban list.ping— shows your latency to the server, handy for diagnosing lag complaints.save— forces the server to write the world to disk immediately. Run this before any planned restart or maintenance.info— prints performance stats like FPS/draw calls, useful when chasing lag.
Cheat commands (use with care)
Admins can also enable the developer/cheat commands by typing devcommands in the
console. That unlocks things like god (invincibility), fly, ghost (mobs ignore you),
and item spawning. These are great for testing or rebuilding after a disaster, but they
change the feel of the game — agree as a group before using them on a shared world, and
turn them back off with devcommands again.
Why backups matter here
Valheim keeps two files per world in worlds_local:
<World>.db— the actual world data.<World>.fwl— the world’s metadata and seed.
The server also keeps .db.old and .fwl.old rollback copies from the previous save, so
a single corrupt write usually isn’t fatal. But that safety net doesn’t survive a failed
disk, a bad mod update, or an accidental rm. Real backups are separate, dated copies
kept somewhere the server can’t clobber.
Automating backups on Linux
The simplest reliable approach is a small script plus cron. Create ~/valheim-backup.sh:
#!/usr/bin/env bash
set -euo pipefail
WORLDS="$HOME/.config/unity3d/IronGate/Valheim/worlds_local"
DEST="$HOME/valheim-backups"
STAMP=$(date +%Y%m%d-%H%M%S)
mkdir -p "$DEST"
tar czf "$DEST/valheim-$STAMP.tar.gz" -C "$WORLDS" .
# keep only the 14 most recent archives
ls -1t "$DEST"/valheim-*.tar.gz | tail -n +15 | xargs -r rm --
Make it executable and schedule it every few hours with crontab -e:
0 */4 * * * /home/youruser/valheim-backup.sh
That path (~/.config/unity3d/IronGate/Valheim/) is the default Valheim data location on
Linux. If you run the Docker image with BACKUPS: "true", the container already produces
scheduled archives under config/backups — in that case, point this script at that folder
just to copy them off the machine.
Automating backups on Windows
On Windows the world files sit in
%USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worlds_local. A tiny PowerShell script
does the same job:
$worlds = "$env:USERPROFILE\AppData\LocalLow\IronGate\Valheim\worlds_local"
$dest = "$env:USERPROFILE\valheim-backups"
$stamp = Get-Date -Format "yyyyMMdd-HHmmss"
New-Item -ItemType Directory -Force -Path $dest | Out-Null
Compress-Archive -Path "$worlds\*" -DestinationPath "$dest\valheim-$stamp.zip"
Schedule it with Task Scheduler to run every few hours. As on Linux, add a step that prunes old archives so backups don’t fill the disk.
Get the copies off the box
A backup on the same machine only protects you from software mistakes, not hardware
failure. Once you have dated archives, sync them somewhere else — another computer, a NAS,
or cloud storage — on a nightly schedule. A one-line rsync or a cloud CLI in the same
cron job is enough:
0 5 * * * rsync -a ~/valheim-backups/ user@nas:/backups/valheim/
Restoring a world
When you need a backup, do it with the server stopped so nothing overwrites your work:
- Stop the server (or
docker compose down). - Extract the archive and copy the
<World>.dband<World>.fwlfiles intoworlds_local, replacing the current pair. - Start the server and confirm the world loads with recent progress intact.
Between a short admin list, the handful of console commands above, and a backup job you never have to think about, your server runs itself — and the worst-case “we lost the world” scenario simply stops being possible.