A Docker-based Stardew Valley dedicated server with cross-platform multiplayer support.
一键部署星露谷物语专用服务器,支持全平台联机
Quick Start
Step 1: Create docker-compose.yml
yaml
version: '3.8'
services:
stardew-server:
image: truemanlive/puppy-stardew-server:latest
container_name: puppy-stardew
restart: unless-stopped
stdin_open: true
tty: true
environment:
# Required: Your Steam credentials
- STEAM_USERNAME=your_steam_username
- STEAM_PASSWORD=your_steam_password
# Optional: VNC for initial setup
- ENABLE_VNC=true
- VNC_PASSWORD=stardew123
ports:
- "24642:24642/udp" # Game port (required)
- "5900:5900/tcp" # VNC port (optional)
volumes:
- ./data/saves:/home/steam/.config/StardewValley:rw
- ./data/game:/home/steam/stardewvalley:rw
- ./data/steam:/home/steam/Steam:rw
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G
reservations:
memory: 1G
Step 2: Set Directory Permissions (IMPORTANT)
The data directories must be owned by UID 1000:
bash
mkdir -p data/{saves,game,steam}
chown -R 1000:1000 data/
Step 3: Start Server
bash
docker compose up -d
docker logs -f puppy-stardew
Step 4: Initial Setup (First Run Only)
Connect to VNC at your-server-ip:5900 (password: stardew123)
Create or load a save file
Done! Server will auto-load this save on future restarts
Players can now connect via: Game → Co-op → Join LAN Game → your-server-ip:24642
Key Features
One-Command Deployment - docker compose up -d and you're ready
Cross-Platform Support - PC, Mac, Linux, iOS, Android all supported
24/7 Dedicated Server - Runs independently without host player interaction
Auto-Save Loading - Automatically loads your save on server restart
Resource Efficient - Runs smoothly on just 2GB RAM
VNC Remote Access - Built-in VNC for easy first-time setup
Instant Sleep - Players can sleep anytime without waiting for others
Hidden Host - Host player automatically hidden for seamless gameplay
Natural Skill Progression - Prevents forced Level 10, preserves real XP-based leveling
Requirements
Server Side
Docker and Docker Compose installed
2GB RAM minimum (4GB recommended for 4+ players)
2GB disk space
Steam account with Stardew Valley purchased (required for game download)
Client Side
Stardew Valley (any platform)
Same game version as server
Configuration
Environment Variables
Variable Required Default Description STEAM_USERNAME Yes - Your Steam username STEAM_PASSWORD Yes - Your Steam password ENABLE_VNC No true Enable VNC remote access VNC_PASSWORD No stardew123 VNC password (max 8 characters)
Ports
24642/udp - Game server port (REQUIRED, must be open in firewall)
5900/tcp - VNC port (OPTIONAL, for initial setup only)
Volume Mounts
./data/saves → /home/steam/.config/StardewValley - Save files and mod configs
./data/game → /home/steam/stardewvalley - Game installation directory
./data/steam → /home/steam/Steam - Steam cache and metadata
Using bind mounts makes backups straightforward: tar -czf backup.tar.gz data/saves/
Common Commands
bash
# View real-time logs
docker logs -f puppy-stardew
# Restart server
docker compose restart
# Stop server
docker compose down
# Update to latest version
docker compose pull
docker compose up -d
# Backup saves
tar -czf backup-$(date +%Y%m%d).tar.gz data/saves/
# Attach for Steam Guard code input
docker attach puppy-stardew
# Enter code, then press Ctrl+P Ctrl+Q to detach (NOT Ctrl+C)
Pre-installed Mods
All mods are pre-configured and ready to use:
1. SMAPI 4.3.2
The official Stardew Valley modding API.
Author: Pathoschild
License: GPL-3.0
Purpose: Foundation for all other mods
2. Always On Server v1.20.3
Enables headless 24/7 server operation.
Author: funny-snek & Zuberii
License: GPL-3.0
Purpose: Automates host player activities for dedicated servers
3. Skill Level Guard v1.4.0 (Custom)
Prevents Always On Server from forcing host to Level 10.
Purpose: Maintains natural XP-based skill progression
Features:
Blocks forced level-10 API calls
Restores real skill levels based on actual XP
Automatically enables Always On Server's auto mode
Zero interference with normal gameplay
4. ServerAutoLoad v1.2.1 (Custom)
Automatically loads save file on container restart.
Purpose: Eliminates need for VNC after initial setup
Features:
Auto-loads last played save on startup
Detects save files automatically
No manual intervention required
5. AutoHideHost v1.2.2 (Custom)
Hides host player and enables instant sleep.
Purpose: Provides seamless multiplayer experience
Features:
Host automatically warps to Desert (invisible to players)
Instant sleep when all online players are ready
No waiting for offline/AFK players
Players can choose skill professions manually (v1.2.2+)
Troubleshooting
"Disk write failure" during game download
Cause : Data directories not owned by UID 1000
Fix :
bash
chown -R 1000:1000 data/
docker compose restart
Steam Guard code required
bash
docker attach puppy-stardew
# Enter your Steam Guard code from email/mobile app
# Press Ctrl+P Ctrl+Q to detach (NOT Ctrl+C!)
Players can't connect
Check firewall allows UDP port 24642: sudo ufw allow 24642/udp
Verify container is running: docker ps | grep puppy-stardew
Confirm save is loaded: Connect via VNC or check logs
Ensure game versions match between server and clients
VNC won't connect
Verify port 5900/tcp is accessible
Check VNC password is correct (max 8 characters)
Try a different VNC client (RealVNC, TightVNC, etc.)
Review logs: docker logs puppy-stardew | grep -i vnc
High memory usage
Edit docker-compose.yml to adjust resource limits:
yaml
deploy:
resources:
limits:
memory: 1.5G # Reduce from 2G if needed
Performance Benchmarks
Typical Resource Usage
CPU : 1-2 cores during active gameplay
RAM : 1.5-2GB for 2-4 players
Disk : ~1.5GB game files + save data
Network : Low bandwidth (<1 Mbps)
Recommended Specs by Player Count
1-4 players : 2GB RAM, 1 CPU core
4-8 players : 4GB RAM, 2 CPU cores
8+ players : 4GB+ RAM, 2+ CPU cores
Supported Platforms
Server (Docker Host)
Linux (x86_64) - Native performance
Windows (Docker Desktop) - Full support
macOS (Docker Desktop) - Full support
Clients (Game Players)
PC (Windows, macOS, Linux)
iOS (Stardew Valley Mobile)
Android (Stardew Valley Mobile)
Cross-platform play works seamlessly - iOS/Android players can join PC-hosted servers without issues.
Important Notes
Legal Requirement
You MUST own Stardew Valley on Steam. This Docker image does NOT include game files - they are downloaded via your Steam account during first startup using SteamCMD (AppID 413150).
Security Best Practices
Use a strong Steam password
Change the default VNC password
Disable VNC after initial setup: ENABLE_VNC=false
Keep the image updated: docker compose pull
Don't expose VNC port (5900) to the public internet
Use SSH tunneling if remote VNC access is needed
Privacy & Credentials
Your Steam credentials are:
Stored locally in your .env file only
Used exclusively to download game files via SteamCMD
Never transmitted anywhere except official Steam servers
Can be removed after successful first download
Version History
v1.0.58 (November 2025) - Latest
Updated: Skill Level Guard v1.4.0 - Fixed Always On Server auto-enable
Improved: Reflection-based instance capture for stable operation
Enhanced: Compatibility with Always On Server v1.20.3
v1.0.57 (November 2025)
Updated: AutoHideHost v1.2.2 - Disabled LevelUpMenu auto-handling
Fixed: Players can now choose skill professions manually
Improved: Natural character progression preserved
v1.0.56 (November 2025)
Updated: AutoHideHost v1.2.1 - Stability improvements
Enhanced: Guard window mechanism reliability
v1.0.40-v1.0.55 (November 2025)
Performance optimizations
VNC improvements
Guard window mechanism development
Always On Server auto-enable fixes
v1.0.22-v1.0.39 (October 2025)
Fixed: Container restart loop bug
Improved: Steam Guard stdin handling
Enhanced: VNC password validation
Added: ServerAutoLoad mod
Added: AutoHideHost mod
v1.0.0 (October 2025)
Initial release
One-command deployment
Cross-platform support
VNC remote access
Basic mod integration
Documentation & Support
GitHub Repository : [***]
Full Documentation : Complete setup guide and advanced configuration
Bug Reports : [***]
Docker Hub : [***]
Credits
Stardew Valley by ConcernedApe
SMAPI by Pathoschild
Always On Server by funny-snek & Zuberii
Docker by Docker, Inc.
Custom Mods by truman-world & AI Developer
License
Project : MIT License - Free to use, modify, and distribute
Game : You must legally own Stardew Valley on Steam
SMAPI : GPL-3.0
Always On Server : GPL-3.0
Custom Mods (ServerAutoLoad, AutoHideHost, Skill Level Guard): MIT
Made for the Stardew Valley community
为星露谷物语社区制作
GitHub : [***]