RE:NODE

Valheim server password rules: length, name clash, rotation

By RE:NODE Team
12 min read


A Valheim dedicated server password has two rules, and the server enforces both by refusing to start rather than by warning you: it must be at least five characters long, and it must not appear inside the server name (and, to be safe, not inside the world name either). Break either rule and the process exits seconds after launch with one log line that is easy to miss. Beyond those rules, the password is the only thing standing between your world and anyone who finds the address, so make it long, unrelated to the server's name, and easy to change - and when it leaks, change it, restart, and tighten access with the allow list rather than hoping nobody uses it.

This post covers exactly how the check works, where the password is set on each kind of install, what players see, the case for and against running with no password, and a step-by-step for rotating one that has escaped into a public channel.

The rules the server checks at start-up#

The dedicated server validates the password once, when it starts, before it loads the world. There is no config file to edit afterwards and no command to change it while the server runs; the password is a launch argument, -password, and lives wherever your launch line lives.

RuleExample that failsExample that passes
At least 5 characters-password "oak"-password "oak-barrel-17"
Not contained in the server name-name "Ravenhold" with -password "raven"-name "Ravenhold" with -password "salted-cod-77"
Not contained in the world name (treat as a rule)-world "Asgard" with -password "asgard1"-world "Asgard" with -password "copper-tusk-09"

The Iron Gate start scripts shipped with the server carry a comment that states the first two rules plainly - minimum length five, and the password cannot be in the server name. Reports differ on whether the world name is checked on every version, and it does not matter: a password that shares no word with either name passes on every build, and it is a better password anyway.

Notice the direction of the second check. The server asks whether the name contains the password, not the other way round. A name of Bjorn's Longhouse with the password longhouse fails because the name contains it. A password of longhouse-of-bjorn-2026 would pass that particular check, because the name does not contain that whole string - but it is still a weak password, because anyone who sees the name in the community list can guess it. Keep them unrelated, not just technically distinct.

The match is on characters, so case can catch you out in ways that vary. Do not rely on RAVEN being accepted where raven is not; pick something that is not in the name in any case.

Choosing a password that passes and holds#

A Valheim server password is typed by people, often on a controller, and pasted into chat. That pulls in a different direction from what a password manager would choose. A good compromise:

  • Three or four short words and a number, joined with hyphens: herring-barrel-42, copper-tusk-09. Long enough that guessing is pointless, readable over voice chat, easy to type.
  • Letters, digits and hyphens only. Spaces, quotes, $, !, &, % and backticks all mean something to a shell or a batch file. A password with $ in it on a Linux command line in double quotes is silently changed before Valheim sees it, and the group then cannot work out why the password "is wrong".
  • No word from the server name, the world name or your Discord server's name. These are the first things anyone guesses.
  • Not reused. If the same string protects someone's email, a leak of the Valheim password is a much bigger problem.

The password is matched exactly when a player joins: case matters, and a trailing space pasted from a chat message counts as a character. Lower-case words avoid an entire class of "it says incorrect password" evenings.

Vanilla Valheim does not document any lockout after repeated wrong attempts, so length is what defends a listed server against strangers trying passwords. A five-character password on a server shown in the community list is the minimum the game accepts, not a sensible one.

Where the password is set#

The argument is the same everywhere; only the place you type it changes.

On Linux, the stock start_server.sh has a line near the end that you edit, or you write your own start command:

start_server.sh
./valheim_server.x86_64 -nographics -batchmode \  -name "Ravenhold" -port 2456 -world "Midgard" \  -password 'herring-barrel-42' -public 1

Single quotes on Linux stop the shell from touching any special characters. On Windows, the equivalent is start_headless_server.bat in the server folder:

start_headless_server.bat
valheim_server -nographics -batchmode -name "Ravenhold" -port 2456 ^  -world "Midgard" -password "herring-barrel-42" -public 1

