How to Configure PHP Deployer in TYPO3?

Do you want to use most popular PHP Deployer in TYPO3 project? Follow these guide to Install Deployer, Configure Hosts, TYPO3 PHP Deployer code.

Step 1. Install PHP Deployer

// Download latest PHP Deployer
curl -LO

// Switch to root user + Move to bin to access "dep" command
sudo -s
mv deployer.phar /usr/local/bin/dep
chmod +x /usr/local/bin/dep

// Verify the installation
dep --version

Step 2. Configure PHP Deployer Hosts.yml

# Create .hosts.yaml at root of your project

# Configure Staging Server
  host: DOMAIN/IP
  user: username
  stage: staging
  branch: staging
  identity_file: ~
  deploy_path: /var/www/your/path/

# Configure Production Server
  host: DOMAIN/IP
  user: username
  stage: production
  branch: master
  identity_file: ~
  deploy_path: /var/www/your/path/

Step 3. Prepare TYPO3 Deploy.php


// Create deploy.php at root of your project

namespace Deployer;
require 'recipe/common.php';

# Project name
set('application', 'project');

# Define Git-Repository
set('repository', '[email protected]:yourpath/project.git');

# [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true); 

# Set maxium releases backup
set('keep_releases', 5);

# Set Server

# DocumentRoot / WebRoot for the TYPO3 installation
set('typo3_webroot', 'public');

# Main TYPO3 task
task('deploy', [
])->desc('Deploy your project');
after('deploy', 'success');

# Shared directories
set('shared_dirs', [

# Shared files
set('shared_files', [

# Writeable directories
set('writable_dirs', [

# [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');

Step 4. Done! Go ahead to deploy.


dep deploy

Post a Comment


Got answer to the question you were looking for?