Valheim Dedicated Server – Tips & Tricks (Linux)



Valheim Dedicated Server – Tips & Tricks (Linux)

Valheim Dedicated Server - Tips & Tricks (Linux)

In this video I go over some tips and tricks that go along with Valheim Dedicated Server Administration. This video is specific to Linux server administration. There will be a separate video coming that deals with Windows server administration.

This video is VERY LONG. Get some coffee and try not to fall asleep.
I hit the following points throughout the video.

1. How to enable console commands
2. How to use console commands (cheats)
3. How to move a single-player world to a dedicated server.
4. How to Update a Valheim Dedicated Server
5. How to build Scripts in Linux
6. How to configure automatic updates using system services and cron

Timestamps:

3:32 – Enabling Cheats (Console)
4:41 – Using the console
7:24 – Using Skill and Spawn Cheats
8:30 – Enabling Developer Mode (Creative Mode)
10:42 – God Mode
10:51 – Disabling Cheats
12:00 – Start of Server-Side

12:00 – Moving a Single Player World File to Dedicated Server
14:04 – Downloading and Using WinSCP for Moving World Files
16:31 – SSH to Linux Server and Move World Files to Correct Directory
18:35 – Re-installing Valheim Server Files (Optional) and Finding Default File Locations
21:57 – Modifying start_server.sh to Load New World
23:39 – Logging into Transferred World

26:50 – Using Console in Dedicated Server
27:20 – Using the Kick Command
28:01 – Editing adminlist.txt
30:18 – Using the Kick Command without Admin
30:24 – How to find SteamID for adminlist.txt
31:00 – Banning Players (bannedlist.txt)

31:33 – Updating a Valheim Server (Overview)
32:27 – Backing up start_server.sh

33:29 – Updating Server (Manual Command)
34:48 – Restoring start_server.sh backup

36:08 – Updating Server (Semi-Automatic) Using update.sh
38:47 – Create Separate start_server.sh Script to Prevent Overwriting During Update

40:54 – Updating Server (Automatic) Using Crontab
41:40 – Change start.sh to Executable Bash File and Update Path Information
42:30 – Creating valheim.service (Turning Valheim Server into a System Service)
46:44 – Registering and Testing valheim.service
47:30 – Starting Server using Service and Looking at Logs
48:24 – Stopping valheim.service and Updating valheim.service (messed up configuration)
50:07 – Modify update.sh to Work with valheim.service
52:09 – Testing update.sh with valheim.service
53:01 – Adding update.sh to Crontab (Scheduling Automatic Update)
55:18 – Recap

56:14 – Rebooting Server to Test Connectivity
57:03 – Outro

List of all Console Commands:
https://www.rockpapershotgun.com/valheim-cheats-spawn-item-list-console-commands-creative-mode

Windows World File Location:
C:UsersusernameappdataLocalLowIrongateValheimworlds

Linux World File Location:
/home/username/.config/unity3d/IronGate/Valheim/worlds

Default Linux Dedicated Server Location:
/home/username/.steam/steamapps/common/’Valheim Dedicated Server’

Valheim.service file contents:
[Unit]
Description=Valheim Server
Wants=network.target
After=network-online.target

[Service]
Type=simple
User=username
WorkingDirectory=/home/username/Steamcmd/Valheim (Directory where start.sh is located)
ExecStart=/home/netman/Steamcmd/Valheim/start.sh (Location of start.sh)
StandardOutput=journal+console
StandardError=journal+console

[Install]
WantedBy=multi-user.target

Update.sh file contents:
#!/bin/bash

systemctl stop valheim.service

/usr/games/steamcmd +login anonymous +force_install_dir /home/username/Steamcmd/Valheim +app_update 896660 validate +exit

systemctl start valheim.service

Start.sh file contents:

#!/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 server name.
# NOTE: You need to make sure the ports 2456-2458 is being forwarded to your server through your local router & firewall
/home/username/Steamcmd/Valheim/valheim_server.x86_64 -name “Server” -port 2456 -world “World” -password “Secret” -public 1

export LD_LIBRARY_PATH=$templdpath