How to Set a Password on Your Valheim Server
Password protect your Valheim dedicated server. Includes the 5-character minimum and the world-name restriction.
Valheim servers require a password by default. There are two important rules:
- The password must be at least 5 characters
- The password cannot match the world name — Valheim will refuse to start if it does
Open Startup
In the XGamingServer Panel, click Startup in the sidebar.
Change the Server Password
Find the Server Password variable (maps to -password) and enter your password.
MySecretPassThe password must be at least 5 characters and must not match the world name set in the World variable.
Restart the server
Go to Console and restart.
Removing the Password
Valheim does not officially support password-less servers — the server will refuse to start without a password. If you want a public-feeling server:
- Use a simple, well-known password and share it openly
- Combine with
-public 1so it appears in the Community browser - Or use the join code approach for crossplay servers
Common Errors
| Error | Cause | Fix |
|---|---|---|
| "Password too short" | Password under 5 characters | Use at least 5 characters |
| "Password matches world name" | -password and -world are the same string | Make them different |
| Server won't start | One of the above | Check Console output for the exact error |
Related Guides
How is this guide?

Valheim Server Launch Parameters Reference
Complete reference for all Valheim dedicated server startup parameters and launch options.
How to Optimize Your Valheim Server Performance
Fix lag, reduce desync, and optimize your Valheim dedicated server. Covers zones, instances, network tuning, and building limits.