Overview
Forge uses environment variables for configuration. Set these in your shell,.env file, or deployment platform.
Never commit secrets! Add
.env to your .gitignore and use environment-specific configuration for production.Core Configuration
Server Configuration
The host address for the Forge backend server
Port for the backend API server. Auto-assigned by
scripts/setup-dev-environment.js in developmentPort for the frontend development server
GitHub Integration
OAuth Configuration
GitHub OAuth App Client ID for custom authentication
Not required for basic usage. Forge includes default OAuth credentials for development. Set this only if you want to use your own GitHub OAuth App.
GitHub OAuth App Client Secret (production only)
Never commit this! Use secret management services in production (AWS Secrets Manager, HashiCorp Vault, etc.)
Creating Your Own GitHub OAuth App
If you want to use your own GitHub OAuth credentials:1
Create OAuth App
Go to GitHub Developer Settings → OAuth Apps → New OAuth App
2
Configure App
- Application name: “My Forge Instance”
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/auth/github/callback
3
Get Credentials
After creating, copy the Client ID and generate a Client Secret
4
Set Environment Variables
Analytics & Monitoring
PostHog API key for analytics (optional)
Forge includes optional PostHog integration for usage analytics. This is completely optional and disabled by default.
Development & Debugging
Disable automatic cleanup of orphaned git worktrees (debug mode)
Only use this for debugging worktree issues. Leaving it enabled will accumulate orphaned worktrees over time.
Rust logging level for backend debugging
Enable Rust backtraces for debugging
Database Configuration
Forge uses SQLite by default. The database is automatically created and seeded from
dev_assets_seed/ on first run.SQLite database path (advanced use only)
Changing this requires manual database setup. Use the default unless you know what you’re doing.
Using .env Files
Create a.env file in your project root:
.env
Multiple environments? Use
.env.development, .env.production, etc., and load them with tools like dotenv or deployment platform features.Environment-Specific Configuration
Development
.env.development
Production
.env.production
CI/CD
.env.ci
Verification
Check your configuration is working:Troubleshooting
Port already in use
Port already in use
Change
BACKEND_PORT or FRONTEND_PORT:GitHub authentication fails
GitHub authentication fails
- Check
GITHUB_CLIENT_IDis set correctly - Verify OAuth callback URL matches your GitHub App settings
- Try using default credentials (remove
GITHUB_CLIENT_ID)
Database errors on startup
Database errors on startup
Remove the database and let Forge recreate it:
Security Best Practices
Never Commit Secrets
Add
.env to .gitignore immediately.gitignore
Use Secret Management
In production, use services like:
- AWS Secrets Manager
- HashiCorp Vault
- Kubernetes Secrets
- Platform-specific solutions
Rotate Credentials
Regularly rotate OAuth secrets and API keys
Principle of Least Privilege
Grant minimal permissions to GitHub OAuth apps

