Skip to main content

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
The block above is an excerpt from the project structure. You can click on any file name to read the corresponding documentation. Visit the project structure page for the full version.

Base configurations

From the /config folder, you can find and define the following base configurations:

Configuration topicFile pathRequired or optional
Databaseconfig/databaseRequired
Serverconfig/serverRequired
Admin panelconfig/adminRequired
Middlewaresconfig/middlewaresRequired
API callsconfig/apiOptional, used to define some general settings for responses and other REST-related parameters.

Additional configuration for specific features

Some specific features require additional configuration:

FeatureLocationRequired or optional
PluginsIn the config/plugins file
  • Optional if using only built-in plugins with default presets.
  • Required to enable, configure, or disable plugins.
Can also be used to configure the Upload plugin (which handles the Media Library feature) and GraphQL.
TypeScriptRequired to use TypeScript efficiently
API tokensIn the config/admin fileRequired if using API tokens for authentication instead of the Users & Permissions plugin
Lifecycle functionsIn the /src/index fileOptionally used to perform various actions that happen during the server lifecycle. Includes the register, bootstrap, and destroy functions.
Cron jobs
  • In the /config/server file to enable the feature
  • In a dedicated, optional cron-tasks file that can be used to declare the jobs
Required to setup CRON jobs for the server.
Environment variablesIn 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) EnterpriseIn the config/admin fileRequired to use the Entreprise-only SSO feature if enabled on your project.
Feature flagsIn the config/features fileOptional 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: