RE:NODE

Valheim server launch arguments: the complete reference

By RE:NODE Team
11 min read


A Valheim dedicated server has no configuration file. Everything is a launch argument on the line that starts valheim_server: -name, -port (default 2456), -world (default Dedicated), -password (at least five characters, not contained in the name or world), -public (default 1), -savedir, -logFile, -saveinterval (default 1800 seconds), -backups / -backupshort / -backuplong (defaults 4, 7200, 43200), -crossplay, -instanceid, and the world modifier arguments -preset, -modifier and -setkey. Add the Unity flags -nographics -batchmode in front and that is the whole surface. This page lists each one with its default, what it actually does, and the mistake people make with it.

Where you type them depends on how you run the server: in your copy of start_server.sh on Linux (the Linux install), in start_headless_server.bat or an NSSM service on Windows (the Windows install), in SERVER_ARGS and its sibling variables in Docker (the Docker guide), or as fields on a hosting panel's Startup tab.

All arguments at a glance#

ArgumentDefaultValue
-nographics-Flag. Unity: no graphics device
-batchmode-Flag. Unity: run without a window
-nameMy server in the sample scriptText, shown in the server list
-port2456UDP port; the next port up is used too
-worldDedicatedWorld file name, without extension
-password-At least 5 characters
-public11 listed, 0 unlisted
-savedirPlatform defaultFolder for worlds and list files
-logFilestdout / consolePath to write the log to
-saveinterval1800Seconds between world saves
-backups4Automatic backups to keep
-backupshort7200Seconds until the first backup
-backuplong43200Seconds between later backups
-crossplayoffFlag. PlayFab networking, Xbox and Game Pass
-instanceid-Identifier to tell instances apart
-preset-World modifier preset
-modifier-<name> <value>, repeatable
-setkey-World switch, repeatable

A complete line for a typical server:

bash
./valheim_server.x86_64 -nographics -batchmode -name "Longship Crew" -port 2456 \  -world "Midgard" -password "herring-barrel-42" -public 1 \  -savedir /home/valheim/save -saveinterval 900 -backups 6 \  -backupshort 3600 -backuplong 21600 -crossplay

Write argument names exactly as shown - -logFile is documented with a capital F - and values containing spaces need quotes on a command line. On a hosting panel where each argument is its own field, leave the quotes out; the panel adds them, and literal quote marks end up in the server name. If you are new to how game servers take arguments generally, game server startup parameters explained covers quoting, order and environment variables across engines.

Identity: -name, -world and -password#

`-name` is what the community list shows. It can contain spaces and most punctuation. It has no effect on the world, so you can rename a server at any time. The list sorts and searches poorly, so a distinctive word in the name helps your players find it.

`-world` is a file name, not a display name. -world Midgard loads Midgard.db and Midgard.fwl from worlds_local in the save directory, and if they do not exist it generates a new world with that name and a random seed - silently, as far as the players are concerned. That makes this the argument behind most "the server reset our world" reports: a typo, a changed capital letter on a case-sensitive Linux file system, or a save directory that moved. The old files are still there. Fix the name and restart.

If you want a specific seed, there is no seed argument. Create the world in the game client with the seed you want, then upload the two files - uploading a local world has the steps.

`-password` has two rules, and the server enforces both by refusing to start:

  1. At least five characters.
  2. It must not appear in the server name or the world name. -name "Bjorn Hall" -password "bjornhall" fails; so does a password that contains the world name.

Whether a public server will run with no password at all has varied between builds; treat the password as required. Players type it once when joining, and the game remembers it for that server.

Network: -port, -public and -crossplay#

`-port` sets the game port, UDP, default 2456. The server also uses the port above it for Steam queries, so -port 2456 occupies 2456 and 2457, and the sample scripts suggest forwarding 2456-2458. Running two servers on one address means spacing them: 2456 and 2466 is the common choice, though 2459 would technically work. Players joining by IP use the game port. The detail, including home port forwarding, is in Valheim ports 2456-2458 explained.

