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.
- Install SteamCMD by following this guide
sudo apt update
andsudo apt upgrade
sudo apt install software-properties-common
sudo dpkg --add-architecture i386
sudo apt-add-repository non-free
sudo apt install steamcmd
- I skipped creating another user, and use my own user account. Instead, from this guide, I installed
libatomic1
,libpulse-dev
, andlibpulse0
- 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 - 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 bevalheimserver
- 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
- 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
- replace
ServerName
,WorldName
, andxxxxx
appropriately. Password has to be 5 characters. Save and exit.
- To start the server, type
systemctl start valheimserver
- To check server status, type
systemctl status valheimserver
, it configured correctly, you can find the server from the local Valheim client - 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 typingsystemctl daemon-reload
before finally start the server again withsystemctl start valheimserver
That's it. My old Intel NUC5CPYH finally have a purpose once again.
Notes:
- If you need to alter game settings, such as
-preset easy
ormodifier raids none
, edit thestart_server.sh
. More info at the bottom of this guide - Make a copy of
start_server.sh
since Steam might replace it with default value during update