Advertisement

Generate a Valheim start_headless_server.bat

Looking for Valheim's config file? It does not exist. The server takes every option as a command-line flag in its launch script, so editing files will never change how it behaves.

Start from a preset

Visual Settings

batch args Format
Identity

Server name in the browser. Must not be the same as the password, or the server refuses to start.

Game port. Valheim also uses the port immediately above this one for queries, so forward both.

Gameplay

World modifier preset introduced with the difficulty sliders. Applies on top of the world itself.

World

Name of the world save to load. A typo silently starts a brand new world instead of loading yours.

Override for where worlds and characters are stored. Leave blank for the default location.

Seconds between automatic saves.

How many rolling backups to keep.

Players & Access

Minimum five characters, and it must not appear inside the server or world name. Breaking either rule stops the server booting with little explanation.

Network

1 lists the server publicly, 0 makes it joinable by address only.

Enables the PlayFab crossplay backend so console players can join. Changes how the server is discovered.

start_headless_server.bat

valheim_server.exe -nographics -batchmode -name "My Valheim" -port 2456 -world "Dedicated" -password "changeme" -public 1

Advertisement

The start_headless_server.bat format

Options are flags on the server executable. Name, port, world and password each take a value after them, quoted if it has a space in it. Be careful with world: it refers to an existing save by name rather than seeding a new one, so misspell it and you silently get a fresh, empty world in place of the one you wanted.

Advertisement

The mistake that wastes an evening

The password rules can stop the server from starting, and you will not be told why. It has to be five characters or longer, and it cannot contain either the server name or the world name. Name the server Valhalla, set the password valhalla123, and it simply will not launch. If the server quits straight after starting, check the password first.

Flags the generator also covers

Beyond name, port, world and password, the server takes a handful of flags that matter on a long-running world. -saveinterval sets seconds between saves (1800 by default). -backups sets how many rolling backups to keep (4), and -backupshort and -backuplong set when they are taken (7200 and 43200 seconds). -savedir moves worlds and characters somewhere other than the default. -crossplay turns on the backend console players need. -preset applies one of the difficulty presets: casual, easy, normal, hard, hardcore, immersive or hammer.

Where the world files live

Unless -savedir says otherwise, worlds are stored under the account that runs the server: in AppData\LocalLow\IronGate\Valheim\worlds_local on Windows, and in ~/.config/unity3d/IronGate/Valheim/worlds_local on Linux. Each world is a .db and a .fwl with the same name. Copy them as a pair, and only while the server is stopped; a .db copied mid-save can be incomplete.

Rather not run the server yourself?

These tools are free and funded by the two hosting services we run. If you want a server that is already set up, here they are.

Advertisement