`-public` takes 1 or 0. With 1 the server registers with the community list; with 0 it does not appear there but anyone with the address and password can still join by IP. 0 is not a security setting - it only hides the server from browsing. For a real allow-list, use permittedlist.txt, covered in the Valheim list files guide. A public server can take several minutes to appear in the list; server not showing in the list covers the delay and the filters.

`-crossplay` is a flag with no value. It switches the server to the PlayFab networking backend that Xbox, Game Pass and Microsoft Store players use, and prints a six-digit join code in the log on every start. Without it the server is Steam-only. It changes how players are identified - list files then need platform-prefixed IDs such as Steam_76561198012345678 - and on Linux it needs libatomic1 installed. When to use it and when to leave it off is the subject of Valheim crossplay and Xbox players.

Files: -savedir, -logFile and -instanceid#

`-savedir` moves everything the server writes: the worlds_local folder (and worlds, on older builds) and the three list files adminlist.txt, bannedlist.txt and permittedlist.txt. Without it the server uses the running user's profile:

PlatformDefault save directory
Linux~/.config/unity3d/IronGate/Valheim
Windows%USERPROFILE%\AppData\LocalLow\IronGate\Valheim

Set it explicitly whenever the server runs as a service or under an account you do not log in as. Otherwise the world lands in a profile folder nobody looks at - on Windows a service running as LocalSystem saves under C:\Windows\System32\config\systemprofile. With -savedir /srv/valheim, worlds go in /srv/valheim/worlds_local and the list files in /srv/valheim. The folder must be writable by the server's user. Where Valheim keeps its files maps every path.

`-logFile` is a Unity argument, not a Valheim one, written with a capital F in Unity's documentation. Without it the log goes to standard output, which is what you want under systemd (the journal keeps it), Docker (docker logs) or a hosting panel's console. Give it a path when nothing is capturing standard output - an NSSM service without AppStdout, or a scheduled task:

bash
-logFile /home/valheim/logs/valheim.log

The file is overwritten on each start, not appended to, so rotate or rename it in your start script if you want history.

`-instanceid` takes a short identifier and is meant for telling several server instances on one machine apart. Most setups never need it: two servers with different world names, different ports and their own save directories do not collide. Reach for it only if you are deliberately sharing one save directory between instances.

Saving: -saveinterval#

