StellarStack uses environment variables for configuration. This guide covers all available variables.
Required Variables
These variables are required for StellarStack to function:
Variable Description Example DATABASE_URLPostgreSQL connection string postgresql://user:pass@localhost:5432/dbBETTER_AUTH_SECRETSession signing secret (32+ characters) Generated automatically by installer
Generating Secrets
Generate a secure random secret:
Production Required Variables
These variables are required for production deployments (not needed for local development):
Variable Description Example FRONTEND_URLPanel URL (must not be localhost) https://panel.example.comAPI_URLAPI URL (must not be localhost) https://api.example.comDOWNLOAD_TOKEN_SECRETSecret for file download tokens 32+ character random string ENCRYPTION_KEY32-byte hex key for AES-256-CBC encryption 64 hex characters JWT_SECRETJWT signing secret 32+ character random string
Generating Encryption Key
Generate a 32-byte (64 hex character) encryption key:
OAuth Configuration (Optional)
Enable OAuth authentication with external providers:
Google OAuth
Variable Description GOOGLE_CLIENT_IDGoogle OAuth 2.0 client ID GOOGLE_CLIENT_SECRETGoogle OAuth 2.0 client secret
Setup:
Go to Google Cloud Console
Create OAuth 2.0 credentials
Set authorized redirect URI: https://api.example.com/auth/google/callback
GitHub OAuth
Variable Description GITHUB_CLIENT_IDGitHub OAuth app client ID GITHUB_CLIENT_SECRETGitHub OAuth app client secret
Setup:
Go to GitHub Developer Settings
Create new OAuth app
Set callback URL: https://api.example.com/auth/github/callback
Discord OAuth
Variable Description DISCORD_CLIENT_IDDiscord OAuth application ID DISCORD_CLIENT_SECRETDiscord OAuth application secret
Setup:
Go to Discord Developer Portal
Create new application
Add redirect: https://api.example.com/auth/discord/callback
Database Configuration
PostgreSQL
The DATABASE_URL connection string format:
postgresql://[user]:[password]@[host]:[port]/[database]?[parameters]
Examples:
# Local PostgreSQL
DATABASE_URL = "postgresql://stellar:password@localhost:5432/stellarstack"
# Docker Compose service
DATABASE_URL = "postgresql://stellar:stellarpass@postgres:5432/stellar"
# External database with SSL
DATABASE_URL = "postgresql://user:pass@db.example.com:5432/stellarstack?sslmode=require"
Connection Pool Settings
Optional Prisma connection pool parameters:
DATABASE_URL = "postgresql://user:pass@host:5432/db?connection_limit=10&pool_timeout=10"
Docker Configuration
Installer Variables
These variables configure the Ubuntu installer script:
Variable Description Default INSTALL_DIRInstallation directory /opt/stellarstackDOCKER_ORGDocker image organization stellarstackoss
Docker Images
Variable Description Default API_IMAGEAPI Docker image stellarstackoss/stellarstack-apiPANEL_IMAGEPanel Docker image stellarstackoss/stellarstack-web
Daemon Configuration
For daemon (node) installations:
Variable Description Example DAEMON_PANEL_URLAPI URL for daemon to connect https://api.example.comDAEMON_TOKEN_IDToken ID from panel From panel > Nodes > Configure DAEMON_TOKENFull token string From panel DAEMON_PORTDaemon API port 8080DAEMON_SFTP_PORTSFTP port for file transfers 2022DAEMON_SSL_DOMAINDomain for SSL (if enabled) node.example.com
Daemon Redis (Optional)
Variable Description DAEMON_REDIS_URLRedis connection string for daemon
Example: redis://localhost:6379
Server Configuration
Upload Limits
Variable Description Default UPLOAD_LIMITMax file upload size 100M
Configure in nginx as well:
client_max_body_size 100M ;
Monitoring Domain
Variable Description MONITORING_DOMAINDomain for Grafana/monitoring stack
Example: monitoring.example.com
Network Configuration
Docker Networks
StellarStack uses two networks:
stellar_network - For services (Panel, API, Database)
docker network create stellar_network
stellar - For game server containers
docker network create stellar --subnet=172.18.0.0/16 --gateway=172.18.0.1
Development Variables
For local development only:
Variable Description Default NODE_ENVEnvironment mode developmentDEBUGEnable debug logging falsePORTAPI port (dev) 3001NEXT_PUBLIC_API_URLAPI URL for Next.js http://localhost:3001
Example .env File
Minimum Configuration (Development)
# Database
DATABASE_URL = "postgresql://stellar:stellarpass@localhost:5432/stellarstack"
# Authentication
BETTER_AUTH_SECRET = "your-32-character-secret-here-replace-this"
Production Configuration
# Database
DATABASE_URL = "postgresql://stellar:securepassword@postgres:5432/stellar"
# Authentication & Security
BETTER_AUTH_SECRET = "your-32-character-secret-here-replace-this"
JWT_SECRET = "another-32-character-secret-replace-this"
DOWNLOAD_TOKEN_SECRET = "download-token-secret-32-chars-replace"
ENCRYPTION_KEY = "64-hex-character-encryption-key-from-openssl-rand-hex-32"
# URLs
FRONTEND_URL = "https://panel.example.com"
API_URL = "https://api.example.com"
# OAuth (Optional)
GOOGLE_CLIENT_ID = "your-google-client-id.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET = "your-google-client-secret"
GITHUB_CLIENT_ID = "your-github-client-id"
GITHUB_CLIENT_SECRET = "your-github-client-secret"
DISCORD_CLIENT_ID = "your-discord-client-id"
DISCORD_CLIENT_SECRET = "your-discord-client-secret"
# Monitoring (Optional)
MONITORING_DOMAIN = "monitoring.example.com"
# Upload Limit
UPLOAD_LIMIT = "100M"
All-in-One Configuration
# Database
DATABASE_URL = "postgresql://stellar:securepassword@postgres:5432/stellar"
# Authentication & Security
BETTER_AUTH_SECRET = "your-32-character-secret-here-replace-this"
JWT_SECRET = "another-32-character-secret-replace-this"
DOWNLOAD_TOKEN_SECRET = "download-token-secret-32-chars-replace"
ENCRYPTION_KEY = "64-hex-character-encryption-key-from-openssl-rand-hex-32"
# URLs
FRONTEND_URL = "https://panel.example.com"
API_URL = "https://api.example.com"
# Daemon Configuration
DAEMON_PANEL_URL = "https://api.example.com"
DAEMON_TOKEN_ID = "token-id-from-panel"
DAEMON_TOKEN = "full-token-string-from-panel"
DAEMON_PORT = "8080"
DAEMON_SFTP_PORT = "2022"
DAEMON_SSL_DOMAIN = "node.example.com"
# Monitoring
MONITORING_DOMAIN = "monitoring.example.com"
Security Best Practices
Never commit .env files to version control. Add .env to .gitignore.
Generate unique secrets - Don’t reuse secrets across environments
Use strong passwords - Minimum 32 characters for secrets
Rotate secrets regularly - Update secrets periodically
Restrict file permissions - chmod 600 .env
Use environment-specific files - .env.production, .env.staging
Verifying Configuration
Check if all required variables are set:
# Check API configuration
docker exec stellarstack-api env | grep -E '(DATABASE_URL|BETTER_AUTH_SECRET|API_URL)'
# Check web configuration
docker exec stellarstack-web env | grep -E '(NEXT_PUBLIC_API_URL|FRONTEND_URL)'
Next Steps
Docker Compose Setup Deploy with Docker Compose
Production Checklist Production deployment guide