Configuration
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: