=== User Data Location ===
* {icon linux} `~/.config/unity3d/IronGate/Valheim`
* {icon windows} `%USERDIR%\AppData\LocalLow\IronGate\Valheim\Dedicated` maybe?
=== Dedicated Server Setup ===
# In {nav icon=steam, name=Steam}, show the "Tools" in your Library, and install {nav Valheim Dedidicated Server}
# It should now be installed to something like `~/.steam/steam/steamapps/common/Valheim dedicated server/`
# In that folder, you //could// make a copy of `start_server.sh` or `start_server.bat` and edit it for what you need
Example script:
```
lang=bash
export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970
echo "Starting server PRESS CTRL-C to exit"
# Tip: Make a local copy of this script to avoid it being overwritten by steam.
# NOTE: Minimum password length is 5 characters & Password cant be in the server name.
# NOTE: You need to make sure the ports 2456-2458 is being forwarded to your server through your local router & firewall.
./valheim_server.x86_64 -name "keithzg's server" -port 2456 -world "KeithZGsServer" -password "Zomboat!" -public 1
export LD_LIBRARY_PATH=$templdpath
```
But, better yet, make a systemd unit file like so:
```
lang=ini, name=/etc/systemd/system/valheim.service
### Configuration
[Unit]
Description=Valheim Dedicated Server
[Service]
# Using my own user account and Steam install
User=keithzg
Group=keithzg
WorkingDirectory=/home/keithzg/.steam/steam/steamapps/common/Valheim dedicated server
# Same library setup as the shellscript does
Environment=LD_LIBRARY_PATH="/home/keithzg/.steam/steam/steamapps/common/Valheim dedicated server/linux64":$LD_LIBRARY_PATH
# While we're (for now) using the Steam-installed copy of the dedicated server, we've copied the savefiles to /opt/valheim/savedir to be written to there, so that Steam's cloud saves don't wreck havoc or such.
ExecStart="/home/keithzg/.steam/steam/steamapps/common/Valheim dedicated server/valheim_server.x86_64" -name "keithzg" -port 2456 -world "KeithZGsFirstWorld" -password "Zomboat!" -public 1 -savedir /opt/valheim/savedir
# By default, systemd send SIGTERM to services when stopping them. This appears to at least sometimes cause Valheim to not save! Lets specify use of a more polite signal.
KillSignal=SIGINT
[Install]
# Lazy way to ensure it starts when things should be ready
WantedBy=multi-user.target
```
=== External Documentation ===
* [[ https://valheim.fandom.com/wiki/ | Valheim Wiki ]]
** [[ https://valheim.fandom.com/wiki/Hosting_Servers | Hosting Servers ]]