.env file. This guide explains all available configuration options.
Environment File Location
Essential Configuration
These variables must be configured before running XyraPanel.Application Settings
.env
The display name of your panel. Shown in the UI and emails.
Environment mode. Use
production for live deployments, development for local testing.Enable debug logging. Only use in development.
Application URLs
.env
Public URL where your panel is accessible. Must include protocol (
https://).Comma-separated list of trusted origins for authentication. Typically matches
BETTER_AUTH_URL.Public-facing application URL. Used for client-side routing.
External URL used in emails and API responses.
Internal URL for server-to-server communication.
Port the application listens on. Nginx proxies to this port.
Authentication Secrets
.env
Secret key for authentication token signing. Generate with
openssl rand -base64 32.Secret used to protect the admin seed endpoint. Required for creating the initial admin account.
Admin Account Seeding
.env
Email address for the initial admin account.
Password for the initial admin account. Change this immediately after first login.
Username for the admin account.
Display name for the admin user.
Database Configuration
.env
PostgreSQL connection string. Format:Examples:
- Docker:
postgresql://xyra:changeme@postgres:5432/xyrapanel - Manual:
postgresql://xyra:[email protected]:5432/xyrapanel
Database username. Docker only - must match credentials in
DATABASE_URL.Database password. Docker only - must match credentials in
DATABASE_URL.Database name. Docker only - must match database in
DATABASE_URL.Redis Configuration
.env
Redis server hostname.
- Docker:
redis - Manual:
127.0.0.1orlocalhost
Redis server port.
Redis username (ACL). Leave empty if not using authentication.
Redis password. Leave empty if not using authentication.
Enable TLS for Redis connection. Set to
true for managed Redis services.Advanced Configuration
Nuxt/Nitro Redis Storage
Internal caching configuration. Must match your Redis settings..env
Security Settings
.env
Allowed CORS origin. Should match your panel URL.
Rate limiting storage driver. Use
redis in production, lruCache for development.Number of requests allowed per interval.
Rate limit interval in milliseconds (default: 5 minutes).
Content Security Policy mode.
true: Report violations without blocking (testing)false: Enforce CSP and block violations (production)
HTTP Cache Settings
.env
Enable HTTP response caching for improved performance.
Default cache max-age in seconds.
Stale-while-revalidate duration in seconds.
Captcha Configuration
XyraPanel supports Cloudflare Turnstile, Google reCAPTCHA v3, and hCaptcha.- Cloudflare Turnstile
- Google reCAPTCHA v3
- hCaptcha
.env
Test mode key:
1x00000000000000000000AA (allows testing without validation)Request Limits
.env
Maximum request body size in megabytes.
Maximum file upload size in megabytes.
PM2 Configuration
.env
Number of PM2 instances to run.
max: Use all CPU cores (default)1: Single instance (recommended for servers with less than 2GB RAM)<number>: Specific number of instances
Restart instance if memory usage exceeds this limit. Format:
<number>G or <number>M.Configuration Examples
Development Setup
.env
Production Setup
.env
Applying Configuration Changes
After modifying.env, restart the panel:
Security Best Practices
Generate Strong Secrets
Generate Strong Secrets
Always generate cryptographically secure secrets:
Protect Your .env File
Protect Your .env File
Ensure proper file permissions:
Use HTTPS in Production
Use HTTPS in Production
Always use
https:// URLs for production deployments:BETTER_AUTH_URLNUXT_PUBLIC_APP_URLPANEL_PUBLIC_URL
Enable Rate Limiting
Enable Rate Limiting
Use Redis-based rate limiting in production:
Rotate Secrets Regularly
Rotate Secrets Regularly
Implement a secret rotation policy:
- Generate new
BETTER_AUTH_SECRET - Update
.env - Restart the panel
- All users will need to re-authenticate
Next Steps
First Server
Create your first game server
Wings Setup
Install and configure Wings daemon