Configuration
π Work in progress
The content of this page might not be fully up-to-date with Strapi 5 yet.
The configuration of a Strapi project lives in the /config folder:
. # root of the project
βββββ config
β β api.js|ts
β β admin.js|ts
β β cron-tasks.js|ts
β β database.js|ts
β β features.js|ts
β β middlewares.js|ts
β β plugins.js|ts
β β server.js|ts
Base configurationsβ
From the /config folder, you can find and define the following base configurations:
| Configuration topic | File path | Required or optional |
|---|---|---|
| Database | config/database | Required |
| Server | config/server | Required |
| Admin panel | config/admin | Required |
| Middlewares | config/middlewares | Required |
| API calls | config/api | Optional, used to define some general settings for responses and other REST-related parameters. |
Additional configuration for specific featuresβ
Some specific features require additional configuration:
| Feature | Location | Required or optional |
|---|---|---|
| Plugins | In the config/plugins file |
|
| TypeScript |
| Required to use TypeScript efficiently |
| API tokens | In the config/admin file | Required if using API tokens for authentication instead of the Users & Permissions plugin |
| Lifecycle functions | In the /src/index file | Optionally used to perform various actions that happen during the server lifecycle. Includes the register, bootstrap, and destroy functions. |
| Cron jobs |
| Required to setup CRON jobs for the server. |
| Environment variables | In dedicated files and folders for the environment (e.g., config/env/production/server) | Optionally used to define different environments and their variables. |
| Single Sign-On (SSO) Enterprise | In the config/admin file | Required to use the Entreprise-only SSO feature if enabled on your project. |
| Feature flags | In the config/features file | Optional for a typical, stable Strapi application. Only required to enable future flags. |
Guidesβ
The following guides will help you address specific use cases related to the Strapi configuration: