valheim-server

by kriegalex

Helm chartv1.3.0App 3.1.0Verified publisher

A Helm chart for deploying a Valheim dedicated server on Kubernetes

About this chart

valheim-server

A Helm chart for deploying a Valheim dedicated server on Kubernetes

Homepage: https://www.valheimgame.com/

Maintainers

NameEmailUrl
kriegalex[email protected]

Source Code

Overview

This Helm chart deploys a Valheim dedicated server based on the mbround18/valheim-docker project.

Features

  • Configurable server settings
  • Automatic updates and backups
  • Discord webhook notifications
  • Persistent storage for game saves, server files, and backups
  • Resource management for Kubernetes

Prerequisites

  • Kubernetes 1.29+
  • Helm 3.16.0+
  • PV provisioner support in the underlying infrastructure (for persistent storage)
  • LoadBalancer support or an Ingress controller

TL;DR

helm repo add k8s-charts https://kriegalex.github.io/k8s-charts/
helm install my-valheim-server k8s-charts/valheim-server

Important Security Notice

The default values for this chart include a placeholder password. For production use:

  1. Always specify a secure password
  2. Consider using Kubernetes secrets for sensitive values
  3. Restrict access to your server using appropriate network policies

Installation

Simple Install with Custom Password and Server Name

helm upgrade --install my-valheim-server \
  --set server.password="YourStrongPassword" \
  --set server.name="Your Awesome Valheim Server" \
  k8s-charts/valheim-server

Custom Configuration File

Create a YAML file with your custom values:

server:
  name: "My Custom Valheim Server"
  password: "SuperSecretPassword"
  world: "MyWorld"
  public: 1
 
persistence:
  saves:
    size: 5Gi
  backups:
    size: 20Gi
   
automation:
  autoBackup: 1  # disabled by default
  autoBackupSchedule: "*/30 * * * *"
 
resources:
  requests:
    memory: 4Gi
    cpu: 2000m
  limits:
    memory: 12Gi
    cpu: 4000m

Then install the chart:

helm install my-valheim-server -f my-values.yaml k8s-charts/valheim-server

Updating

helm upgrade my-valheim-server k8s-charts/valheim-server

Uninstallation

helm uninstall my-valheim-server

Note: This will not delete the Persistent Volume Claims. To delete them:

kubectl delete pvc -l app.kubernetes.io/instance=my-valheim-server

Troubleshooting

Failed to install app '896660' (Missing configuration) on first boot

On a brand-new deployment the container may log a SteamCMD error like Failed to install app '896660' (Missing configuration) and the pod may restart once or twice before the server comes up. This is a known, transient SteamCMD behaviour (it self-updates and restarts on the first run, completing the app install on a subsequent attempt) — it is not specific to this chart and also happens with plain docker run of the upstream image. The pod recovers on its own; with persistence enabled the already-downloaded server files are reused, so later restarts skip the install entirely. If it does not recover, check that the server PVC has enough free space (the game needs a few GB).

Modding (BepInEx)

Set modding.bepInEx: 1 to start the server with TYPE=BepInEx, and list mods in modding.mods (Thunderstore Author-Package-Version strings or direct URLs). Mods and their configuration are stored under BepInEx/ inside the persistent server PVC, so they survive pod restarts. Note: BepInEx mods are mutually exclusive with crossplay — with server.crossplay: 1, Valheim uses PlayFab networking, which BepInEx cannot hook, so mods will not load.

Values

