๐ณ Valheim dedicated server in Docker โ Zero setup, runs on Linux.
English ยท ไธญๆ
- โ One-command installation
- โ Automatic updates
- โ Full configuration support (all Valheim server options)
- โ World modifiers (presets, custom modifiers, seed)
- โ Data persistence
- โ Bilingual support (English/Chinese)
- Linux (tested on Ubuntu/Debian)
- Docker & Docker Compose
- 2GB+ free disk space
- Network access
git clone <repository-url>
cd Valheim-Crate
cp compose.example.yml compose.yml
nano compose.yml # Set SERVER_NAME and SERVER_PASSWORD./server.sh install./server.sh start| Command | Description |
|---|---|
install |
Build environment & download game files (No auto-start) |
update |
Safe update: Stop -> Update files -> Ready to start |
start |
Start server (Requires install first) |
stop |
Safely stop server (Waits for world save) |
restart |
Validate config -> Stop -> Start |
status |
Show resource usage, config, and port status |
remove |
Remove container/image (Data preserved) |
Default: ./server.sh (Shows help menu)
Edit compose.yml (copied from compose.example.yml). All settings via environment variables.
Note: compose.yml is gitignored to protect your passwords.
environment:
SERVER_SAVE_DIR: "/valheim/saves"
SERVER_LOGFILE: "/valheim/log.txt"environment:
SERVER_PORT: 2456 # Default: 2456
SERVER_WORLD: "Dedicated" # Default: Dedicated
SERVER_PUBLIC: 1 # 1=public, 0=private
SERVER_SAVE_DIR: "/valheim/saves"
SERVER_LOGFILE: "/valheim/log.txt"
SERVER_SEED: "your-seed" # Optional. โ ๏ธ NOTE: Requires './server.sh restart' after first run to apply!Option 1: Preset (Recommended for beginners)
SERVER_PRESET: "hard" # Normal, Casual, Easy, Hard, Hardcore, Immersive, HammerDefault: Normal (if nothing set)
Option 2: Custom Modifiers
SERVER_MODIFIER: "raids:none,combat:hard,resources:more"| Available | Value |
|---|---|
| combat | veryeasy, easy, hard, veryhard |
| deathpenalty | casual, veryeasy, easy, hard, hardcore |
| resources | muchless, less, more, muchmore, most |
| raids | none, muchless, less, more, muchmore |
| portals | casual, hard, veryhard |
Option 3: Checkbox Keys
SERVER_SETKEY: "nomap,nobuildcost" # nobuildcost, playerevents, passivemobs, nomapCombinations:
- โ
SERVER_MODIFIER+SERVER_SETKEY(recommended) โ ๏ธ SERVER_PRESET+SERVER_MODIFIER(preset overwrites modifiers)
SERVER_SAVEINTERVAL: 1800 # Save interval (seconds, default: 1800)
SERVER_BACKUPS: 4 # Backup count (default: 4)
SERVER_BACKUPSHORT: 7200 # Short backup interval (default: 7200)
SERVER_BACKUPLONG: 43200 # Long backup interval (default: 43200)
SERVER_CROSSPLAY: 1 # Enable crossplay (0=Steam only, 1=Crossplay)
SERVER_INSTANCEID: "1" # Unique ID for multiple serversData Location: /opt/server/valheim (persists after container removal)
Port Forwarding:
- Steam backend (default): Forward UDP 2456-2457
- Crossplay (
SERVER_CROSSPLAY: 1): Not required
docker compose logs -f valheim # Container logs
docker compose exec valheim cat /valheim/log.txt # Server logs (if configured)๐ฆ Valheim-Crate/
โโโ ๐ณ Dockerfile # Docker image definition
โโโ ๐ compose.example.yml # Example configuration (copy to compose.yml)
โโโ ๐ซ compose.yml # Your local config (gitignored)
โโโ ๐ฎ server.sh # Main management script
โโโ ๐ README.md # English documentation
โโโ ๐ README.zh.md # Chinese documentation
โโโ ๐ซ .gitignore # Git ignore rules
โโโ ๐ scripts/
โโโ โ๏ธ setup.sh # Install/update server files
โโโ ๐ start.sh # Start Valheim server
- CI/CD Integration: Implement GitHub Actions for automated testing (ShellCheck, Go Test) and Docker image building.
- Docker Registry: Publish images to Docker Hub and GHCR (GitHub Container Registry) to support
docker pulldirectly. - Unit Tests: Add comprehensive Go tests for the binary patcher (
seed.go) and BATS tests for shell scripts.
- Cloud Backup: Add support for auto-syncing save files to cloud storage (S3, MinIO, WebDAV).
- Webhook Notifications: Integrate webhooks for Discord, Telegram, and DingTalk to notify server status changes (Start/Stop/IP).
- Visual Logs: Improve the startup log output with better visualization and progress indicators.
- Native FWL Generator: Research Valheim's file structure to generate
.fwlworld files directly in Go, removing the dependency on the game process for world generation (True instant setup without restart).
