valheim

Dedicated Valheim Server on Linux


Prerequisites
Ubuntu 18.04 64bit installed
2 VCPU, 8GB RAM
NAT Portforward: 2456, 2457, 2458


Steps
# sudo -s
# apt update && apt upgrade

# add-apt-repository multiverse
# dpkg --add-architecture i386
# apt update
# apt install steamcmd

# useradd --create-home --shell /bin/bash --password sism1234 steam

# su - steam

# ln -s /usr/games/steamcmd steamcmd

# steamcmd +login anonymous +force_install_dir /home/steam/valheimserver +app_update 896660 validate +exit

# vi /home/steam/valheimserver/start_valheim.sh

#!/bin/bash
export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970

# 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 "Geekhead" -port 2456 -nographics -batchmode -world "Geakheadv1" -password "sism1234" -public 1

export LD_LIBRARY_PATH=$templdpath

# vi /home/steam/check_log.sh

journalctl --unit=valheimserver --reverse

# exit

# vi /etc/systemd/system/valheimserver.service
[Unit]
Description=Valheim Server
Wants=network-online.target
After=syslog.target network.target nss-lookup.target network-online.target

[Service]
Type=simple
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
User=steam
Group=steam
ExecStartPre=/home/steam/steamcmd +login anonymous +force_install_dir /home/steam/valheimserver +app_update 896660 validate +exit
ExecStart=/home/steam/valheimserver/start_valheim.sh
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s INT $MAINPID
WorkingDirectory=/home/steam/valheimserver
LimitNOFILE=100000

[Install]
WantedBy=multi-user.target


# systemctl daemon-reload
# systemctl start valheimserver
# systemctl status valheimserver
# systemctl enable valheimserver





LOCAL GAME SAVE LOCATION
C:\Users\{username}\AppData\LocalLow\IronGate\Valheim\worlds

LINUX GAME SAVE LOCATION
/home/steam/.config/unity3d/IronGate/Valheim/worlds



https://developer.valvesoftware.com/wiki/SteamCMD