fbpx
Xgamingserver
Valheim Mods Installation to server

How to Add/Install Mods to a Dedicated Valheim Server | BepInEx

Install Mods Valheim Server

What are Valheim Mods?

mod (short for “modification”) is an alteration by players or fans of a video game that changes one or more aspects of a video game, such as how it looks or behaves. Mods may range from small changes and tweaks to complete overhauls, and can extend the replay value and interest of the game.

Over time, modded version of games has become so popular that the original version of the game is often referred to as plain vanilla this is most common with Minecraft.

Popular sites in which you can find mods include Nexus Mods.

How to install Valheim Mods on a gaming server

Running your game on our Valheim game server and want to spice things up with mods? Then we have you covered Below I have detailed how to install mods on XgamingServer panel.

You can also rent an already installed ValheimPlus Modded server.

Install BepInExPack for Valheim

BepInEx is a general purpose framework for Unity modding. BepInEx includes tools and libraries to

  • load custom code (hereafter plugins) into the game on launch;
  • patch in-game methods, classes and even entire assemblies without touching original game files;
  • configure plugins and log game to desired outputs like console or file;
  • manage plugin dependencies.

BepInExPack for Valheim contents

This pack is preconfigured and usable for Valheim modding.
In particular, the changes from base BepInEx releases are:

  • Added preconfigured BepInEx.cfg with console enabled.
  • Added unstripped Unity + Mono BCL DLLs for current versions of the game. See this issue comment for more info.
  • Updated Doorstop configuration and BepInEx to allow to load unstripped DLLs without having to overwrite game DLLs.
  • Added scripts necessary to run both game and dedicated server on Linux machines

Downlaod BeInExPack Valheim

Install Mods Valheim Server

Installation for BeInExPack Valheim

To install BeInExPack the following

1. Login to your game panel.

After you place an order for your game server you’ll be sent login details to your server control panel.

2. Navigate to File Manager

On your game panel, navigate to File Manager tab, here you’ll see the game files.

3. Extract the archive into a folder.

Extract the archive into a folder. Do not extract into the game folder.

4. Extract Contents

Upload the contents of BepInExPack_Valheim folder into 

<File Manager>/home/container/BepInEx. 
Install Mods Valheim Server
Valheim Mods Installation to server

5. Check that you have installed it correctly.

If done correctly, your folder will look as follows

Install Mods Valheim Server
Valheim Mods Installation to server

Download the Mods and Upload to the Valheim Server

Install Mods Valheim Server
Valheim Mods

Now that you have install BeInExPack download your Mods and upload the mod files to

 <File Manager>/home/container/BepInEx/plugins

Install Mods Valheim Server
Valheim Mods BeinExPack

Create a Startup config file

For your server to use the mods you have to create a start up config file on the root folder

Make 

start_server_bepinex.sh

Copy the following lines of code and make sure to edit the necessary server name password and port

#!/bin/sh
# BepInEx running script
#
# This script is used to run a Unity game with BepInEx enabled.
#
# Usage: Configure the script below and simply run this script when you want to run your game modded.

# -------- SETTINGS --------
# ---- EDIT AS NEEDED ------

# EDIT THIS: The name of the executable to run
# LINUX: This is the name of the Unity game executable [preconfigured]
# MACOS: This is the name of the game app folder, including the .app suffix [must provide if needed]
executable_name="valheim_server.x86_64"

# EDIT THIS: Valheim server parameters
# Can be overriden by script parameters named exactly like the ones for the Valheim executable
# (e.g. ./start_server_bepinex.sh -name "MyValheimPlusServer" -password "somethingsafe" -port 2456 -world "myworld" -public 1)
server_name="Valheim XgamingServer"
server_password="Testme"
server_port=2456
server_world="Yggdrasil"
server_public=1
server_savedir="$HOME/.config/unity3d/IronGate/Valheim"

# The rest is automatically handled by BepInEx for Valheim+

# Whether or not to enable Doorstop. Valid values: TRUE or FALS
export DOORSTOP_ENABLE=TRUE

# What .NET assembly to execute. Valid value is a path to a .NET DLL that mono can execute.
export DOORSTOP_INVOKE_DLL_PATH="${PWD}/BepInEx/core/BepInEx.Preloader.dll"

# Which folder should be put in front of the Unity dll loading path
export DOORSTOP_CORLIB_OVERRIDE_PATH=./unstripped_corlib

# ----- DO NOT EDIT FROM THIS LINE FORWARD  ------
# ----- (unless you know what you're doing) ------

if [ ! -x "$1" -a ! -x "$executable_name" ]; then
	echo "Please open start_server_bepinex.sh in a text editor and provide the correct executable."
	exit 1
fi

doorstop_libs="${PWD}/doorstop_libs"
arch=""
executable_path=""
lib_postfix=""

os_type=`uname -s`
case $os_type in
	Linux*)
		executable_path="${PWD}/${executable_name}"
		lib_postfix="so"
		;;
	Darwin*)
		executable_name=`basename "${executable_name}" .app`
		real_executable_name=`defaults read "${PWD}/${executable_name}.app/Contents/Info" CFBundleExecutable`
		executable_path="${PWD}/${executable_name}.app/Contents/MacOS/${real_executable_name}"
		lib_postfix="dylib"
		;;
	*)
		echo "Cannot identify OS (got $(uname -s))!"
		echo "Please create an issue at https://github.com/BepInEx/BepInEx/issues."
		exit 1
		;;
esac

executable_type=`LD_PRELOAD="" file -b "${executable_path}"`;

case $executable_type in
	*64-bit*)
		arch="x64"
		;;
	*32-bit*|*i386*)
		arch="x86"
		;;
	*)
		echo "Cannot identify executable type (got ${executable_type})!"
		echo "Please create an issue at https://github.com/BepInEx/BepInEx/issues."
		exit 1
		;;
esac

doorstop_libname=libdoorstop_${arch}.${lib_postfix}
export LD_LIBRARY_PATH="${doorstop_libs}":${LD_LIBRARY_PATH}
export LD_PRELOAD=$doorstop_libname:$LD_PRELOAD
export DYLD_LIBRARY_PATH="${doorstop_libs}"
export DYLD_INSERT_LIBRARIES="${doorstop_libs}/$doorstop_libname"

export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970

for arg in "$@"
do
	case $arg in
	-name)
	server_name=$2
	shift 2
	;;
	-password)
	server_password=$2
	shift 2
	;;
	-port)
	server_port=$2
	shift 2
	;;
	-world)
	server_world=$2
	shift 2
	;;
	-public)
	server_public=$2
	shift 2
	;;
	esac
done

"${PWD}/${executable_name}" -name "${server_name}" -password "${server_password}" -port "${server_port}" -world "${server_world}" -public "${server_public}"

export LD_LIBRARY_PATH=$templdpath

Change the file permission to 755

For the Valheim server to read the start_server_bepinex.sh file you have to change the file permission from 644 to 755 as shown below. 

Install Mods Valheim Server
change bepinex file permission
Install Mods Valheim Server

Open a ticket to request start up config change

Open a support ticket so that the start up command can be changed.

from this

Install Mods Valheim Server
Valheim server Mods startup command

to this

Install Mods Valheim Server
Valheim Mods startup command

Checking BepInEx version and load status

If BepInEx was loaded successfully into the game, you should see BepInEx version info in top left corner of the main menu:

BepInEx version in top-left corner of main menu
Valheim Mods startup command

Congratulations you have now installed mods on a Valheim game server

Valheim Server hosting
Valheim Server hosting

Xray

A Mathematician who knows a thing or two about Design.

3 comments

Archives