KeyTypeDefaultDescription
affinityobject{}Affinity for pod assignment
automation.autoBackupint0Enable automatic backups (1=enabled, 0=disabled)
automation.autoBackupDaysToLiveint7Number of days to keep backups
automation.autoBackupOnShutdownint0Create backup on server shutdown (1=enabled, 0=disabled)
automation.autoBackupOnUpdateint1Create backup before updates (1=enabled, 0=disabled)
automation.autoBackupRemoveOldint1Remove old backups automatically (1=enabled, 0=disabled)
automation.autoBackupSchedulestring"*/15 * * * *"Cron schedule for automatic backups
automation.autoUpdateint1Enable automatic updates (1=enabled, 0=disabled)
automation.autoUpdateSchedulestring"0 1 * * *"Cron schedule for automatic updates
automation.scheduledRestartint0Enable a scheduled server restart (1=enabled, 0=disabled)
automation.scheduledRestartSchedulestring"0 2 * * *"Cron schedule for the scheduled restart
automation.updateOnStartupint0Update server when container starts (1=enabled, 0=disabled)
extraEnvlist[]Additional environment variables for the Valheim server
fullnameOverridestring""Provide a full name override for resources
image.pullPolicystring"IfNotPresent"Image pull policy
image.repositorystring"mbround18/valheim"Docker repository to use
image.tagstring""Docker tag to use - use "latest" for most current version
initContainersobject{"args":[],"command":[],"enabled":false,"image":"busybox:latest"}Init container configuration for server preparation
initContainers.argslist[]Init container arguments
initContainers.commandlist[]Init container command
initContainers.enabledboolfalseEnable init container
initContainers.imagestring"busybox:latest"Init container image
livenessProbe.enabledboolfalseEnable liveness probe
livenessProbe.failureThresholdint6 (allows up to 2 minutes for recovery)Failure threshold
livenessProbe.initialDelaySecondsint60Initial delay seconds
livenessProbe.periodSecondsint20Period seconds
livenessProbe.timeoutSecondsint5Timeout seconds
modding.bepInExint0Enable BepInEx mod loader (1=enabled, 0=disabled). When enabled, sets the container's TYPE=BepInEx. Mods and their config live in the persistent server PVC under BepInEx/, so they survive pod restarts.
modding.modslist[]List of mods for the container to download on startup (requires bepInEx=1). Each entry is a Thunderstore dependency string (Author-Package-Version) or a direct URL. Supported files: zip, dll, cfg.
nameOverridestring""Provide a name override for resources
nodeSelectorobject{}Node selector for pod assignment
notifications.includePublicIpint0Include the server's public IP in notifications (1=enabled, 0=disabled)
notifications.webhookUrlstring""Discord webhook URL for server notifications
persistence.backups.accessModestring"ReadWriteOnce"Access mode for the PVC
persistence.backups.existingClaimstring""Existing claim to use (leave empty to create a new one)
persistence.backups.sizestring"10Gi"Size of PVC for backups
persistence.enabledbooltrueEnable persistent storage for server data
persistence.saves.accessModestring"ReadWriteOnce"Access mode for the PVC
persistence.saves.existingClaimstring""Existing claim to use (leave empty to create a new one)
persistence.saves.sizestring"1Gi"Size of PVC for game saves
persistence.server.accessModestring"ReadWriteOnce"Access mode for the PVC
persistence.server.existingClaimstring""Existing claim to use (leave empty to create a new one)
persistence.server.sizestring"4Gi"Size of PVC for server files
persistence.storageClassstringuse default storage classStorage class to use (use null for default or "" for no storage class)
podSecurityContext.fsGroupint1000File system group ID for volume mounts
readinessProbe.enabledbooltrueEnable readiness probe
readinessProbe.failureThresholdint20 (allows up to 5 minutes for readiness)Failure threshold
readinessProbe.initialDelaySecondsint60Initial delay seconds
readinessProbe.periodSecondsint15Period seconds
readinessProbe.timeoutSecondsint5Timeout seconds
replicaCountint1Number of replicas to deploy (should typically stay at 1)
resourcesobject{}Resource requests and limits
securityContext.runAsGroupint1000Group ID to run the container processes
securityContext.runAsNonRootbooltrueForce the container to run as a non-root user
securityContext.runAsUserint111User ID to run the container processes. Should default to the steam user ID.
server.crossplayint0Enable crossplay/PlayFab networking (1=enabled, 0=disabled). NOTE: crossplay is mutually exclusive with BepInEx mods — with crossplay on, mods will not load.
server.existingSecretstring""Name of an existing Secret providing the server password instead of password. The Secret must contain a server-password key. When set, the chart does not render its own Secret and password is ignored — keeps the password out of Helm values entirely.
server.modifiersstring""World modifiers as space-separated "key value" pairs (e.g. "combat veryhard portals casual"). Leave empty to skip.
server.namestring"Valheim Server with Helm"Server name as displayed in-game
server.passwordstringyou MUST change this valueServer access password (minimum 5 characters)
server.portint2456UDP port for game server (will use PORT, PORT+1, and PORT+2)
server.presetstring""World preset (e.g. Normal, Casual, Hard, Hardcore, Immersive, Hammer). Leave empty to skip.
server.publicint0Set to 1 to make server visible publicly, 0 for private
server.setKeystring""Global keys to set (e.g. "nobuildcost,nomap"). Leave empty to skip.
server.timezonestring"UTC"Timezone for the server
server.worldstring"Dedicated"World name used for save files
service.annotationsobject{}Annotations for the service
service.loadBalancerIPstring""Set specific load balancer IP (depends on cloud provider support)
service.loadBalancerSourceRangeslist[]External source IP ranges allowed to access the server
service.nodePorts.gamestring""NodePort for the game port (server.port)
service.nodePorts.game1string""NodePort for server.port + 1
service.nodePorts.game2string""NodePort for server.port + 2
service.typestring"LoadBalancer"Service type
startupProbe.enabledbooltrueEnable startup probe
startupProbe.failureThresholdint30 (allows up to 5 minutes for initial startup)Failure threshold
startupProbe.initialDelaySecondsint30Initial delay seconds
startupProbe.periodSecondsint10Period seconds
startupProbe.timeoutSecondsint5Timeout seconds
terminationGracePeriodSecondsint120Grace period (seconds) for the pod to shut down. Gives the server time to save the world and run an optional shutdown backup before being force-killed.
tolerationslist[]Tolerations for pod assignment

Autogenerated from chart metadata using helm-docs v1.14.2

Deploy valheim-server with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has valheim-server on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartvalheim-server is pinned at v1.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply