Configuration
Chamilo 3.0 uses environment variables and Symfony configuration files for its core settings. This page covers the key configuration files and variables.
Environment Variables (.env)
The primary configuration file is .env in the Chamilo root directory. This file contains environment-specific settings that should not be committed to version control.
A default .env.dist file ships with Chamilo and contains documented defaults. Create .env (required to start the installation) to override values for your environment.
Key Variables
APP_ENV
The application environment, at the Symfony level. Use prod for production, dev for development, 'test' for testing.
prod
APP_SECRET
A random string used for CSRF tokens, cookie signing, and other cryptographic operations. Chamilo generates a unique value for each installation. Don't modify it.
a1b2c3d4e5f6...
DATABASE_HOST
The database host. Defaults to localhost
localhost
DATABASE_PORT
The database port. Defaults to 3306 for MySQL/MariaDB
3306
DATABASE_NAME
The database name, as given by you to the installation wizard.
See below.
DATABASE_USER
The database username, as given by you to the installation wizard.
See below.
DATABASE_PASSWORD
The database user's password, as given by you to the installation wizard.
See below.
TRUSTED_PROXIES
(Optional) If you are hosting Chamilo behind a reverse proxy, you need to provide the IP(s) of the reverse proxy here for Chamilo to be able to interpret calls and generate responses correctly.
APP_ENABLE_API_ENTRYPOINT
(Optional) Exposes the interactive API documentation (Swagger/OpenAPI) at /api. Off by default. Requires a cache clear to take effect — see Enable the API Documentation below.
true
Other settings in .env are relatively rarely modified.
Note that, in future versions, the DATABASE_* settings will be combined into one single DATABASE_URL variable.
E-mail sending configuration is presented during installation, but can be modified later on in the Platform settings section of the administration dashboard.
Symfony Configuration (config/ Directory)
Symfony-level configuration lives in the config/ directory. These YAML files control framework behavior, service definitions, and package-specific settings.
The entire config/ directory ships with every Chamilo package and every update — unlike, say, .env, it is not excluded or preserved specially during an upgrade. Any change made directly to a file under config/ or config/packages/ will be silently overwritten the next time you update Chamilo. See Environment-Specific Overrides below for the supported way to customize configuration without losing your changes.
It is not frequent to have to modify those files, and changing them can render your portal inoperative, so please do not attempt to modify those if you must ensure the system's availability.
Key Configuration Files
config/authentication.yaml
Authentication methods configuration.
config/packages/doctrine.yaml
Database and ORM configuration.
config/packages/security.yaml
Authentication, firewalls, access control, and role hierarchies.
config/packages/cache.yaml
Cache adapter configuration (filesystem, APCu, Redis).
config/packages/framework.yaml
General Symfony framework settings (session, CSRF, router, HTTP caching).
config/packages/twig.yaml
Template engine configuration.
config/services.yaml
Application service definitions and dependency injection.
Environment-Specific Overrides
Symfony supports per-environment configuration. Files in config/packages/prod/ override the defaults when APP_ENV=prod, and config/packages/dev/ overrides when APP_ENV=dev.
For example, config/packages/prod/monolog.yaml typically configures less verbose logging than the development equivalent.
Chamilo does not define any configuration in config/packages/prod/ in the software itself, so if you want to customize a setting from config/packages/*.yaml, do not edit the base file — create a same-named file inside config/packages/prod/ (or dev//test/, matching the environment you want to affect) containing only the keys you want to override, and put your changes there instead.
This matters because the base config/packages/*.yaml files are part of the Chamilo package: every update ships them again and overwrites whatever is there, so edits made directly to them do not survive an upgrade. Since Chamilo never ships anything under config/packages/prod/ (or dev//test/), that directory is safe from being overwritten by an update and is the supported place to keep local customizations.
File Permissions
We made efforts in 2.0+ to ensure that a single directory needed permissions, and this remains true in 3.0. This is the var/ directory, and to avoid complex issues, just setting the whole folder as writeable by the web server system user is enough.
Set permissions appropriately under Debian-based systems:
Common Configuration Tasks
Switch to Production Mode
Then clear and warm the cache:
Enable the API Documentation
Then clear the cache so the change takes effect:
The interactive API documentation (Swagger/OpenAPI) is then available at /api. Editing .env alone is not enough: the resolved value is baked into Symfony's compiled cache, so /api keeps returning its previous state (enabled or not) until the cache is cleared. The System > Clean temporary files action in the administration panel does not do this — see System Tools for why — so this specific change requires shell access to run cache:clear.
Configure Trusted Proxies
If Chamilo runs behind a reverse proxy or load balancer, configure trusted proxies so that HTTPS detection and client IP resolution work correctly:
Configure Session Storage
Chamilo uses the native PHP session handler by default (typically filesystem storage, depending on the PHP configuration). For deployments where multiple application servers share one database, Chamilo can instead store PHP sessions in its php_session table. This database-backed option was restored in Chamilo LMS PR #9146.
Before enabling it, make sure the database table php_session exists. It is created by the V310 migration Version20260928234500 (or by the schema on a fresh installation). Check the migration status and table on a staging environment first; do not enable database storage against a database without that table.
Set the following in the deployment's .env or equivalent environment configuration:
Leave SESSION_STORED_IN_DB unset or set it to false to retain the native PHP session handler. The Symfony configuration already selects Chamilo\CoreBundle\Session\ConfigurableSessionHandler, which delegates to the appropriate backend. Do not replace framework.session.handler_id with an unverified Redis DSN: this would bypass the Chamilo configuration and is not the documented database-session switch.
After changing the environment setting, rebuild/clear the Symfony application cache according to your deployment procedure, and test login, navigation and logout. Plan the change during a maintenance window: existing session data is not transferred between the native PHP store and the database, so users may have to log in again. When enabled, include php_session in database backup and retention planning.
Tips
Never edit
.env.distdirectly -- Always use.envfor your overrides. The.env.distfile may be overwritten during upgrades.Keep
APP_DEBUG=0in production -- Debug mode exposes sensitive information in error pages.Back up
.envseparately from the codebase since it contains credentials and is excluded from version control.
Last updated
Was this helpful?