Skip to content

Configuration

BadgerPanel is configured through environment variables stored in the .env file at the root of your installation directory. The setup script generates this file automatically, but you can modify it at any time.

Restart Required

After changing any environment variable, you must restart the affected services for changes to take effect:

bash
cd /opt/badgerpanel
docker compose restart api web

Environment Variables

Application

VariableDescriptionDefaultRequired
APP_NAMEPanel display nameBadgerPanelNo
APP_URLPublic URL of the panel--Yes
APP_ENVEnvironment mode (production, development)productionYes
APP_DEBUGEnable debug loggingfalseNo
APP_TIMEZONEDefault timezone (IANA format)UTCNo
APP_PORTInternal API server port8080No
bash
# Example
APP_NAME=BadgerPanel
APP_URL=https://panel.your-domain.com
APP_ENV=production
APP_DEBUG=false
APP_TIMEZONE=America/New_York
APP_PORT=8080

Database (MySQL)

VariableDescriptionDefaultRequired
DB_HOSTMySQL server hostnamemysqlYes
DB_PORTMySQL server port3306Yes
DB_DATABASEDatabase namebadgerpanelYes
DB_USERNAMEDatabase usernamebadgerpanelYes
DB_PASSWORDDatabase password--Yes
DB_ROOT_PASSWORDMySQL root password (Docker Compose)--Yes
bash
# Example (generated by setup script)
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=badgerpanel
DB_USERNAME=badgerpanel
DB_PASSWORD=your-generated-secure-password
DB_ROOT_PASSWORD=your-generated-root-password

Database Credentials

The DB_PASSWORD and DB_ROOT_PASSWORD values are generated automatically by the setup script. If you change them, you must also update the MySQL container's credentials. Never use weak or default passwords in production.

Redis

VariableDescriptionDefaultRequired
REDIS_HOSTRedis server hostnameredisYes
REDIS_PORTRedis server port6379Yes
REDIS_PASSWORDRedis authentication password--Yes
REDIS_DBRedis database number0No
bash
# Example
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=your-generated-redis-password
REDIS_DB=0

MinIO (Object Storage)

VariableDescriptionDefaultRequired
MINIO_ENDPOINTMinIO server endpointminio:9000Yes
MINIO_ACCESS_KEYMinIO access key--Yes
MINIO_SECRET_KEYMinIO secret key--Yes
MINIO_BUCKETBucket name for backupsbadgerpanelYes
MINIO_USE_SSLUse SSL for MinIO connectionfalseNo
MINIO_REGIONMinIO regionus-east-1No
bash
# Example
MINIO_ENDPOINT=minio:9000
MINIO_ACCESS_KEY=your-generated-access-key
MINIO_SECRET_KEY=your-generated-secret-key
MINIO_BUCKET=badgerpanel
MINIO_USE_SSL=false

JWT Authentication

VariableDescriptionDefaultRequired
JWT_SECRETSecret key for signing JWT tokens--Yes
JWT_ACCESS_EXPIRYAccess token expiry duration15mNo
JWT_REFRESH_EXPIRYRefresh token expiry duration7dNo
bash
# Example
JWT_SECRET=your-generated-jwt-secret-at-least-32-characters
JWT_ACCESS_EXPIRY=15m
JWT_REFRESH_EXPIRY=7d

JWT Secret

The JWT_SECRET must be a strong, random string of at least 32 characters. Changing this value will invalidate all existing user sessions.

Email (SMTP)

VariableDescriptionDefaultRequired
SMTP_HOSTSMTP server hostname--No
SMTP_PORTSMTP server port587No
SMTP_USERNAMESMTP authentication username--No
SMTP_PASSWORDSMTP authentication password--No
SMTP_ENCRYPTIONEncryption method (tls, starttls, none)starttlsNo
SMTP_FROM_ADDRESSSender email address--No
SMTP_FROM_NAMESender display nameBadgerPanelNo
bash
# Example with Mailgun
SMTP_HOST=smtp.mailgun.org
SMTP_PORT=587
SMTP_USERNAME=postmaster@mg.your-domain.com
SMTP_PASSWORD=your-mailgun-smtp-password
SMTP_ENCRYPTION=starttls
SMTP_FROM_ADDRESS=noreply@your-domain.com
SMTP_FROM_NAME=BadgerPanel

Email Is Optional but Recommended

Email is required for account verification, password reset, and invoice delivery. Without SMTP configured, these features will not work. You can configure email later through the admin settings UI as well.

OAuth Providers

