docker.recipes

Valheim Dedicated Server + Status Page

intermediate

Valheim dedicated server with automatic updates, backups, and status monitoring.

Overview

The Valheim dedicated server (lloesche/valheim-server) is a containerized solution that runs Iron Gate Studio's popular Viking survival game server without requiring the full Steam client or GUI interface. This Docker image handles automatic game updates, world persistence, backup management, and server configuration through environment variables, making it ideal for hosting persistent multiplayer worlds that run independently of player sessions. This stack combines the Valheim server with aldjinn/valheim-status for real-time server monitoring and NGINX as a reverse proxy to create a complete hosting solution. The status component provides web-based visibility into server health, player counts, and world information, while NGINX handles HTTP traffic routing and can serve as an entry point for additional web services. The lloesche image includes built-in backup functionality with configurable retention policies and automatic Steam workshop mod support. Gamers running private servers for their communities, homelab enthusiasts hosting game servers, and small gaming clans will find this stack particularly valuable. The combination eliminates the need for manual server management while providing transparency into server status - crucial for coordinating multiplayer sessions and troubleshooting connectivity issues without requiring direct server access.

Key Features

  • Automatic Valheim server updates via Steam CMD with configurable cron scheduling (default every 15 minutes)
  • Built-in world backup system with customizable retention policies and hourly backup scheduling
  • Real-time server status monitoring showing player count, world name, and server health metrics
  • Steam workshop mod support with automatic mod downloading and updating
  • BepInEx mod framework integration for server-side modifications and plugins
  • RCON protocol support for remote server administration and command execution
  • World seed and difficulty configuration through environment variables
  • NGINX reverse proxy setup for serving multiple web interfaces from a single port

Common Use Cases

  • 1Private gaming communities hosting persistent Valheim worlds for clan members
  • 2Content creators running modded Valheim servers for streaming and video production
  • 3Gaming server providers offering managed Valheim hosting services
  • 4Homelab enthusiasts learning containerized game server deployment and management
  • 5Educational environments teaching server administration through gaming contexts
  • 6Remote friend groups maintaining a shared Viking world across different time zones
  • 7Gaming cafes or local businesses providing hosted multiplayer experiences

Prerequisites

  • Minimum 4GB RAM available (Valheim server requires 2-3GB, additional overhead for monitoring)
  • UDP ports 2456-2458 forwarded through firewall and router for client connections
  • SERVER_PASS environment variable set with minimum 5 characters for server access
  • Docker host with at least 8GB disk space for world saves and backup retention
  • Basic understanding of Valheim server administration and player management
  • Network configuration knowledge for port forwarding and firewall rules

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 valheim:
3 image: lloesche/valheim-server
4 environment:
5 - SERVER_NAME=${SERVER_NAME:-My Valheim Server}
6 - WORLD_NAME=${WORLD_NAME:-Dedicated}
7 - SERVER_PASS=${SERVER_PASS}
8 - SERVER_PUBLIC=true
9 - UPDATE_CRON=*/15 * * * *
10 - BACKUPS=true
11 - BACKUPS_CRON=0 * * * *
12 - BACKUPS_MAX_AGE=7
13 - BACKUPS_MAX_COUNT=10
14 volumes:
15 - valheim-config:/config
16 - valheim-data:/opt/valheim
17 ports:
18 - "2456-2458:2456-2458/udp"
19 cap_add:
20 - SYS_NICE
21 networks:
22 - valheim-network
23 restart: unless-stopped
24
25 status:
26 image: aldjinn/valheim-status:latest
27 environment:
28 - SERVER_HOST=valheim
29 - SERVER_PORT=2457
30 ports:
31 - "13080:80"
32 depends_on:
33 - valheim
34 networks:
35 - valheim-network
36 restart: unless-stopped
37
38 nginx:
39 image: nginx:alpine
40 volumes:
41 - ./nginx.conf:/etc/nginx/nginx.conf:ro
42 ports:
43 - "80:80"
44 depends_on:
45 - status
46 networks:
47 - valheim-network
48 restart: unless-stopped
49
50volumes:
51 valheim-config:
52 valheim-data:
53
54networks:
55 valheim-network:
56 driver: bridge

.env Template

.env
1# Valheim Server
2SERVER_NAME=My Valheim Server
3WORLD_NAME=Dedicated
4SERVER_PASS=minimum5chars
5
6# Backup settings in compose environment