Edit a copy of the batch file rather than the original - a server update through SteamCMD with validate can put the stock file back. Windows dedicated server install and SteamCMD on Linux cover both scripts in full.

If you run the popular lloesche/valheim-server Docker image, the password is an environment variable, SERVER_PASS, next to SERVER_NAME and WORLD_NAME:

.env
SERVER_NAME=RavenholdWORLD_NAME=MidgardSERVER_PASS=herring-barrel-42SERVER_PUBLIC=true

Check the image's own README for the current variable names before relying on them; Valheim in Docker goes through the rest of the file.

On a panel host built on Pterodactyl, the password is a startup variable on the Startup tab, and the panel builds the launch line for you. Type the value without quotes - the panel quotes it, and quotes you add become part of the password.

On RE:NODE a join password is generated for every new Valheim server and shown with the other startup variables, already passing both rules. You can keep it or replace it; the change applies at the next restart.

What players see when they join#

The password is asked for after the connection succeeds and before the world loads. The sequence:

  1. The player connects by address, from a list, or with a crossplay join code.
  2. The game shows a password prompt. A padlock icon in the server list marks a server that has one.
  3. If the password matches, the world starts loading. If not, the player sees "Incorrect password" and is returned to the menu.

That order is useful when diagnosing. A player who sees the password prompt has already proved that the address, port, server and version are fine; whatever is wrong after that point is the password, a list file, or a full server. A player who never gets a prompt has a connection problem, which Valheim failed to connect errors works through.

On the server side, a wrong password is logged. The exact wording varies by version, but a line close to this appears with the player's ID:

code
Peer 76561198012345678 has wrong password

A burst of those lines from IDs you do not recognise is someone trying passwords. Reading the server log covers the connection lines around it.

Crossplay does not change any of this. Xbox and Microsoft Store players who join with the six-digit code get the same password prompt. The join code is not a password and does not replace one - anyone who has the code can reach the prompt, which is exactly why the password matters more on a crossplay server whose code is posted in a public Discord channel. See crossplay and Xbox players.

Running a server without a password#

People ask for this for a family server or a LAN party. The honest answer is that the behaviour of an empty -password "" has differed between versions and between setups, and a public server with no password is something Iron Gate's own scripts steer you away from. If you want to try it, test it on your version: start the server with the argument removed or empty and read the log to see whether it accepts it.

Even where it works, it is rarely the right choice:

  • The community list is full of people looking for open servers. A listed server with no password will be found, and griefing a Valheim world takes minutes with a pickaxe.
  • Hiding the server is not protection. -public 0 keeps it out of the list, but anyone with the address can still connect, and addresses get passed around.
  • The cost of a password is one prompt per session. For a group of friends that is nothing.

If the goal is "no friction for the people I trust", the better tool is a permitted list plus a password you never have to change. permittedlist.txt with any ID in it turns the server into allow-list-only; the password then becomes a second lock rather than the only one.

MethodStops strangers who have the addressStops a listed member's leaked passwordEffort
No password, -public 1No-None
No password, -public 0No-None
Password onlyYes, until it leaksNoLow
Password and -public 0Yes, until it leaksNoLow
Password and permittedlist.txtYesYesAdd each player's ID once

The list files and the ID formats for Steam and crossplay players are in adminlist, bannedlist and permittedlist. The general trade-off, across games, is in whitelist versus password.

Rotating a password that has leaked#

Passwords leak in boring ways: a screenshot of the Startup tab, a message in the wrong Discord channel, a former member who still has it, a stream overlay. The fix is quick and does not touch the world.

  1. Pick the new password first. Same rules: five characters or more, no word from the server or world name. Check it does not contain characters your launch method mangles.
  2. Warn the group. A short message before the restart saves a round of "the server is broken".
  3. Stop the server cleanly. A clean stop writes the world; a kill throws away everything since the last save. Wait for the save line in the log.
  4. Change `-password` in the start script, the Docker environment or the panel's startup variable.
  5. Start the server and confirm the start-up finished. If it exits immediately, the new password broke a rule.
  6. Test it yourself by joining with the new password before telling anyone else.
  7. Share the new password privately - direct messages or a role-restricted channel, not the general chat.

