Directory structure of a typical TYPO3 project

The typical directory structure of a TYPO3 installation differs fundamentally between Composer mode and Classic mode. It can also vary depending on the TYPO3 version. Use the version switch to select the correct documentation version.

This structural difference remains even when deploying TYPO3 to a production server without Composer, and without deploying composer.json or composer.lock. To make matters more confusing, the presence of these files does not guarantee that TYPO3 is running in Composer mode.

The TYPO3 backend Extension Manager with message "Composer mode: The system is set to composer mode. Please notice that this list is for informational purpose only. To modify which extensions are part of the system, use Composer. To set extensions up, use the TYPO3 cli (extension:setup)"

This info box in the Extension Manager confirms the installation is running in Composer mode.

Table of contents

Directories in a typical Composer mode TYPO3 project

The overview below describes the directory structure of a typical Composer-based TYPO3 installation.

Also see the chapter Environment for details on how to retrieve paths in PHP code.

config/

TYPO3 configuration directory. This directory contains folder config/system/ for installation-wide configuration and config/sites/ for the site configuration and Site settings.

config/sites/

The folder config/sites/ contains subfolders, one for each site in the installation. See chapter The site folder config/sites/ / typo3conf/sites/.

config/system/

The folder config/system/ contains the installation-wide configuration files:

These files define a set of global settings stored in a global array called $GLOBALS['TYPO3_CONF_VARS'].

This path can be retrieved from the Environment API, see getConfigPath().

Changed in version 12.0

For Composer-based installations the configuration files have been moved and renamed:

  • public/typo3conf/LocalConfiguration.php is now available in config/system/settings.php
  • public/typo3conf/AdditionalConfiguration.php is now available in config/system/additional.php

packages/

If you installed TYPO3 using the base distribution composer create "typo3/cms-base-distribution" this folder is automatically created and registered as repository in the the composer.json.

You can put your site package and other extensions to be installed locally here. Then you can just install the extension with composer install myvendor/my-sitepackage.

If you did not use the base-distribution, create the directory and add it to your repositories manualy:

composer.json (diff)
 {
    "name": "myvendor/my-project",
    "repositories": [
+       {
+           "type": "path",
+           "url": "packages/*"
        }
    ],
    "...": "..."
 }
Copied!

public/

This folder contains all files that are publicly available. Your webserver's web root must point here.

This folder contains the main entry script index.php created by Composer and might contain publicly available files like a robots.txt and files needed for the server configuration like a .htaccess.

If required, this directory can be renamed by setting extra > typo3/cms > web-dir in the composer.json, for example to web:

composer.json
{
    "extra": {
        "typo3/cms": {
            "web-dir": "web"
        }
    },
    "...": "..."
}
Copied!

This directory contains the following subdirectories:

public/_assets/

This directory includes symlinks to resources of extensions (stored in the Resources/Public/ folder), as consequence of this and further structure changes the folder typo3conf/ext/ is not created or used anymore. So all files like CSS, JavaScript, icons, fonts, images, etc. of extensions are not referenced anymore directly to the extension folders but to the directory _assets/.

public/fileadmin/

This is a directory in which editors store files. Typically images, PDFs or video files appear in this directory and/or its subdirectories.

Note this is only the default editor's file storage. This directory is handled via the FAL API internally, there may be further storage locations configured outside of fileadmin/, even pointing to different servers or using 3rd party digital asset management systems.

Depending on the configuration in $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] another folder name than fileadmin/ can be in use.

public/typo3/

This directory contains the two PHP files for accessing the TYPO3 backend (typo3/index.php) and install tool (typo3/install.php).

Changed in version 12.0

Starting with TYPO3 v12 (or v11 using typo3/cms-composer-installers v4) the system extensions are not located in this directory anymore. They can now be found in the vendor/ folder.

public/typo3temp/

Directory for temporary files. It contains subdirectories (see below) for temporary files of extensions and TYPO3 components.

public/typo3temp/assets/

The directory typo3temp/assets/ contains temporary files that should be public available. This includes generated images and compressed CSS and JavaScript files.

var/

Directory for temporary files that contains private files (e.g. cache and logs files) and should not be publicly available.

var/cache/

This directory contains internal files needed for the cache.

var/labels/

The directory var/labels/ is for extension localizations. It contains all downloaded translation files.

This path can be retrieved from the Environment API, see getLabelsPath().

var/log/

This directory contains log files like the TYPO3 log, the deprecations log and logs generated by extensions.

vendor/

In this directory, which lies outside of the webroot, all extensions (system, third-party and custom) are installed as Composer packages.

The directory contains folders for each required vendor and inside each vendor directory there is a folder with the different project names.

For example the system extension core has the complete package name typo3/cms-core and will therefore be installed into the directory vendor/typo3/cms-core. The extension news, package name georgringer/news will be installed into the folder vendor/georgringer/news.

Never put or symlink your extensions manually into this directory as it is managed by Composer and any manual changes are getting lost, for example on deployment. Local extensions and sitepackages should be kept in a separate folder outside the web root, for example packages. Upon installation , Composer creates a symlink from packages to vendor/myvendor/my-extension.