Usage Notes

  1. 1Game server on UDP 2456-2458
  2. 2Status page at http://localhost:13080
  3. 3Automatic updates every 15 minutes
  4. 4Hourly backups with 7-day retention
  5. 5Server password minimum 5 characters

Individual Services(3 services)

Copy individual services to mix and match with your existing compose files.

valheim
valheim:
  image: lloesche/valheim-server
  environment:
    - SERVER_NAME=${SERVER_NAME:-My Valheim Server}
    - WORLD_NAME=${WORLD_NAME:-Dedicated}
    - SERVER_PASS=${SERVER_PASS}
    - SERVER_PUBLIC=true
    - UPDATE_CRON=*/15 * * * *
    - BACKUPS=true
    - BACKUPS_CRON=0 * * * *
    - BACKUPS_MAX_AGE=7
    - BACKUPS_MAX_COUNT=10
  volumes:
    - valheim-config:/config
    - valheim-data:/opt/valheim
  ports:
    - 2456-2458:2456-2458/udp
  cap_add:
    - SYS_NICE
  networks:
    - valheim-network
  restart: unless-stopped
status
status:
  image: aldjinn/valheim-status:latest
  environment:
    - SERVER_HOST=valheim
    - SERVER_PORT=2457
  ports:
    - "13080:80"
  depends_on:
    - valheim
  networks:
    - valheim-network
  restart: unless-stopped
nginx
nginx:
  image: nginx:alpine
  volumes:
    - ./nginx.conf:/etc/nginx/nginx.conf:ro
  ports:
    - "80:80"
  depends_on:
    - status
  networks:
    - valheim-network
  restart: unless-stopped

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 valheim:
5 image: lloesche/valheim-server
6 environment:
7 - SERVER_NAME=${SERVER_NAME:-My Valheim Server}
8 - WORLD_NAME=${WORLD_NAME:-Dedicated}
9 - SERVER_PASS=${SERVER_PASS}
10 - SERVER_PUBLIC=true
11 - UPDATE_CRON=*/15 * * * *
12 - BACKUPS=true
13 - BACKUPS_CRON=0 * * * *
14 - BACKUPS_MAX_AGE=7
15 - BACKUPS_MAX_COUNT=10
16 volumes:
17 - valheim-config:/config
18 - valheim-data:/opt/valheim
19 ports:
20 - "2456-2458:2456-2458/udp"
21 cap_add:
22 - SYS_NICE
23 networks:
24 - valheim-network
25 restart: unless-stopped
26
27 status:
28 image: aldjinn/valheim-status:latest
29 environment:
30 - SERVER_HOST=valheim
31 - SERVER_PORT=2457
32 ports:
33 - "13080:80"
34 depends_on:
35 - valheim
36 networks:
37 - valheim-network
38 restart: unless-stopped
39
40 nginx:
41 image: nginx:alpine
42 volumes:
43 - ./nginx.conf:/etc/nginx/nginx.conf:ro
44 ports:
45 - "80:80"
46 depends_on:
47 - status
48 networks:
49 - valheim-network
50 restart: unless-stopped
51
52volumes:
53 valheim-config:
54 valheim-data:
55
56networks:
57 valheim-network:
58 driver: bridge
59EOF
60
61# 2. Create the .env file
62cat > .env << 'EOF'
63# Valheim Server
64SERVER_NAME=My Valheim Server
65WORLD_NAME=Dedicated
66SERVER_PASS=minimum5chars
67
68# Backup settings in compose environment
69EOF
70
71# 3. Start the services
72docker compose up -d
73
74# 4. View logs
75docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/valheim-server-complete/run | bash

Troubleshooting

  • Players cannot connect to server: Verify UDP ports 2456-2458 are forwarded and SERVER_PUBLIC is set to true
  • Server fails to start with 'SteamCMD failed': Check internet connectivity and Steam service status, restart container
  • World saves corrupted after container restart: Ensure valheim-data volume is properly mounted and not using tmpfs
  • Status page shows server offline: Verify valheim container is running and SERVER_HOST points to correct service name
  • Backup process failing with permission errors: Add proper user ID mapping or check volume mount permissions
  • High memory usage causing container kills: Increase Docker host memory or adjust BACKUPS_MAX_COUNT to reduce retention

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space