4.1 KiB
4.1 KiB
Deployment Guide
This guide covers deploying ACC Server Manager to a production Windows server.
Production Requirements
- Windows Server 2016+ or Windows 10/11
- 4GB+ RAM
- 20GB+ free disk space
- Administrator access
- SteamCMD and NSSM installed
Deployment Steps
1. Prepare the Server
Install required tools:
# Create directories
New-Item -ItemType Directory -Path "C:\ACCServerManager"
New-Item -ItemType Directory -Path "C:\steamcmd"
New-Item -ItemType Directory -Path "C:\tools\nssm"
# Download and extract SteamCMD
# Download and extract NSSM
2. Build for Production
On your development machine:
# Build optimized binary
go build -ldflags="-w -s" -o acc-server-manager.exe cmd/api/main.go
3. Deploy Files
Copy to server:
acc-server-manager.exe.envfile (with production secrets)nssm.exe(if not in PATH)
4. Configure Production Environment
Generate production secrets:
# On the server
.\scripts\generate-secrets.ps1
Edit .env for production:
PORT=80
CORS_ALLOWED_ORIGIN=https://yourdomain.com
5. Install as Windows Service
# Using NSSM
nssm install "ACC Server Manager" "C:\ACCServerManager\acc-server-manager.exe"
nssm set "ACC Server Manager" DisplayName "ACC Server Manager"
nssm set "ACC Server Manager" Description "Web management for ACC servers"
nssm set "ACC Server Manager" Start SERVICE_AUTO_START
nssm set "ACC Server Manager" AppDirectory "C:\ACCServerManager"
# Start the service
nssm start "ACC Server Manager"
6. Configure Firewall
# Allow HTTP traffic
New-NetFirewallRule -DisplayName "ACC Server Manager" -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow
7. Set Up Reverse Proxy (Optional)
If using IIS as reverse proxy:
- Install URL Rewrite and ARR modules
- Configure reverse proxy to localhost:3000
- Enable HTTPS with valid certificate
Security Checklist
- Generated unique production secrets
- Changed default admin password
- Configured HTTPS (via reverse proxy)
- Restricted database file permissions
- Enabled Windows Firewall
- Disabled unnecessary ports
- Set up backup schedule
Monitoring
Service Health
# Check service status
Get-Service "ACC Server Manager"
# View recent logs
Get-EventLog -LogName Application -Source "ACC Server Manager" -Newest 20
Application Logs
- Check
logs/app.logfor application events - Check
logs/error.logfor errors - Monitor disk space for log growth
Backup Strategy
Automated Backups
Create scheduled task for daily backups:
# Backup script (save as backup.ps1)
$date = Get-Date -Format "yyyy-MM-dd"
$backupDir = "C:\Backups\ACCServerManager"
New-Item -ItemType Directory -Force -Path $backupDir
# Backup database and config
Copy-Item "C:\ACCServerManager\acc.db" "$backupDir\acc_$date.db"
Copy-Item "C:\ACCServerManager\.env" "$backupDir\env_$date"
# Keep only last 7 days
Get-ChildItem $backupDir -File | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-7)} | Remove-Item
Updates
Update Process
- Backup current deployment
- Build new version
- Stop service:
nssm stop "ACC Server Manager" - Replace binary
- Start service:
nssm start "ACC Server Manager" - Verify: Check logs and web interface
Rollback
If update fails:
- Stop service
- Restore previous binary
- Restore database if needed
- Start service
Troubleshooting Deployment
Service Won't Start
- Check Event Viewer for errors
- Verify .env file exists and is valid
- Run manually to see console output
Can't Access Web Interface
- Check firewall rules
- Verify service is running
- Check port binding in .env
Permission Errors
- Run service as Administrator (not recommended)
- Or grant specific permissions to service account
Performance Tuning
For Large Deployments
- Use SSD for database storage
- Increase Windows TCP connection limits
- Consider load balancing for 50+ servers
- Monitor memory usage and adjust if needed
Database Maintenance
-- Run monthly via SQLite
VACUUM;
ANALYZE;