Hosting a Valheim dedicated server means your Viking world stays up 24/7 — your group can log in any time without waiting on one person to host, and the server is tuned for performance instead of running alongside a game client. This guide covers the full Linux path: SteamCMD install, server config, BepInEx and ValheimPlus mods, crossplay between Steam and Xbox/Gamepass, systemd auto-start, automated world backups, and troubleshooting the real issues people hit in 2026.
Since the Ashlands biome landed, server RAM usage in late-game saves grew noticeably. 4 GB is the realistic floor for a small group, and 8 GB gives comfortable headroom for modded play. We cover plan sizing per scenario in section 02.
01 // Requirements
- OS — Ubuntu 22.04 LTS or Debian 12. Valheim dedicated server runs on Linux as a native binary; no Wine needed.
- Architecture — x86_64 only. ARM/aarch64 is not supported.
- Root or sudo access — needed for package install and systemd service creation.
- A Steam account — only if you want to use the server browser with a real name. The server itself runs anonymous via SteamCMD.
- Open UDP ports — 2456, 2457, 2458 (Valheim uses three consecutive ports).
- Disk space — 4 GB for the server binary, plus growing world saves (typically 50 MB to 500 MB per world depending on exploration).
- RAM — see sizing table below. Ashlands updates pushed vanilla usage up; 4 GB is the working minimum in 2026.
02 // Hardware Sizing — Choose Your Plan
Valheim is CPU-single-thread bound (the main simulation runs on one core), so clock speed matters more than core count. RAM usage scales with world size, player count, and mod stack. Use the table below to pick the right tier.
| Use case | Players | Mods | Recommended plan |
|---|---|---|---|
| Small Viking crew — vanilla | 2–4 | None | Hostinger KVM 1 — 4 GB RAM |
| Standard group — vanilla, Ashlands-capable | 4–10 | None or a few QoL | Hostinger KVM 2 — 8 GB RAM (recommended) |
| Modded group — BepInEx stack, ValheimPlus | 4–10 | 10–30 mods | Hostinger KVM 2 — 8 GB RAM |
| Heavy modded — EpicLoot, Jotunn content packs | 6–15 | 30+ mods, custom content | Hostinger KVM 4 — 16 GB RAM |
| Managed / beginner | Any | Limited | Nitrado — one-click |
You will see guides online recommending 2 GB VPS plans for Valheim. That may have worked in 2022, but since Hearth & Home, Mistlands, and Ashlands the server frequently sits at 3.0–3.5 GB RAM just hosting a small vanilla world. 2 GB plans OOM-kill under load. Don't go below 4 GB.
Hostinger KVM 2 — 2 vCPU, 8 GB RAM, 100 GB NVMe
The sweet spot for Valheim. Handles 4–10 players on a mature world with BepInEx mods without breaking a sweat. AMD EPYC single-thread performance is strong, which is exactly what Valheim's main-thread simulation needs. €8.49/month on a 12-month plan.
Get KVM 2 →Hostinger KVM 4 — 4 vCPU, 16 GB RAM, 200 GB NVMe
For Jotunn-based content packs, EpicLoot, or 30+ mods. Gives you RAM headroom so Garbage Collection pauses don't cause world lag spikes. €12.99/month.
Get KVM 4 →Nitrado — No Linux, no terminal
If this guide looks intimidating, Nitrado spins up a Valheim server in about two minutes. You pay a bit more per month, but you skip every step below. Good fit for casual groups who just want to play.
Get Nitrado →03 // Install SteamCMD
SteamCMD is Valve's command-line Steam client — it lets you download dedicated server software without a GUI. On a fresh Ubuntu 22.04 VPS:
# Create a dedicated non-root user for the server
sudo adduser --disabled-password --gecos "" valheim
sudo usermod -aG sudo valheim
# Enable i386 architecture (SteamCMD is 32-bit)
sudo dpkg --add-architecture i386
sudo apt update
# Install dependencies
sudo apt install -y software-properties-common
sudo add-apt-repository -y multiverse
sudo apt install -y lib32gcc-s1 libsdl2-2.0-0 libpulse0 libc6-i386 \
curl wget unzip tmux cron
# Switch to the valheim user
sudo -iu valheim
# Install SteamCMD in the user's home directory
mkdir -p ~/steamcmd && cd ~/steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
./steamcmd.sh +quit
Running SteamCMD and the Valheim server as root is a security risk — a compromised game server would give an attacker full system access. Create a valheim user and run everything under it. Every command in this guide assumes you're logged in as that user.
04 // Download the Valheim Dedicated Server
Valheim Dedicated Server is Steam app ID 896660 (separate from the game client, app 892970). It's free and anonymous login is supported — you don't need to own Valheim on your server's Steam account.
# Still as the valheim user
mkdir -p ~/valheim-server
cd ~/steamcmd
./steamcmd.sh \
+force_install_dir /home/valheim/valheim-server \
+login anonymous \
+app_update 896660 validate \
+quit
Download is around 1 GB. When it finishes you'll see Success! App 896660 fully installed. and your server directory looks like this:
~/valheim-server/
├── start_server.sh # the launch script you will edit
├── valheim_server.x86_64 # the server binary
├── steamapps/
├── valheim_server_Data/
└── ... (many more files)
Valheim gets patched frequently. Any time a new client version is released, players cannot connect until your server is also updated. Re-run the app_update 896660 validate command above to pull the latest build. We automate this with systemd later in this guide.
05 // Configure the Server
Valheim ships with a launch script called start_server.sh. Open it and you'll see a single launch line — this is where every server setting lives.
cd ~/valheim-server
nano start_server.sh
Replace the entire file with a clean, production-ready version:
#!/bin/bash
cd "$(dirname "$0")"
export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970
echo "Starting Valheim server..."
./valheim_server.x86_64 \
-nographics \
-batchmode \
-name "HostingBuff Valheim" \
-port 2456 \
-world "Midgard" \
-password "ChangeThisPassword" \
-public 1 \
-crossplay \
-savedir "/home/valheim/valheim-server/saves"
export LD_LIBRARY_PATH=$templdpath
Make it executable:
chmod +x start_server.sh
Every flag, explained
| Flag | Purpose |
|---|---|
-nographics | Disables Unity's graphics subsystem — required on a headless Linux VPS with no GPU. |
-batchmode | Unity headless mode — no window, no input, console output only. |
-name | Server name that appears in the server browser. Keep it short — long names get truncated. |
-port | Game port (UDP). Valheim uses this port and the next two (2456, 2457, 2458). Always specify the first of three. |
-world | World name — picks the save files in saves/worlds_local/. A new world is generated if it doesn't exist. |
-password | Server password. Minimum 5 characters, cannot contain the world name, or the server refuses to start. |
-public 1 | Lists your server in the community browser. Set to 0 for friends-only (join by IP). |
-crossplay | Enables Steam ↔ Xbox/Gamepass crossplay via PlayFab. Required if anyone in your group plays on Xbox or Gamepass. |
-savedir | Override save location. Useful for keeping saves outside the Steam install dir (survives validate/updates). |
Valheim silently rejects passwords that are shorter than 5 characters, or that contain the world name as a substring (case-insensitive). If your server dies on startup with "Invalid password", this is almost always why. Use a password that has no overlap with your world name.
First launch — test it works
Before we add mods or systemd, verify the server starts clean:
cd ~/valheim-server
./start_server.sh
On first run Valheim generates your world (30–90 seconds depending on seed). When you see:
Game server connected
Steam manager on server started
Server registered
it's live. Press Ctrl+C once to trigger a graceful shutdown (the server writes the world save before exiting — do not double-tap Ctrl+C or you risk a corrupt save).
06 // Install BepInEx for Server-Side Mods
BepInEx is the Unity mod loader that powers 95% of Valheim mods. The client version and server version are different — servers need the dedicated-server pack because they use a different launch hook.
Some mods are client-only (HUD tweaks, UI changes). Some are server-only (world-gen, spawn rate tuning). Many have both client and server halves that must match. Before installing anything on the server, check each mod's description on Thunderstore or Nexus for the "server-side" or "both" tag.
Download BepInEx Pack for Valheim
Denikson maintains the official Valheim BepInEx pack on Thunderstore. Grab the latest release:
cd ~/valheim-server
# Check latest version at https://valheim.thunderstore.io/package/denikson/BepInExPack_Valheim/
BEPINEX_VERSION="5.4.2202"
wget "https://gcdn.thunderstore.io/live/repository/packages/denikson-BepInExPack_Valheim-${BEPINEX_VERSION}.zip" -O bepinex.zip
unzip bepinex.zip -d bepinex-temp
# Move the contents of BepInExPack_Valheim/ into the server root
cp -r bepinex-temp/BepInExPack_Valheim/. .
# Clean up
rm -rf bepinex-temp bepinex.zip
# Make the BepInEx launch script executable
chmod +x start_server_bepinex.sh
You should now see these new files in ~/valheim-server/:
BepInEx/ # mod loader directory
plugins/ # drop mod .dll files here
config/ # mod configuration files
core/ # BepInEx internals
doorstop_libs/ # Unity injection library
start_server_bepinex.sh # new launch script (use this, not start_server.sh)
run_bepinex.sh # environment setup
Edit start_server_bepinex.sh
The BepInEx launch script is a wrapper that sets environment variables, then calls your server with your flags. Open it and find the line near the bottom that starts the game:
nano start_server_bepinex.sh
Replace the launch line with your configured version from earlier (keep all the BepInEx environment variables above it intact):
./valheim_server.x86_64 \
-nographics \
-batchmode \
-name "HostingBuff Valheim" \
-port 2456 \
-world "Midgard" \
-password "ChangeThisPassword" \
-public 1 \
-crossplay \
-savedir "/home/valheim/valheim-server/saves"
From this point forward you always launch via ./start_server_bepinex.sh, not ./start_server.sh. The BepInEx wrapper injects the mod loader and then hands off to the game.
Verify BepInEx loaded
Run the BepInEx launch script and watch the console output for these lines in the first 10 seconds:
[Message: BepInEx] BepInEx 5.4.22.0 - valheim_server
[Info : BepInEx] Running under Unity v2022.3.x
[Message: BepInEx] Preloader started
[Message: BepInEx] 0 patcher plugin(s) loaded
[Message: BepInEx] Chainloader ready
If you see those lines, mod loading is working. If you only see the vanilla Valheim startup output with no [BepInEx] lines, the doorstop didn't inject — verify start_server_bepinex.sh is executable and that you're running it, not start_server.sh.
07 // Install ValheimPlus
ValheimPlus is the most popular overhaul mod for Valheim — it adds building snap points, stack size tweaks, stamina/food balancing, crafting from chests, and roughly 200 other configurable features. Critically: ValheimPlus must be installed on both the server AND every connecting client, and the versions must match.
ValheimPlus has an enforceMod=true config line on the server side. When enabled, the server refuses connections from clients that don't have ValheimPlus installed. Turn this on if your group agreed everyone runs mods. Turn it off (enforceMod=false) if you want vanilla clients to be able to join a modded server — most ValheimPlus features still apply server-side regardless of what the client has.
Download and install
# From your valheim user's home, still in ~/valheim-server
cd ~/valheim-server
# Grab the latest release (check https://github.com/grantapher/ValheimPlus/releases for current version)
VPLUS_VERSION="0.9.13.2"
wget "https://github.com/grantapher/ValheimPlus/releases/download/${VPLUS_VERSION}/UnixServer.zip" -O valheimplus.zip
unzip valheimplus.zip -d valheimplus-temp
# Merge into the server install (overwrites/adds to BepInEx directory)
cp -r valheimplus-temp/. .
# Clean up
rm -rf valheimplus-temp valheimplus.zip
ValheimPlus drops its config file at:
~/valheim-server/BepInEx/config/valheim_plus.cfg
Key config settings for a server admin
Open BepInEx/config/valheim_plus.cfg and skim it — there are ~200 options grouped into sections. Here are the settings that matter most when you're hosting for a group:
| Section / key | What it does | Recommended |
|---|---|---|
[Server] enforceMod | Require clients to have ValheimPlus | true (if whole group agreed) |
[Items] enabled + stack values | Multiplies inventory stack sizes | Stack x4 is the sweet spot |
[Building] noInvalidPlacementRestriction | Allows building in any biome/terrain | false unless your group is builders |
[CraftFromChest] enabled | Pull materials from nearby chests when crafting | true (huge QoL) |
[Map] shareMapProgression | Automatically share map exploration between teammates | true for co-op groups |
[Player] autoPickUpRange | Distance items get auto-picked up | 2.5 is noticeable but not game-breaking |
[Fermenter] duration | Mead fermentation time (default 2400s) | 600 if your group plays short sessions |
[Smelter] fuel + ore values | Smelter capacity and speed | Double capacity, keep speed vanilla |
Editing valheim_plus.cfg on the server only takes effect after you restart the Valheim server process. There's no live reload. If you change it and nothing seems different in-game, you forgot to restart.
08 // Admin List, Ban List & Permitted List
Valheim uses three text files for access control. They live in your save directory (~/valheim-server/saves/ based on our -savedir flag):
| File | Purpose | Format |
|---|---|---|
adminlist.txt | Players granted admin commands (/kick, /ban, /save, /genloc, etc.) | One Steam ID or PlayFab ID per line |
bannedlist.txt | Players blocked from connecting | One Steam ID or PlayFab ID per line |
permittedlist.txt | Whitelist — if not empty, ONLY listed players can connect | One Steam ID or PlayFab ID per line |
Finding a player's Steam ID
The easiest way: have the player connect once. In your server console log you'll see their connect line with their Steam ID:
Got connection SteamID 76561198012345678
Copy that 17-digit number into adminlist.txt or bannedlist.txt. For Xbox/Gamepass players on crossplay servers, the ID will be a PlayFab ID instead — same process.
Live reload
Unlike the mod config, admin/ban/permitted lists are read on the fly. Edit the files and run /save in-game (or just wait — Valheim re-reads them on each connection attempt). No restart needed.
09 // Crossplay with Xbox & Game Pass
Valheim has full crossplay between Steam, Xbox, and Microsoft Game Pass (PC). If anyone in your group plays on a non-Steam platform, you need the -crossplay flag (which we already set).
With -crossplay enabled, Valheim registers the server with Microsoft's PlayFab service in addition to Steam. Xbox/Game Pass players find your server by Join Code — a 6-character code shown in the server console shortly after startup. Steam players can still browse by server name/IP.
Finding your Join Code
After startup, watch for this line in the console:
Join code: ABCDEF
Share that 6-character code with anyone on Xbox or Game Pass. They enter it in-game under Join game → Crossplay → Join by code.
This is the biggest gotcha with crossplay. Every time you restart the server, Valheim assigns a new join code. If you're restarting nightly for backups, bookmark a way to share the new code (Discord bot, pinned channel, etc.). There's no way to pin a permanent join code as of 2026.
Limitations
- No mods for crossplay clients — Xbox/Game Pass players cannot install BepInEx. If you enforce ValheimPlus on the server they can't join.
- Voice chat — Valheim has no built-in voice; use Discord or similar.
- Performance parity — Xbox Series S is the weakest platform; if your server runs heavily modded biomes (Ashlands fog, lots of entities), console clients may see frame drops.
10 // Auto-Start with systemd
Running your server inside a tmux session works for testing, but for production you want systemd — it restarts on crash, starts on boot, and handles shutdown cleanly.
# As a user with sudo privileges (not the valheim user)
sudo nano /etc/systemd/system/valheim.service
[Unit]
Description=Valheim Dedicated Server
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=valheim
Group=valheim
WorkingDirectory=/home/valheim/valheim-server
ExecStartPre=/home/valheim/steamcmd/steamcmd.sh +force_install_dir /home/valheim/valheim-server +login anonymous +app_update 896660 +quit
ExecStart=/home/valheim/valheim-server/start_server_bepinex.sh
Restart=on-failure
RestartSec=30
KillSignal=SIGINT
TimeoutStopSec=60
SuccessExitStatus=0 143
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
Valheim only writes its world save when it receives SIGINT (Ctrl+C equivalent). The default systemd stop signal is SIGTERM, which Valheim ignores — your world won't save. The KillSignal=SIGINT and TimeoutStopSec=60 lines ensure a graceful shutdown with enough time to write the save.
Enable and start it:
sudo systemctl daemon-reload
sudo systemctl enable valheim
sudo systemctl start valheim
# Watch the log
sudo journalctl -u valheim -f
Useful systemd commands:
sudo systemctl stop valheim # graceful stop (triggers world save)
sudo systemctl restart valheim # stop + auto-update + start
sudo systemctl status valheim # current state
sudo journalctl -u valheim --since "1 hour ago"
11 // Automate World Backups
Valheim worlds are two files: WorldName.db (the actual world data) and WorldName.fwl (metadata). A corrupt .db without a backup means the world is gone. Don't be that admin — automate backups from day one.
Backup script
sudo -iu valheim
mkdir -p ~/backups
nano ~/backup-world.sh
#!/bin/bash
# Valheim world backup rotator
set -euo pipefail
SAVE_DIR="/home/valheim/valheim-server/saves/worlds_local"
BACKUP_DIR="/home/valheim/backups"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
KEEP_DAYS=14
mkdir -p "$BACKUP_DIR"
# Create a dated tarball of all worlds
tar czf "$BACKUP_DIR/valheim-worlds-$TIMESTAMP.tar.gz" -C "$SAVE_DIR" .
# Prune backups older than $KEEP_DAYS days
find "$BACKUP_DIR" -name "valheim-worlds-*.tar.gz" -mtime +$KEEP_DAYS -delete
echo "Backup created: valheim-worlds-$TIMESTAMP.tar.gz"
chmod +x ~/backup-world.sh
# Run once to verify it works
~/backup-world.sh
ls -la ~/backups/
Schedule with cron
crontab -e
Add these lines:
# Hourly world backup
0 * * * * /home/valheim/backup-world.sh >> /home/valheim/backup.log 2>&1
# Nightly server restart at 5 AM (auto-updates via systemd ExecStartPre)
0 5 * * * /usr/bin/systemctl restart valheim
If your VPS dies or gets compromised, local backups die with it. For a few cents a month you can push the tarballs to Backblaze B2, Cloudflare R2, or a second VPS with rsync. Add this line to the end of backup-world.sh: rclone copy "$BACKUP_DIR/valheim-worlds-$TIMESTAMP.tar.gz" b2:my-bucket/valheim/. Set up rclone with rclone config first.
12 // Firewall & Ports
Valheim uses UDP ports 2456, 2457, and 2458. Open all three on the VPS firewall:
sudo ufw allow 2456:2458/udp
sudo ufw allow 22/tcp # keep SSH open
sudo ufw enable
sudo ufw status verbose
If you changed the -port flag to something other than 2456, open that port plus the next two. Example: -port 3000 means you open 3000, 3001, 3002.
On Hostinger VPS plans the Linux ufw rules are the only firewall — no dashboard config needed. On Nitrado, ports are managed automatically for the game you picked. If you're on a different provider that has a cloud-side firewall (AWS security groups, DigitalOcean cloud firewall, etc.), add the UDP rule there too.
13 // Interactive Config Generator
Use the tool below to generate a ready-to-paste start_server_bepinex.sh launch line tailored to your group. Pick your options and the script updates live.
14 // Troubleshooting
The ten problems below account for the vast majority of questions on the Valheim subreddit and the denikson/grantapher issue trackers. Search for your symptom in the Problem column:
| Problem | Cause / Fix |
|---|---|
| Server immediately exits on startup: "Invalid password" | Password is under 5 characters OR contains the world name. Change password to something unrelated to the world name, 5+ chars. |
| Server not visible in community browser after 10 minutes | UDP ports not open on firewall, or server is behind NAT. Check sudo ufw status and your VPS provider's cloud firewall. Also try joining by direct IP: in-game Join IP → your.vps.ip:2456. |
BepInEx not loading — no [BepInEx] lines in console |
You're launching start_server.sh instead of start_server_bepinex.sh. Also check that doorstop_libs/libdoorstop_x64.so exists and is readable. |
| Crossplay clients can't see the join code | Outbound connectivity to PlayFab is blocked. Make sure outbound HTTPS (port 443) to *.playfab.com is allowed. Also verify -crossplay is in your launch flags. |
| World won't save after stop / systemd restart | systemd is killing the server with SIGTERM instead of SIGINT. Add KillSignal=SIGINT and TimeoutStopSec=60 to the service file (we do this in our systemd example). Restart the service after editing. |
| ValheimPlus installed but features not applying | Each feature section in valheim_plus.cfg has its own enabled=false line that defaults to off. You must set enabled=true per section AND restart the server. |
| High CPU usage, sluggish entities in late game | Valheim's main thread is single-core bound. Upgrade to a VPS with higher single-thread clock (Hostinger KVM's EPYC instances are strong here). Also prune old waystone/portal entities — thousands of stale ones slow the server. |
| Players randomly disconnect with "Connection timeout" | Usually packet loss between client and server. Check MTU (should be 1500 default), check VPS provider DDoS protection isn't misclassifying traffic. If only one player has the issue, it's their ISP. |
| Server says "outdated" even after SteamCMD update | Client updated faster than Steam pushed server binaries. Wait 15–60 minutes, re-run the app_update 896660 validate command. Our systemd ExecStartPre does this on every start. |
| World file corrupted, world won't load | Restore from your latest ~/backups/valheim-worlds-*.tar.gz. Valheim keeps automatic .old rollbacks next to .db and .fwl — rename those to replace the broken files if they're recent enough. |
15 // Next Steps
- Centralized panel management — move to Pterodactyl or AMP when you're running multiple game servers
- Automate updates safely — LinuxGSM has a Valheim module with one-command updates and backups if you prefer a maintained CLI wrapper
- Secure your VPS — Windows server setup guide (similar hardening applies to Linux)
- Related game servers — Rust, Minecraft Java, ARK
- Plan for wipes and fresh starts — our wipe mechanics guide covers concepts that apply to Valheim world resets too