Indra's Micro Blog

Intel NUC5CPYH as Valheim dedicated server

My son is into playing Valheim recently. I used to enjoy it too, so I figured I'll set up a local dedicated Valheim server, so we both can play on the same world, together.

I want to set it locally so I don't have to pay monthly for cloud server. Almost buy a Raspberry Pi 5 for this, when I remember that I have an old Intel NUC5CPYH not doing anything. Being released in 2015, it's a decade old by now. Still, figured I'll give it a try.

First, I installed Debian 12 without any desktop environment. I ticked both web server and ssh server instead. Created a password for both root account and restricted user account.

I followed this guide by pimylifeup. But it doesn't work, hence this post.

  1. Install SteamCMD by following this guide
  1. I skipped creating another user, and use my own user account. Instead, from this guide, I installed libatomic1, libpulse-dev, and libpulse0
  2. Install Valheim server using steamCMD
    /usr/games/steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir /home/<USER>/valheimserver +login anonymous +app_update 896660 +quit
    replace <USER> with the appropriate user name
  3. Create a linux service that will load on boot
    sudo nano /etc/systemd/system/valheimserver.service
    You can rename the service anything, it doesn't have to be valheimserver
  4. Copy or type the commands below, change with the appropriate user.
[Unit]
Description=Valheim Dedicated Server
Wants=network-online.target
After=syslog.target network-online.target

[Service]
Type=simple
Restart=on-failure
RestartSec=10
KillSignal=SIGINT
User=<USER>
WorkingDirectory=/home/<USER>/valheimserver
ExecStar=/home/<USER>/valheimserver/start_server.sh

[Install]
WantedBy=multi-user.target
  1. Next, to configure the server's setting, edit start_server.sh by typing nano /home/<USER>/valheimserver/start_server.sh then copy/type the commands below:
#!/bin/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 serve>
# NOTE: You need to make sure the ports 2456-2458 is being forwarded to your se>
./valheim_server.x86_64 -name "ServerName" -port 2456 -world "WorldName" -password "xxxxx" -public 1 -crossplay

export LD_LIBRARY_PATH=$templdpath
  1. To start the server, type systemctl start valheimserver
  2. To check server status, type systemctl status valheimserver, it configured correctly, you can find the server from the local Valheim client
  3. If you want to make any change to the start_server.sh or valheimserver.service, you should first stop the server by typing systemctl stop valheimserver, make the changes, then reload daemon by typing systemctl daemon-reload before finally start the server again with systemctl start valheimserver

That's it. My old Intel NUC5CPYH finally have a purpose once again.

Notes:

#Gaming #Guide #Linux