Deploying TYPO3 Using Git and Composer

This guide describes how to deploy a TYPO3 project directly onto your server using Git and Composer, without the need for additional deployment tools.

This method is simple to set up and requires no external deployment services, but it does require Git and Composer to be installed on the server and may cause downtime during updates.

For a detailed comparison with other deployment methods, including Deployer and rsync, see section Comparison of deployment methods.

Quick start: Deploy with Git and Composer

Execute the following in the folder into which your project was originally cloned. The folder must contain the .git directory.

cd /var/www/your-project
git pull
composer install --no-dev
vendor/bin/typo3 database:updateschema
vendor/bin/typo3 cache:flush
Copied!

This performs a basic update of your project code and dependencies in production mode.

See also chapter Finding or installing Composer on the server.

Detailed deployment instructions

The following sections explain the deployment process step by step.

Prerequisites:

Step 1: Clone or update the repository

First-time setup:

git clone <your-git-repository-url> /var/www/your-project
cd /var/www/your-project
Copied!

On subsequent deployments:

cd /var/www/your-project
git pull
Copied!

Step 2: Install production dependencies

Install only production-relevant packages by running:

composer install --no-dev --ignore-platform-reqs
Copied!

Parameter --no-dev excludes development packages. If the PHP version running on the console and the PHP version running on the server differ, you may need to use --ignore-platform-reqs to skip platform checks.

Step 3: Run TYPO3 maintenance commands

Apply database schema updates if required:

vendor/bin/typo3 database:updateschema
Copied!

Clear TYPO3 caches:

vendor/bin/typo3 cache:flush
Copied!

Optional: Run project-specific tasks as needed.