Changing the password does not kick anyone mid-session because a restart already did. Everyone who reconnects is asked for the new one.

How often to rotate when nothing has leaked is a judgement call. For a closed group with a permitted list, never is reasonable. For a public community server where membership changes, rotating when a moderator leaves or every season of a wipe cycle keeps the number of people who know the current password close to the number who should.

On RE:NODE, changing the password is an edit on the Startup tab followed by Restart, which stops the server cleanly so the world is saved first. Subusers can be given console and file access without billing, so a co-admin can rotate it without your account details - and the per-server activity log records who did.

Where the password is exposed, and how to keep it there#

A password is only as private as the places it is written down. On a typical server it appears in more places than people think:

  • The launch line itself. On Linux, any user on the same machine can read the command line of running processes with ps. On a shared box, that means other users can see -password. Run Valheim under its own user and do not share the machine with people you do not trust.
  • Start scripts and environment files. start_server.sh, a systemd unit, a docker-compose.yml or .env - anyone with read access to these has the password. Do not commit them to a public Git repository.
  • Screenshots. The panel's Startup tab, a terminal, a Docker Compose file shared on a forum to ask for help. Crop or blur before posting.
  • Logs. Valheim does not normally print the password in its own log, but a wrapper script that echoes its command line does. Check before pasting a log into a support thread.

Server name and world name, by contrast, are effectively public: the name is in the community list and the world name can be seen by anyone with file access. That is the practical reason behind the rule that the password must not be part of them.

Troubleshooting password problems#

The server exits right after starting. Check length and the name clash first. Then check quoting: an unclosed quote in a start script can swallow the rest of the line, so the password becomes herring-barrel-42 -public 1 or the name eats the password.

Everyone gets "Incorrect password" after a change. The server may still be running the old launch line. Confirm it was restarted after the edit, and on a panel confirm you saved the variable. Then look for invisible differences: a trailing space, smart quotes pasted from a document, or a password that contained $ and was altered by a shell.

One player gets "Incorrect password", everyone else is fine. Their typing. Keyboard layouts swap y and z and move symbols; controllers make long passwords painful. Have them type it into a text field first to see what comes out, or pick a password of plain lower-case words and digits.

The password works by IP but not by join code. It is the same password on both paths. If the code path fails before the prompt, the problem is the crossplay relay or the code having changed after a restart, not the password.

Strangers keep appearing despite a password. It has leaked or it is guessable. Rotate it, and add a permitted list so the next leak does not matter.

FAQ#

What is the minimum length for a Valheim server password?

Five characters. Anything shorter and the dedicated server refuses to start. Five is the floor the game accepts; for a server in the community list, use something three or four times as long.

Why does my server stop when the password matches the server name?

Because the game checks that the server name does not contain the password, and stops if it does. Names are public in the server list, so a password inside the name is no protection. Change the password to something unrelated to the name and the world.

Can I change the password without restarting the server?

No. The password is a launch argument read once at start-up. Edit it wherever your launch line lives and restart the server, cleanly, so the world is saved before it stops.

Do console players need the password too?

Yes. Xbox and Microsoft Store players joining a crossplay server with the join code see the same prompt and need the same password. The six-digit code only finds the server; it grants no access.

Is it safe to run a Valheim server with no password?

On a server hidden with -public 0 that only trusted people know about, the risk is small, but the behaviour of an empty password varies by version and anyone with the address can walk in. A password plus a permitted list costs almost nothing and is far safer.

Does hiding the server with -public 0 replace the password?

No. -public 0 only keeps the server out of the community list; anyone who has the address, or a crossplay join code, can still connect. Keep the password and use permittedlist.txt if you need to control exactly who gets in.