Skip to content

Configuration File

Your config.php file controls how FOSSBilling behaves after installation. You will find it in the installation root of a running instance.

This page highlights the settings administrators most commonly change. For the full inline reference, use the sample config linked below.

Control security behavior:

SettingDefaultDescription
security.modestrictstrict (recommended) or regular. Strict enables SameSite=Strict and HttpOnly cookies.
security.force_httpstrueForce HTTPS connections. Recommended for production.
security.session_lifespan7200Session duration in seconds (default: 2 hours).
  • salt — Used for reversible encryption. Keep this secret and don't change it after installation.
  • url — Your full FOSSBilling URL with trailing slash (e.g., https://billing.example.com/)
  • admin_area_prefix — Admin panel path (default: /admin)
  • debug — Show detailed error messages. Disable in production.
  • log_stacktrace — Include stack traces in logs (requires debug: true)
  • stacktrace_length — Maximum stack trace length
  • update_branch — Which updates to receive:
    • "release" — Stable releases only (recommended for production)
    • "preview" — Development builds (may have bugs)

Temporarily disable public access. Use allowed_urls for endpoints that must stay reachable and allowed_ips for trusted networks that should bypass maintenance mode.

'maintenance_mode' => [
'enabled' => true,
'allowed_urls' => ['/api/guest/*'],
'allowed_ips' => ['192.168.1.0/24'],
],
  • disable_auto_cron — Disable automatic cron execution when admins log in
SettingDefaultNotes
i18n.localeen_USDefault language code
i18n.timezoneUTCDefault timezone
i18n.date_formatmediumOptions: none, short, medium, long
i18n.time_formatshortOptions: none, short, medium, long
i18n.datetime_patternCustom date/time pattern
SettingDescription
path_dataWhere sensitive data is stored
path_logsLog file location
log_to_dbAlso log to database (not fully implemented)
'db' => [
'type' => 'mysql',
'host' => '127.0.0.1',
'port' => '3306',
'name' => 'fossbilling',
'user' => 'fossbilling_user',
'password' => 'your_password',
],
SettingDescription
twig.debugEnable Twig debug mode
twig.auto_reloadAuto-reload templates on changes
twig.cacheTemplate cache directory

Control API access and rate limiting. Use require_referrer_header to lock browser-originated requests to your install URL, allowed_ips for explicit allowlists, and the rate_* values to tune throttling.

'api' => [
'require_referrer_header' => true,
'allowed_ips' => [],
'rate_span' => 60,
'rate_limit' => 100,
'throttle_delay' => 2,
'rate_span_login' => 60,
'rate_limit_login' => 20,
'CSRFPrevention' => true,
],

Some settings can be overridden via environment variables:

Terminal window
APP_ENV=dev # Enable development mode
APP_DEBUG=true # Enable debug mode
  1. Edit config.php with a text editor
  2. Save the file
  3. Clear the cache: System → Tools → Clear cache (or delete /data/cache/)
  4. Test your changes