Valheim server with mods: setting up BepInEx
Updated: 18 November 2026 · Guide · Valheim · Game server
Valheim mods almost always run via BepInEx, a mod loader for Unity games. For the Linux server that means: copy the BepInExPack_Valheim package from Thunderstore into the dedicated server's folder, start the server via the bundled start_server_bepinex.sh and put the mods as DLL files into BepInEx/plugins. Which mods players also need on their own computers depends on the individual mod.
This guide assumes a running Valheim server on Linux, installed with SteamCMD (app 896660). How to do that is in the self-hosting guide. The package maintainers say themselves that their server guide assumes Linux knowledge.
The right package
The package meant is BepInExPack_Valheim by the author denikson on Thunderstore, version 5.4.2360 as of 18 November 2026. It's BepInEx 5.4.23.6, preconfigured for Valheim and maintained by people from the Valheim community. The maintainers explicitly ask not to take problems with the package to the official BepInEx Discord, because the Valheim version is modified; the maintainers named on the package page are responsible.
The archive contains a folder BepInExPack_Valheim. For the server its contents are what count: the BepInEx folder (configuration and core), doorstop_libs with the Linux loader, doorstop_config.ini and the start script start_server_bepinex.sh.
Installing
The package recommends starting with a clean, unmodified installation and not unpacking the archive directly into the game folder but next to it. On the server it looks like this, if the server is in ~/valheim and the archive was downloaded as BepInExPack_Valheim.zip:
mkdir -p ~/bepinex-tmp unzip BepInExPack_Valheim.zip -d ~/bepinex-tmp cp -r ~/bepinex-tmp/BepInExPack_Valheim/. ~/valheim/ cd ~/valheim chmod u+x start_server_bepinex.sh
The dot after BepInExPack_Valheim/ is intentional: that way cp also copies the hidden file .doorstop_version, which an asterisk wouldn't catch.
Adapting start_server_bepinex.sh
The script first sets a few environment variables through which the Doorstop loader hooks BepInEx into the server process, and then starts valheim_server.x86_64 with the same parameters as Valheim's own start script. Leave the upper part alone; the script itself warns against changing it. You only need to change the last line with name, world and password:
export DOORSTOP_ENABLED=1 export DOORSTOP_TARGET_ASSEMBLY=./BepInEx/core/BepInEx.Preloader.dll export LD_LIBRARY_PATH="./doorstop_libs:$LD_LIBRARY_PATH" export LD_PRELOAD="libdoorstop_x64.so:$LD_PRELOAD" ... exec ./valheim_server.x86_64 -name "My server" -port 2456 -world "Dedicated" -password "secret"
You append further parameters such as -public, -crossplay or -nographics -batchmode there just as with a normal start. The same rules apply to the password: at least five characters and not contained in the server name. The script also advises making your own copy of it, so that an update via Steam doesn't overwrite your changes.
Important if the server has so far run via systemd or another service: the service must now start this script, not valheim_server.x86_64 directly. If the binary starts without the environment variables above, BepInEx doesn't load and the server runs without mods.
Checking whether BepInEx loads
If you start the script in the terminal, according to the package description BepInEx startup messages appear. On first start BepInEx also creates the log file LogOutput.log in the BepInEx folder. If both are missing, the server started without BepInEx.
./start_server_bepinex.sh tail -f ~/valheim/BepInEx/LogOutput.log
Installing mods
BepInEx loads plugins from the BepInEx/plugins folder; that's what the BepInEx source code says. The folder isn't included in the package; create it if it's missing and copy the mod's DLL into it. Pay attention to the dependencies Thunderstore lists on every mod page and install them too. Then restart the server.
mkdir -p ~/valheim/BepInEx/plugins cp MyMod.dll ~/valheim/BepInEx/plugins/
The configuration files are in the BepInEx/config folder, including the mods' files once they have been started once. Edit them there while the server is stopped.
Server and players: who needs which mod
There are server-only mods, client-only mods and mods that have to be on both sides. Which kind a mod is, is stated on its page. Many mods use the Jötunn library for this, and its docs describe the levels precisely: from “not checked” through “only check the version if present on both sides” to “server and all players must have the mod”, optionally requiring the same major, minor or patch version. If something doesn't match, the server disconnects the player with a message about the wrong version that names the mod in question.
In practice that means: give your fellow players a list of the mods with exact versions, or a profile for a mod manager such as Gale or r2modman; the package page recommends such a manager for installing on the gaming PC. A mod that everyone needs should be installed by everyone in the same version.
Updates
BepInEx mods hook into the game's methods at runtime. If a Valheim update changes exactly those places, a mod can fail or prevent startup until its author catches up. Before every game update, back up the world from ~/.config/unity3d/IronGate/Valheim/worlds_local and the BepInEx folder. If the server doesn't start afterwards, first take individual mods out of BepInEx/plugins instead of setting everything up again. And as soon as players have updated their game, the server has to move to the same Valheim version, otherwise nobody gets in any more.
Windows servers and rented servers
For a Windows dedicated server the package page describes no route of its own, only installation in the game on Windows and the Linux server. For hosts that offer BepInEx in one click it refers to a separate list.
With a Valheim server rented from us you can upload files in the “Files” tab, including BepInEx and mods. But our Valheim server starts the game directly and not via start_server_bepinex.sh, and without that start BepInEx doesn't load any mods. We have not yet tested a server with BepInEx mods. If you want to run a Valheim server with mods today, you're on the safe side with your own VPS and this guide.
- Self-host a Valheim serverSteamCMD, ports, start parameters: the basics
- Rent a VPSFull root access for a server with mods
- First: secure the VPSSet up SSH key and firewall
- Rent a Valheim serverWithout mods, settings in the control panel
- All Valheim settings in the panelWorld mode, password, backups
- Server not reachable?Check ports when nobody can get in