Skip to main content
Version: 8.x

How to Deploy a TYPO3 Project

require 'recipe/typo3.php';

Source

Deployer is a free and open source deployment tool written in PHP. It helps you to deploy your TYPO3 application to a server. It is very easy to use and has a lot of features.

Three main features of Deployer are:

  • Provisioning - provision your server for you.
  • Zero downtime deployment - deploy your application without a downtime.
  • Rollbacks - rollback your application to a previous version, if something goes wrong.

Additionally, Deployer has a lot of other features, like:

  • Easy to use - Deployer is very easy to use. It has a simple and intuitive syntax.
  • Fast - Deployer is very fast. It uses parallel connections to deploy your application.
  • Secure - Deployer uses SSH to connect to your server.
  • Supports all major PHP frameworks - Deployer supports all major PHP frameworks.

You can read more about Deployer in Getting Started.

The deploy task of TYPO3 consists of:

The typo3 recipe is based on the common recipe.

TYPO3 Deployer Recipe

Usage Examples:

Deploy to production (using Git as source): vendor/bin/dep deploy production

Deploy to staging using rsync: # In deploy.php or servers config, enable rsync set('use_rsync', true); vendor/bin/dep deploy staging

Common TYPO3 commands: vendor/bin/dep typo3:cache:flush # Clear all TYPO3 caches vendor/bin/dep typo3:cache:warmup # Warmup system caches vendor/bin/dep typo3:language:update # Update extension language files vendor/bin/dep typo3:extension:setup # Set up all extensions vendor/bin/dep typo3:install:fixfolderstructure # Automatically create required files and folders for TYPO3

Configuration

composer_config

Source

Parse composer.json and return its contents as an array. Used for auto-detecting TYPO3 settings like public_dir and bin_dir.

Default value
return json_decode(file_get_contents('./composer.json'), true, 512, JSON_THROW_ON_ERROR);

typo3/public_dir

Source

TYPO3 public (web) directory. Automatically determined from composer.json. Defaults to "public".

Autogenerated

The value of this configuration is autogenerated on access.

bin/typo3

Source

Path to the TYPO3 CLI binary. Determined from composer.json "config.bin-dir" or defaults to "vendor/bin/typo3".

Autogenerated

The value of this configuration is autogenerated on access.

log_files

Source

Log files to display when running ./vendor/bin/dep logs:app

Default value
'var/log/typo3_*.log'

shared_dirs

Source

Overrides shared_dirs from recipe/deploy/shared.php.

Directories that persist between releases. Shared via symlinks from the shared/ directory.

Default value
[
'{{typo3/public_dir}}/fileadmin',
'{{typo3/public_dir}}/typo3temp/assets',
'var/lock',
'var/log',
'var/session',
'var/spool',
]

writable_dirs

Source

Overrides writable_dirs from recipe/deploy/writable.php.

Writeable directories

Default value
[
'{{typo3/public_dir}}/fileadmin',
'{{typo3/public_dir}}/typo3temp/assets',
'var/cache',
'var/lock',
'var/log',
]

composer_options

Source

Overrides composer_options from recipe/deploy/vendors.php.

Composer install options for production.

Default value
' --no-dev --verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader'

use_rsync

Source

If set in the config this recipe uses rsync. Default setting: false (uses the Git repository)

Default value
false

update_code_task

Source

Default value
return get('use_rsync') ? 'rsync' : 'deploy:update_code';

rsync

Source

Default value
[
'exclude' => array_merge(get('shared_dirs'), get('shared_files'), $exclude),
'exclude-file' => false,
'include' => ['vendor'],
'include-file' => false,
'filter' => ['dir-merge,-n /.gitignore'],
'filter-file' => false,
'filter-perdir' => false,
'flags' => 'avz',
'options' => ['delete', 'keep-dirlinks', 'links'],
'timeout' => 600,
]

typo3_updateschema_types

Source

List of schema update types. safe includes all necessary operations, to add or change fields or tables.

Default value
'safe'

Tasks

typo3:update_code

Source

typo3:cache:flush

Source

TYPO3 - Clear all caches.

TYPO3 Commands All run via bin/php release_path/bin/typo3

typo3:cache:warmup

Source

TYPO3 - Cache warmup for system caches.

typo3:language:update

Source

TYPO3 - Update the language files of all activated extensions.

typo3:extension:setup

Source

TYPO3 - Set up all extensions.

typo3:install:fixfolderstructure

Source

TYPO3 - Fix folder structure.

deploy

Source

Deploys a TYPO3 project.

Main deploy task for TYPO3.

  1. Lock deploy to avoid concurrent runs
  2. Create release directory
  3. Update code (Git or rsync)
  4. Symlink shared dirs/files
  5. Fix TYPO3 folder structure
  6. Ensure writable dirs
  7. Run extension setup & perform schema updates
  8. Update language files
  9. Install composer vendors
  10. Flush caches
  11. Warm up TYPO3 caches
  12. Unlock and clean up

This task is group task which contains next tasks: