What are all the directories comes with Drupal 9 and its purpose?

| | 2 min read

If you installed the latest version of drupal9 it will have the following directories. compare to other versions of Drupal, drupal9 does not have a libraries folder

  • /core contain all the files provided by a core that don't have an explicit reason to be in the / directory.
  • /modules are the directory into which all custom and contributed modules go.
    This directory contains the contrib and custom sub-directories, which can be used to make it easier to keep track of the modules.
  • /profiles  All contributed and custom installation profiles.
  • /themes contain contributed and custom (sub)themes.
  • /sites is the directory used for running Drupal multi-site setups and it's used in the same way as in Drupal 7. Modules and themes in /sites/all/modules and /sites/all/themes will override the ones in the base modules and themes directories. Modules in /sites/SITENAME/modules and /sites/SITENAME/themes will override others for the given site.
  • /vendor is the directory where Composer dependencies go, for example, Symfony and Twig

Core Folder Directories

In addition, the folder structure in the /core directory has changed as well.

  • /core/assets - Various external libraries used by core (includes jQuery, underscore, modernizer, etc.).
  • /core/includes - Base-level functionality that Drupal uses through other /core folders.
  • /core/lib - Drupal core classes.
  • /core/misc - Frontend code that Drupal core depends on.
  • /core/modules - Drupal's core modules.
  • /core/profiles - Drupal's core installation profiles. These are MinimalStandardTesting and Testing multilingual installation profiles.
  • /core/scripts - Various command line interface (CLI) scripts, mostly used by developers.
  • /core/tests - Drupal core tests.
  • /core/themes - Drupal core themes.

Composer Build Directories

When using composer to download and manage your Drupal project, Drupal core, and base level directories will be adjacent to a vendor directory.

/vendor - Various external composer PHP packages.

/web - parent directory for the above base-level and core directories.

Reference

https://www.drupal.org/docs/understanding-drupal/directory-structure

https://drupal.stackexchange.com/questions/84811/what-are-all-the-directories-for