The world lives in memory and is written to disk every -saveinterval seconds, 1800 (thirty minutes) by default. Anything that ends the process without a clean shutdown - a kill, an out-of-memory stop, a power cut - loses everything since the last save. A clean stop (Ctrl+C, SIGINT, a panel's Stop button) saves first.

-saveintervalWorst-case loss on a crashCost
1800 (default)30 minutesRare hitches
90015 minutesHitch every 15 minutes on big worlds
60010 minutesThe usual compromise
3005 minutesNoticeable on large, heavily built worlds

Saving is not free: on a mature world the server pauses briefly while it serialises the world, and players feel a hitch. The bigger the world, the longer the pause, so very short intervals on a large world trade crash losses for regular stutters. 600 is a good default for most groups. The save admin command forces one immediately, which is worth typing before anything risky. Why saves cost what they cost is in game server autosave intervals.

Backups: -backups, -backupshort and -backuplong#

The built-in backup rotation copies the world file pair on a timer and keeps a fixed number of copies beside it in worlds_local:

  • `-backups` - how many automatic backups to keep, default 4. The oldest is deleted when a new one is made. 0 disables them.
  • `-backupshort` - seconds from server start until the first backup, default 7200 (two hours).
  • `-backuplong` - seconds between the backups after that, default 43200 (twelve hours).

With the defaults, a server that restarts nightly makes one backup two hours after each start and rarely reaches the second. That is the gotcha: on a server with a daily restart, -backuplong almost never fires, and four backups cover the last four days at one per day. If you want several a day, lower both:

code
-backups 8 -backupshort 3600 -backuplong 10800

That keeps eight copies, the first an hour after start and then every three hours. Backup files are named after the world with a timestamp, so they never overwrite the live files.

These copies sit on the same disk as the world and protect against one thing: a save that went wrong. They do nothing for a dead disk, a deleted folder or a host that is gone. Real backups go somewhere else, on a schedule, and get restored once in a while to prove they work - Valheim server backups and world corruption covers both halves.

World rules: -preset, -modifier and -setkey#

World modifiers were added in the Hildir's Request update. They are applied at launch and stored with the world, so changing them is a restart with different arguments; builds and progress are unaffected.

code
-preset casual-modifier combat hard -modifier raids less -modifier portals casual-setkey nobuildcost -setkey playerevents

The three arguments work together:

  • `-preset` picks a bundle: normal, casual, easy, hard, hardcore, immersive or hammer.
  • `-modifier <name> <value>` sets one slider and is repeated for each. The names are combat, deathpenalty, resources, raids and portals. Individual modifiers override the preset.
  • `-setkey <key>` turns on a world switch, also repeatable: nobuildcost, playerevents, passivemobs, nomap.

Two gotchas. Values are lowercase words, not numbers, and a misspelt value does not stop the server, so check that the effect you wanted actually happened. And the list of modifiers and keys has grown with updates; the in-game world modifiers screen of the current version is the reference for anything not listed here. What each value does to the game is covered in Valheim world modifiers and presets, and the related global keys in global keys and setkey.

On RE:NODE these arguments are fields on the Startup tab, so changing the save interval, the backup counts or a modifier is an edit and a restart; crossplay is already on and both UDP ports are allocated with the plan.

Three complete lines for common setups#

Reference tables are easier to use with a finished example next to them. These three cover most groups.

A small private Steam group that never wants strangers in the list, saving often because one player's PC crashes the session now and then:

bash
./valheim_server.x86_64 -nographics -batchmode -name "Ashwood" -port 2456 \  -world "Ashwood" -password "salted-cod-77" -public 0 -saveinterval 600

Here -public 0 keeps the server out of the community list, and players join by IP. The world and the server share a name, which is fine; only the password must stay out of both.

A mixed PC and Xbox group on a hosted machine, with a calmer combat setting and frequent backups:

bash
./valheim_server.x86_64 -nographics -batchmode -name "Raven Fjord" -port 2456 \  -world "RavenFjord" -password "longboat-oar-19" -public 1 -crossplay \  -modifier combat easy -backups 8 -backupshort 3600 -backuplong 10800

The Xbox players join with the code from the log, which changes on every restart, so post the new one wherever your group talks after each restart.

A second server on the same machine as the first, with its own save directory so nothing is shared:

bash
./valheim_server.x86_64 -nographics -batchmode -name "Raven Fjord Test" -port 2466 \  -world "TestWorld" -password "spare-anvil-03" -public 0 \  -savedir /home/valheim/save-test

The port is ten above the first, the save directory is separate, and the server is unlisted because a test world has no business in the community list. Open UDP 2466-2468 in the firewall as well.

Mistakes that stop the server or lose the world#

A short list of argument mistakes and what they look like:

MistakeSymptom
Password under 5 characters or inside the nameServer exits seconds after start
-world typo or wrong capitalsA new, empty world loads
-savedir not writableSave errors in the log, nothing persists
Two servers on 2456 and 2457Second server fails to bind or neither lists
Quotes typed into a panel fieldName shows with quote marks
Missing -crossplayXbox players cannot find the server

When a server will not start and the arguments look right, read the first error in the log rather than the last; Valheim server crashes on start goes through them in order.

FAQ#

Is there a config file instead of launch arguments?

No. Vanilla Valheim reads nothing but its arguments and the three list files. Mods running under BepInEx have their own config files in BepInEx/config, but the server itself does not.

Can I change arguments without losing the world?

Yes. Stop the server cleanly, change the arguments, start it. The world is only affected by -world and -savedir, which decide which files are loaded; everything else is safe to change.

What is the maximum player count argument?

There is none. The ten-player cap is built into the game and only mods change it. The player limit and larger groups covers what raising it costs.

Does the order of arguments matter?

No. Valheim reads them by name. Put -nographics -batchmode first by convention, and keep each value directly after its argument.

How do I set a world seed?

You cannot from the server. Generate the world in the game with the seed you want, then upload the .db and .fwl files into worlds_local and set -world to their name.

Why does -public 0 still let strangers join?

Because it only removes the server from the list. Anyone with the address and the password can still join. Use permittedlist.txt to restrict who may connect.