Project root vs Drupal root

Project root vs Drupal root

Documentation for web applications often mentions the project root, application root, docroot, or Drupal root.

These can all refer to the same directory, or the docroot and/or application root can be part of the project root.

Let's look at them in a bit more detail.

Project root

The Project root directory refers to the directory that contains your Drupal project itself, and directories for dependencies (/vendor), documentation, database backups, exported configuration. ...).

Drupal root

The Drupal root directory sits inside your Project root directory and contains the Drupal source code and Drupal configuration files.

From a webserver configuration point of view, the Drupal root directory is also called the Document root (or docroot for short).

Since Drupal is the application part of the project (other parts include documentation, backups, etc), this directory is sometimes also called the App root or Application root directory.

Example

Assuming you have a project called demo, located at ~/projects/demo on your laptop:

  • Project root:
    • on the host: ~/projects/dem
    • inside the container: /var/www/html
  • Drupal root / docroot:
    • on the host: ~/projects/demo/web
    • inside the container: /var/www/html/web