Configure social login by providing OAuth client credentials. Each provider is optional.

bash
# Google OAuth
OAUTH_GOOGLE_ENABLED=true
OAUTH_GOOGLE_CLIENT_ID=your-google-client-id
OAUTH_GOOGLE_CLIENT_SECRET=your-google-client-secret

# Discord OAuth
OAUTH_DISCORD_ENABLED=true
OAUTH_DISCORD_CLIENT_ID=your-discord-client-id
OAUTH_DISCORD_CLIENT_SECRET=your-discord-client-secret

# GitHub OAuth
OAUTH_GITHUB_ENABLED=true
OAUTH_GITHUB_CLIENT_ID=your-github-client-id
OAUTH_GITHUB_CLIENT_SECRET=your-github-client-secret

# Microsoft OAuth
OAUTH_MICROSOFT_ENABLED=false
OAUTH_MICROSOFT_CLIENT_ID=
OAUTH_MICROSOFT_CLIENT_SECRET=

The OAuth callback URL for each provider is:

https://panel.your-domain.com/api/v1/auth/oauth/{provider}/callback

Billing / Payment Gateways

bash
# Stripe
STRIPE_ENABLED=false
STRIPE_SECRET_KEY=sk_live_your-stripe-secret-key
STRIPE_PUBLISHABLE_KEY=pk_live_your-stripe-publishable-key
STRIPE_WEBHOOK_SECRET=whsec_your-stripe-webhook-secret

# PayPal
PAYPAL_ENABLED=false
PAYPAL_CLIENT_ID=your-paypal-client-id
PAYPAL_CLIENT_SECRET=your-paypal-client-secret
PAYPAL_MODE=live  # or "sandbox" for testing

# WHMCS
WHMCS_ENABLED=false
WHMCS_URL=https://billing.your-domain.com
WHMCS_API_IDENTIFIER=your-whmcs-api-identifier
WHMCS_API_SECRET=your-whmcs-api-secret

See the Billing Setup guide for detailed configuration instructions.

Nginx / SSL

VariableDescriptionDefaultRequired
DOMAINPanel domain name--Yes
SSL_MODESSL configuration modeletsencryptYes
LETSENCRYPT_EMAILEmail for Let's Encrypt notifications--Conditional
bash
# Example
DOMAIN=panel.your-domain.com
SSL_MODE=letsencrypt
LETSENCRYPT_EMAIL=admin@your-domain.com

SSL Mode Options:

ModeDescription
letsencryptAutomatic certificate provisioning via Let's Encrypt (recommended for production)
customUse your own certificate files placed in nginx/ssl/
selfsignedGenerate self-signed certificates (development only)

See the SSL Certificates guide for more details.

Admin Panel Settings

In addition to environment variables, many settings can be configured through the admin web interface at Admin > Settings. These settings are stored in the database and override some defaults.

General Settings

  • Panel Name -- Displayed in the header and emails
  • Panel Description -- Shown on the login page
  • Panel URL -- Must match your actual domain
  • Default Timezone -- Applied to new user accounts
  • Registration -- Enable or disable new account registration
  • Email Verification -- Require email verification before account activation
  • Maintenance Mode -- Temporarily disable the panel for all non-admin users

Security Settings

  • Session Timeout -- Duration before inactive sessions expire
  • Max Login Attempts -- Failed attempts before account lockout
  • Lockout Duration -- How long accounts remain locked
  • 2FA Policy -- Optional, encouraged, or required for all users
  • Password Requirements -- Minimum length and complexity rules

Rate Limiting

  • Base Rate Limit -- Default API requests per minute per user
  • Auth Rate Limit -- Stricter limit on login, register, and password reset endpoints
  • Rate Limit per Role -- Each role has a multiplier (e.g., Admin = 2.0x the base limit)

Feature Flags

Feature flags allow you to enable or disable major features without redeployment:

FlagDescriptionDefault
Billing SystemEnable the full billing/storefront systemDisabled
OAuth LoginEnable social login providersDisabled
User RegistrationAllow new users to create accountsEnabled
SFTP ServerEnable SFTP access on daemon nodesEnabled
Server TransfersAllow migrating servers between nodesEnabled

Configuration Precedence

When the same setting is available both as an environment variable and in the admin UI:

  1. Environment variables take precedence for core infrastructure settings (database, Redis, JWT)
  2. Admin UI settings take precedence for operational settings (registration, rate limits, feature flags)
  3. Settings configured in the admin UI persist across restarts in the database

Next Steps

BadgerPanel Documentation