theoriginalbrian/phvalheim-server

By theoriginalbrian

Updated 3 months ago

An over-engineered approach to Valheim server+client world+mods management

Image
Networking
Integration & delivery
Content management system
0

10K+

theoriginalbrian/phvalheim-server repository overview

PhValheim

PhValheim Server

The Valheim world and mod manager that keeps everyone in sync.

Docker Unraid Steam Open Source Discord


The Problem

Modding Valheim is easy. Keeping mods perfectly in sync across your server and every player? Nearly impossible. Mod managers like Thunderstore work great individually, but they don't coordinate across a group — eventually someone's client drifts out of sync and the session breaks.

The Solution

PhValheim is a two-part system (server + client) that locks server and client mod configurations together. Deploy worlds with any combination of Thunderstore mods, and every player automatically gets the exact same files when they connect. No more "which version do you have?" conversations.


Features

One-Click WorldsDeploy unique Valheim worlds with any combination of Thunderstore mods at the click of a button.
Automatic Mod SyncServer and client mods stay in lock-step. Players always have the right files.
Setup WizardGuided first-run configuration — just start the container and follow the steps. No environment variables required.
Steam AuthenticationPlayers log in with their Steam account. Per-world access control lists manage who can see and join each world.
Thunderstore IntegrationFull Thunderstore mod catalog synced every 12 hours. Search, select, and deploy mods with dependency resolution built in.
Automatic BackupsAll worlds backed up every 30 minutes. Configurable retention. Supports separate backup volumes for disaster recovery.
Live MonitoringReal-time CPU, memory, and load metrics for every running world, visible in both the admin and public UIs.
AI HelperBuilt-in AI-powered log analysis (OpenAI, Gemini, Claude, or self-hosted Ollama). Identifies mod errors, missing dependencies, and server health issues.
Custom ConfigsPush custom configuration files to clients, or keep server-only configs that persist across updates.
Single ContainerEverything runs in one Docker container — NGINX, PHP, MariaDB, Supervisor, and the PhValheim engine.

Screenshots

Admin Dashboard
Admin Home
World & Mod Editor
World and Mods Editor
Citizens Editor
Citizens Editor
Log Viewer & AI Analysis
Engine Logs AI Helper

Quick Start

services:
  phvalheim:
    image: theoriginalbrian/phvalheim-server:latest
    container_name: phvalheim
    ports:
      - "8080:8080/tcp"    # Public UI
      - "8081:8081/tcp"    # Admin UI (do NOT expose publicly)
      - "25000-26000:25000-26000/udp"  # Game ports
    volumes:
      - /path/to/data:/opt/stateful:Z
      - /path/to/backups:/opt/stateful/backups:Z   # ideally a separate disk
    restart: unless-stopped

That's it. Start the container and open http://your-host:8081 — the Setup Wizard will walk you through configuration.

Docker CLI
docker create \
  --name phvalheim \
  -p 8080:8080/tcp \
  -p 8081:8081/tcp \
  -p 25000-26000:25000-26000/udp \
  -v /path/to/data:/opt/stateful:Z \
  -v /path/to/backups:/opt/stateful/backups:Z \
  theoriginalbrian/phvalheim-server:latest

docker start phvalheim
Unraid

PhValheim Unraid Icon Search for PhValheim in the Community Apps store.


Configuration

All settings are configured through the Admin UI after first launch. No environment variables are needed for new installations.

Upgrading from an older version? Your existing environment variables will be automatically migrated to the database on first boot. A one-time migration notice will confirm the imported values.

Server Settings
SettingDescription
Steam API KeyRequired. Used for player authentication. Get one here.
PhValheim HostPublic FQDN for the web UI.
Game DNSDNS name players use to connect to game servers. Can be the same as PhValheim Host.
Base PortFirst UDP port for worlds (must match the container's port range).
Backups to KeepNumber of backup snapshots to retain per world.
Client Download URLURL for the PhValheim Client installer.
AI Helper (Optional)

Configure one or more AI providers in Server Settings to enable the built-in log analysis assistant.

ProviderWhat you need
OpenAIAPI key — enables GPT-4o models
Google GeminiAPI key — enables Gemini 2.0 Flash and Gemini 1.5 Pro
Anthropic ClaudeAPI key — enables Claude Haiku 4.5 and Claude Sonnet 4.5
OllamaURL of your self-hosted instance — models detected automatically

Volumes

Container PathPurpose
/opt/statefulAll persistent data — worlds, mods, database, configuration.
/opt/stateful/backupsWorld backups. Point this to a separate disk for safety.

Ports

PortPurpose
8080/tcpPublic web UI — expose this to your players.
8081/tcpAdmin web UI — keep this private.
25000-26000/udpGame server port range for Valheim worlds.

PhValheim Client

The server is only half the equation. PhValheim Client is a companion Windows app that registers a custom phvalheim:// URL protocol. When a player clicks a launch link:

  1. The client compares the remote world's checksum against the local copy.
  2. If outdated, it downloads the new payload (mods, configs, dependencies).
  3. It launches Valheim, connecting to the correct server and world automatically.

Client files install to %appdata%/PhValheim and add the BepInEx bootstrap to your Valheim Steam directory.


Architecture

High Level

PhValheim Architecture

Authentication & Authorization

PhValheim Steam Auth

Access to each world is controlled by the PhValheim database. Steam IDs are associated with each world, gating both the web UI (world visibility) and the game server allow-list.


Reverse Proxy (Optional)

Example NGINX config for TLS termination:

server {
    listen 80;
    server_name phvalheim.example.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name phvalheim.example.com;

    ssl_certificate     /path/to/fullchain.pem;
    ssl_certificate_key /path/to/privkey.pem;

    location / {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_read_timeout 1200s;
        client_max_body_size 0;
    }
}

Custom Config Folders

FolderBehavior
custom_configs/Pushed to clients on world update. Use for shared game configs.
custom_configs_secure/Server-only. Persists across updates but never sent to clients.

PSA: Mods & Stability

PhValheim makes mod management effortless, but not all mods play well together. If you're experiencing crashes or unexpected behavior, deploy a vanilla world (no mods) first to rule out mod conflicts. Most mod issues occur after major Valheim updates.


Join the Discord · Report an Issue · PhValheim Client

Tag summary

Content type

Image

Digest

sha256:258186d4f

Size

327.3 MB

Last updated

3 months ago

docker pull theoriginalbrian/phvalheim-server:rc