Deployer for TYPO3 Deployment

Deployer is a deployment tool written in PHP. Internally Deployer uses Rsync.

Deployer can be used to create recipes that automate execution of the deployment steps.

Deployer recipes for TYPO3

SourceBroker's Deployer - Extended TYPO3

This recipe extends Deployer's capabilities to cover TYPO3 projects. It includes advanced features like database and file synchronization, multi-environment support, and integration with the TYPO3 Console.

See: sourcebroker/deployer-extended-typo3.

Helhum Deployer recipe

This TYPO3 Deployer Recipe from Helhum can be forked and adapted to your needs.

GitLab template Deployer recipe for TYPO3

If you have created your project using the official GitLab template, it will already contain a Deployer template.

You can configure Deployer by editing the YAML configuration file deploy.yaml in the project root. The Deployer recipe is found in packages/site-distribution/Configuration/DeployerRsync.php.

The project also contains a .gitlab-ci.yml for automated deployment.

To start using Deployer, deploy.yaml should look like this:

.gitlab-ci.yml
# Deployer Docs https://deployer.org/docs/7.x/basics
import:
  - packages/site-distribution/Configuration/DeployerRsync.php

config:
  repository: '.'                          # Stays as-is if deploying the current project
  writable_mode: 'chmod'                    # Usually fine unless you have ACL or other needs
  bin/php: 'php'                           # Adjust if PHP is not available as 'php' on remote
  bin/composer: '{{bin/php}} /usr/bin/composer'  # Adjust path if composer lives elsewhere

hosts:
  staging:
    hostname: staging.example.com          # Replace with your staging server hostname or IP
    remote_user: deploy                    # Replace with your SSH user
    deploy_path: /var/www/staging-project  # Replace with target directory on remote server
    rsync_src: './'                        # Usually './' is correct (deploys the current dir)
    ssh_multiplexing: false                # Usually fine as-is
    php_version: '8.2'                     # Just metadata, but can be used in your recipe

  production:
    hostname: www.example.com              # Replace with your production server hostname or IP
    remote_user: deploy                    # Replace with your SSH user
    deploy_path: /var/www/production-project # Replace with target directory on remote server
    rsync_src: './'                        # Usually './' is correct (deploys the current dir)
    ssh_multiplexing: false                # Usually fine as-is
    php_version: '8.2'                     # Just metadata, but can be used in your recipe
Copied!

Official Deployer recipe for TYPO3 <= 11.5

The Deployer documentation describes an official TYPO3 (classic mode) Deployer recipe.

However, this recipe is only correct for TYPO3 projects up to version 11.5, using the classic directory structure. For newer TYPO3 versions with Composer-based setups, this recipe requires manual changes.

Manual deployment from DDEV

For manual deployment from DDEV, authenticate your server’s SSH key, for example with ddev auth ssh (see the DDEV documentation: SSH Into Containers).

Install Deployer in your project using Composer:

ddev composer require --dev deployer/deployer
Copied!

List available Deployer tasks:

ddev exec vendor/bin/dep list
Copied!

Choose (and make any necessary changes to) a suitable deployer recipe for your project. Then deploy to your staging server:

ddev exec vendor/bin/dep deploy -vvv staging
Copied!

This assumes you have defined a staging server in your deploy.yaml configuration.

Manual deployment outside of DDEV

Deployer can be run on your local machine or in other environments (Docker or native PHP setups) without using DDEV.

First, install Deployer globally using Composer:

composer global require deployer/deployer
Copied!

Make sure the global Composer vendor/bin directory is in your system’s PATH.

Then list available tasks with:

dep list
Copied!

And deploy to a configured environment, for example:

dep deploy -vvv staging
Copied!

Refer to your deploy.yaml or deploy.php for environment and task definitions.

Automatic deployment via CI/CD

Deployer can be integrated into automated deployment pipelines, such as GitLab CI/CD, GitHub Actions, and other CI systems.

For example, the official TYPO3 GitLab template includes a .gitlab-ci.yml file with deployment stages.

You can configure these stages for automated deployment each time code is pushed to your repository.

Deployer's SSH requirements

Deployer will connect to your servers via SSH. You must ensure that your deployment user has passwordless SSH access to the target server.

You can test SSH access with:

ssh <your-ssh-user>@<your-server>
Copied!

If you can connect without entering a password, SSH is correctly set up.

Typically your SSH key is managed via your local SSH agent, for example:

eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa
Copied!

You may also need to add your server to the known hosts file:

ssh-keyscan <your-server> >> ~/.ssh/known_hosts
Copied!