
17 launch arguments · 10 players · Valheim 1.0.17
Dedicated server
The server reads 17 arguments. With none it loads the world Dedicated on port 2456, public, keeping 4 auto backups and saving every 30 min. Up to 10 players.
-name "My server" -world "Dedicated" -port 2456 -password "secret1" -crossplayLaunch arguments
| Argument | Default | What it does |
|---|---|---|
-world <name> | Dedicated | The world to load; the server creates it if there is no world by that name. |
-name <name> | the world's name | The server's name in the server list. |
-port <number> | 2456 | The port the server listens on (Steam and crossplay). |
-password <text> | — | Required to join. A public server refuses to start unless it has at least 5 characters and isn't part of the world's name or seed. |
-savedir <folder> | the game's save folder | Where worlds, backups and the admin, ban and permitted lists are kept. |
-public 1 or 0 | 1 | 1 makes the server public; 0 doesn't. Only a public server checks the password rule. |
-logfile <file> | — | The log file; the server notes it in the log. |
-crossplay | — | Runs the server on the crossplay backend (PlayFab) instead of Steam; it gets a six-digit join code. |
-instanceid <id> | — | Stored at start-up; nothing else in the game's code reads it. |
-backups <number> | 4 | How many automatic backups to keep; 0 or 1 turns them off. |
-backupshort <seconds> | 7200 (2 h) | How old the newest backup must be before another is made (at least 5). |
-backuplong <seconds> | 43200 (12 h) | How old the second backup must be before the oldest is dropped; younger, and the newest is replaced instead (at least 5). |
-saveinterval <seconds> | 1800 (30 min) | How often the world saves (at least 5). |
-resetmodifiers | — | Clears the world's modifiers back to normal. |
-preset <preset> | — | Applies a world modifier preset: easy, hard, hardcore, casual, hammer, immersive. |
-modifier <modifier> <option> | — | Sets one modifier: combat veryeasy|easy|default|hard|veryhard; deathpenalty casual|veryeasy|easy|default|hard|hardcore; resources muchless|less|default|more|muchmore|most; raids none|muchless|less|default|more|muchmore; portals casual|default|hard|veryhard. |
-setkey <key> | — | Adds a world key, e.g. nomap or playerdamage 150. |
Difficulty on a server: the same presets and modifiers as the menu — world modifiers.
Admins, bans and the whitelist
Admins
adminlist.txtPlayers who may run admin commands.
Banned
bannedlist.txtChecked every 5 s; anyone on it is kicked.
Permitted
permittedlist.txtIf it lists anyone, every player not on it is kicked.
One player ID per line, in the server's save folder. For Steam players the plain Steam ID matches.
ban | [name/ip/userID] - ban user |
banned | list banned users |
kick | [name/ip/userID] - kick user |
optterrain | optimize old terrain modifications |
save | force saving of world and resets world save interval |
unban | [ip/userID] - unban user |
Console commands that work over the network without cheats. All of them: console commands.
Where worlds are saved
Save folder: %USERPROFILE%\AppData\LocalLow\IronGate\Valheim on Windows (Unity's data folder for IronGate/Valheim), or the one -savedir names.
worlds_local— worlds on this computer (worldsfor Steam Cloud saves)characters_local— characters, one.fchfile each- Each world is a folder,
worlds_local/<world>/, holding_main.<n>files (.fwl2, .db2, .chunks, .ok) and.chunkfiles; worlds saved by older versions are<world>.fwl + <world>.db
Auto backups
Backups are named <world>_backup_auto-yyyyMMdd-HHmmss. A dedicated server keeps 4 (the game itself 2). None is made in the first 20 min of a session; after that, at each save:
- nothing, while the newest backup is younger than 2 h (-backupshort);
- otherwise, if the second-newest is younger than 12 h (-backuplong), the newest is replaced;
- otherwise a new one is added, dropping the oldest once there are 4.
So you always keep one recent backup and older ones about 12 h apart.
Questions
›What port does a Valheim dedicated server use?
2456 unless -port sets another; the server uses it for Steam and for crossplay.
›How many players can join a Valheim dedicated server?
10. The server turns the next player away as full.
›How do I make someone an admin on my Valheim server?
Put their player ID on its own line in adminlist.txt in the server's save folder (for Steam players the plain Steam ID works). bannedlist.txt bans the same way, and permittedlist.txt, if it has anyone in it, lets only those players in.
›How do I set difficulty on a dedicated server?
Start it with -preset (easy, hard, hardcore, casual, hammer, immersive) or -modifier <modifier> <option>, or type setworldpreset / setworldmodifier in the console as an admin while it runs.
›Where does a Valheim dedicated server save the world?
In worlds_local inside the save folder (%USERPROFILE%\AppData\LocalLow\IronGate\Valheim on Windows), or in the folder -savedir names.
›How often does a Valheim server make backups?
It keeps 4 automatic backups by default, none in the first 20 min of a session. A save makes one once the newest backup is 2 h old; while the second-newest is younger than 12 h it replaces the newest, otherwise it is added and the oldest dropped.
Formula
The argument list, every default and the file names are read from the game's code each patch; the server stops reading a world modifier name it can't parse and logs an error.
FejdStartup.ParseServerArguments, ZNet (player limit, admin/ban/permitted lists), SaveSystem.ConsiderBackup, Game.m_saveInterval — Valheim 1.0.17