Study guide · Hardening server and installation

Hardening the server and the TYPO3 installation

As of November 22, 2026 · TYPO3 14.3 LTS, as of autumn 2026 · about 20 min read

A TYPO3 website is only as secure as the server it runs on. Many break-ins do not succeed through a hole in TYPO3, but through open folders, generous permissions, a forgotten backup or a database that anyone can reach. On this page you learn how to set up the document root, file permissions, web server, database and backups so that a single mistake does not open everything. As a running example, you look after the website of a sports club at example.org.

The document root points to public

The document root is the folder that the web server delivers to the outside world. Everything in it can in principle be retrieved via the browser. In a Composer installation it therefore points to the folder public. Only files that must be public live there: index.php, the folder fileadmin, the folder typo3temp and the folder _assets with the public files of the extensions.

Everything else sits one level higher in the project folder and so outside the web root. This includes composer.json and composer.lock and the folder vendor with the libraries. It also includes the folder config with the configuration and the folder var with caches, logs and sessions. That is why the Composer structure is considered more secure than a classic installation. Internal files cannot be reached at all. Long deny lists for single files become largely unnecessary.

In a classic installation, also called classic mode, almost everything lies in the web root. This includes the folder typo3conf with configuration and extensions and the folder typo3temp/var with logs and sessions. Here, deny rules in the web server must block access. More on that in the section about the web server.

Write access as narrow as possible

The web server should only be allowed to write where TYPO3 really writes at runtime. If the web server can change program code, so can an attacker who has found an upload hole or code execution.

In a Composer installation the web server needs write access to exactly three places:

  • The folder public/fileadmin takes the editors' uploads.
  • The folder public/typo3temp holds generated files such as resized images.
  • The folder var holds caches, logs and sessions.

vendor, composer.json and public/index.php stay read-only. The folder public/_assets also needs read access only at runtime. Composer creates it during deployment, and nobody has to write into it afterwards.

The folder config is read-only in production as well, with two deliberate exceptions. If sites are to be edited in the backend, the web server needs write access to config/sites. If system maintainers are to change settings in the module System, Settings, the file settings.php in the folder config/system must be writable. The module writes its values there. TYPO3 never writes the file additional.php next to it. It holds overrides that you maintain by hand.

Write access with Composer project folder composer.json read-only vendor/ read-only config/ read-only sites/ backend site editing system/settings.php Settings module var/ writable public/ index.php read-only _assets/ read-only fileadmin/ writable typo3temp/ writable document root writable read-only exception
Write access in a Composer installation. Only three places are always writable, two more only when needed.

In a classic installation the folder fileadmin, the folder typo3temp and selected folders in typo3conf get write access. The folder typo3conf/l10n must be writable so that TYPO3 can download language packs. The folders typo3conf/ext and typo3conf/autoload and the file PackageStates.php are only needed by the Extension Manager when it installs or updates extensions. If extensions only arrive via deployment, you withdraw write access there. The folder typo3/sysext with the system extensions and the folder vendor must never be writable.

TYPO3 itself shows whether the permissions are right. In the module Environment of the System group you find Directory Status. It lists folders such as fileadmin or config with the recommended permissions. So after every deployment you check whether everything necessary is writable.

On a shared hosting server one more rule applies: each virtual host must run under its own system user. If all websites run as the same user, one hacked website can read and change the files of all the others. That includes their settings.php with the database credentials. Permissions like 777 for everyone are never a solution.

Web server: block listings and sensitive files

Directory indexing means: if a folder has no index file such as index.php or index.html, some web servers list the folder's contents. That reveals file structures, even to search engines. TYPO3's default .htaccess switches off the listing on Apache.

# Apache, in the .htaccess
Options -Indexes

# nginx, in the server block
autoindex off;
The Apache directive Options minus Indexes, which switches off directory listing. Below it the matching switch for nginx, autoindex off.

nginx does not show listings by default anyway. But nginx has another catch: it does not evaluate .htaccess files. On Apache and IIS, TYPO3 in classic mode creates configuration files with deny rules. nginx has no per-directory configuration. You have to write the rules into the server block yourself.

After every change, check whether sensitive addresses really are blocked. The guidelines name examples that should all respond with HTTP 403:

  • the Git data, for example the file .git/index,
  • the logs in the folder typo3temp/var/log,
  • the configuration, for example typo3conf/system/settings.php,
  • the Composer files, for example composer.lock.

The folder typo3, on the other hand, is the entry to the backend and must stay reachable.

Rules by file extension, for example FilesMatch for .sql or .bak, are only a workaround. They only catch patterns that you know today. You cannot predict what future files will be called. The right way is not to put sensitive files into the web root at all.

The deny rules need maintenance. After every update to a new major version, you compare your own .htaccess with the current template root-htaccess. For IIS the template is called root-web-config. Both lie in the system extension install in the folder FolderStructureTemplateFiles.

Read on

You can read the introduction and the first 3 of 10 sections here for free. There are two ways to get the whole learning page:

Free with a confirmed e-mail address

Sign up with your e-mail address and confirm it. You can then unlock the learning pages of one set of your choice completely, once, in the browser or in the app.

Unlock for free

Buy the course

The course includes all its questions and the whole learning page.

View the course
These 7 sections are still missing
  1. MIME types and the PHP handler
  2. Securing the database
  3. Backups: separate and over several periods
  4. Hosting, PHP and encrypted channels
  5. Watching logins and preventing clickjacking
  6. Files only for logged-in users
  7. The essentials in brief

Qwissit is also available as an app for iPhone and Android:

As of: November 22, 2026 (TYPO3 14.3 LTS, as of autumn 2026)

Sources:

  • TYPO3 Explained 14.3, chapter Security, Guidelines for system administrators (docs.typo3.org)
  • TYPO3 Explained 14.3, chapter Security, General guidelines and Types of threats
  • TYPO3 Installation Guide 14.3, directory structure and file permissions
  • Source code TYPO3 14.3 (typo3/cms-core and typo3/cms-install), DefaultConfiguration.php and the templates in FolderStructureTemplateFiles
  • Apache HTTP Server 2.4, documentation of mod_mime and mod_autoindex

This study guide was written with AI and compared with the sources.

Certifications & exams

Which exam comes next?

You can already practise for 60 exams, and 7 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications