Skip to content

Environment Variables Reference ​

All environment variables used by the Tenanta module, with their defaults and descriptions.


Core Configuration ​

VariableDefaultDescription
TENANT_DATABASE_MODEseparateTenant data isolation strategy: separate (one DB per tenant) or single (shared DB with tenant_id)
TENANT_PROVISIONING_DRIVERsyncHow provisioning jobs run: sync (immediate) or queue (background worker required)

Tenanta Settings Defaults ​

These are used when no value has been saved in the database yet. Once an admin saves settings via the UI, the database value takes precedence.

VariableDefaultDescription
TENANTA_ALLOW_MODE_SWITCH_WITH_EXISTING_TENANTSfalseAllow switching DB mode when tenants exist
TENANTA_ALLOW_MODULE_UNINSTALLtrueAllow module uninstallation from Module Manager
TENANTA_ALLOW_RESOURCE_DELETIONfalseAllow destructive deletion of module data during uninstall
TENANTA_ENABLE_ADMIN_ROUTESfalseEnable LMS admin panel on central domain
TENANTA_ENABLE_STUDENT_PANEL_ROUTESfalseEnable student panel on central domain
TENANTA_ENABLE_TEACHER_PANEL_ROUTESfalseEnable teacher panel on central domain
TENANTA_ENABLE_PARENT_PANEL_ROUTESfalseEnable parent panel on central domain

Billing Settings Defaults ​

VariableDefaultDescription
TENANTA_BILLING_ENABLEDtrueMaster billing toggle
TENANTA_TRIAL_ENABLEDtrueEnable free trial for paid plans
TENANTA_TRIAL_CARD_REQUIREDfalseRequire payment card to start a trial
TENANTA_TRIAL_CARD_VERIFICATION_AMOUNT0Amount to authorize when trial requires card (0 = verify only)
TENANTA_TRIAL_DAYS14Number of trial days
TENANTA_FREE_PLAN_ENABLEDtrueAllow free plan registration
TENANTA_AUTO_RENEWAL_ENABLEDtrueEnable automatic subscription renewal
TENANTA_AUTO_RENEWAL_REMINDER_DAYS7Days before renewal to send reminder email
TENANTA_TRIAL_ENDING_REMINDER_DAYS3Days before trial end to send warning email

Billing Security ​

VariableDefaultDescription
TENANTA_REQUIRE_EMAIL_VERIFICATIONtrueRequire email verification before billing
TENANTA_REQUIRE_PAYMENT_VERIFICATIONtrueVerify payments before activating subscriptions
TENANTA_ENABLE_AUDIT_LOGGINGtrueLog billing settings changes
TENANTA_ENCRYPT_PAYMENT_DATAtrueEncrypt payment data at rest

Registration ​

VariableDefaultDescription
TENANTA_REGISTRATION_TRIAL_DEFAULTtrueDefault to trial option during registration
TENANTA_ALLOW_PAY_NOW_OPTIONtrueShow "Pay Now" option during registration
TENANTA_MIN_PASSWORD_LENGTH8Minimum password length for tenant registration (range: 6–64)
TENANTA_REQUIRE_PASSWORD_CONFIRMATIONtrueShow password confirmation field during registration

Currency & Invoices ​

VariableDefaultDescription
BILLING_CURRENCYUSDISO currency code for all billing
BILLING_CYCLEmonthlyDefault billing cycle for new subscriptions
INVOICE_PREFIXINVPrefix for invoice numbers

Billing Storage Keys ​

These control the database and cache key names. You typically don't need to change these unless you have naming conflicts.

VariableDefaultDescription
TENANTA_BILLING_SETTINGS_KEYtenanta_billing_settingstheme_settings table key for billing settings
TENANTA_BILLING_LEGACY_SETTINGS_KEYbilling_settingsLegacy key (read for backward compatibility)
TENANTA_BILLING_CACHE_KEYtenanta_billing_settingsCache key for billing settings
TENANTA_BILLING_LEGACY_CACHE_KEYbilling_settingsLegacy cache key
TENANTA_BILLING_PAYMENT_METHODS_CACHE_KEYtenanta_billing_settings_payment_methodsCache key for payment methods
TENANTA_BILLING_LEGACY_PAYMENT_METHODS_CACHE_KEYbilling_settings_payment_methodsLegacy payment methods cache key

Demo Data Import ​

VariableDefaultDescription
TENANTA_TENANT_DEMO_SQL_FILEtenant-demo.sqlSQL file for separate-DB mode demo import
TENANTA_DEFAULT_DEMO_SQL_FILEdemo.sqlFallback SQL file when tenant-specific file is missing
TENANTA_TENANT_DEMO_DATA_FILEtenant-demo-data.phpPHP array file for single-DB mode demo import
TENANTA_DEFAULT_DEMO_DATA_FILEdemo-data.phpFallback PHP file when tenant-specific file is missing
TENANTA_TENANT_DEMO_BLOCKED_EMAILSadmin@gmail.comComma-separated emails to exclude from demo admin import

Payment Gateway Keys ​

These are not Tenanta-specific but are required for payment gateways to function:

VariableDescription
STRIPE_KEYStripe publishable key
STRIPE_SECRETStripe secret key
PAYPAL_CLIENT_IDPayPal client ID
PAYPAL_SECRETPayPal secret
RAZORPAY_KEYRazorpay key ID
RAZORPAY_SECRETRazorpay key secret
PAYSTACK_PUBLIC_KEYPaystack public key
PAYSTACK_SECRET_KEYPaystack secret key

See Payment Gateways for gateway-specific setup instructions.


Example .env Section ​

env
# === Tenanta Core ===
TENANT_DATABASE_MODE=separate
TENANT_PROVISIONING_DRIVER=sync

# === Billing ===
BILLING_CURRENCY=USD
BILLING_CYCLE=monthly
INVOICE_PREFIX=INV
TENANTA_BILLING_ENABLED=true
TENANTA_TRIAL_ENABLED=true
TENANTA_TRIAL_DAYS=14
TENANTA_FREE_PLAN_ENABLED=true
TENANTA_AUTO_RENEWAL_ENABLED=true

# === Security ===
TENANTA_REQUIRE_EMAIL_VERIFICATION=true
TENANTA_ENCRYPT_PAYMENT_DATA=true

# === Route Toggles ===
TENANTA_ENABLE_ADMIN_ROUTES=false
TENANTA_ENABLE_STUDENT_PANEL_ROUTES=false
TENANTA_ENABLE_TEACHER_PANEL_ROUTES=false
TENANTA_ENABLE_PARENT_PANEL_ROUTES=false