Setting up TYPO3 v13 on Strato with Composer

This guide outlines the steps to install TYPO3 v13 using Composer on a Strato hosting environment. Strato’s shared hosting typically requires some specific configurations, especially for CLI tools like Composer.

1. SSH Access and Initial Setup

First, ensure you have SSH access to your Strato hosting account. Refer to the Strato FAQ for details: https://www.strato.de/faq/hosting/so-nutzen-sie-ihren-ssh-sftp-zugang/

2. Configure PHP Settings (php.ini)

TYPO3 and Composer require more generous PHP limits than the default Strato settings. Create or edit your php.ini file in your main web directory (e.g., htdocs/php.ini) using vi or your preferred text editor:

vi php.ini

Add or modify the following lines:

max_execution_time = 300
max_input_time = 300
memory_limit = 512M
suhosin.executor.include.whitelist = phar
detect_unicode = Off
register_argc_argv=On

Note: The suhosin.executor.include.whitelist = phar might be specific to older PHP versions or certain Strato configurations. If you encounter issues, you might try removing it or consulting Strato support.

3. Configure Bash Aliases for Composer

To make using Composer easier, set up an alias in your ~/.bashrc file. This is crucial because Strato often requires you to explicitly specify the PHP CLI path.

vi ~/.bashrc

Add the following lines (adjust the paths to your specific Strato environment and the TYPO3 installation directory):

alias composer="/opt/RZphp84/bin/php-cli bin/composer/composer.phar"
alias l='ls -lha'
alias ll='ls -lha'

After saving the ~/.bashrc file, apply the changes:

source ~/.bashrc

4. Install Composer

Now, let’s install Composer.

First, create the necessary directories:

mkdir bin
mkdir bin/composer

Check your PHP version to ensure it’s compatible with TYPO3 v13 (PHP 8.2 or newer is recommended for TYPO3 13):

php --version

Download the Composer installer and move it to your bin/composer directory:

curl -sS [https://getcomposer.org/installer](https://getcomposer.org/installer) | php
mv composer.phar bin/composer

Verify the Composer installation:

composer --version
composer diagnose

The composer diagnose command will check for common issues and confirm your setup is ready.

5. Install TYPO3 v13

Now we can create the TYPO3 project using Composer. Navigate to your web root if you aren’t there already.

composer create-project typo3/cms-base-distribution typo313 "^13"

This command will download the TYPO3 v13 base distribution into a new directory named typo313.

6. First TYPO3 Install Tool Access

Navigate into the public directory of your new TYPO3 installation:

cd typo313/public/

Now, access your TYPO3 installation in your web browser by navigating to yourdomain.com/typo313/public/. This should redirect you to the TYPO3 Install Tool. Follow the on-screen instructions to complete the basic installation.

For detailed instructions on using the Install Tool, refer to the official TYPO3 documentation: https://docs.typo3.org/m/typo3/guide-installation/10.4/en-us/QuickInstall/TheInstallTool/Index.html#the-install-tool (Note: While this links to an older version, the general principles of the Install Tool remain similar).

The Bootstrap Package is a great starting point for most TYPO3 projects.

From your typo313 directory (not typo313/public), install the package:

composer require bk2k/bootstrap-package

After installation, set up the extension using the TYPO3 CLI:

/opt/RZphp84/bin/php-cli -f vendor/bin/typo3 extension:setup

8. Exporting and Importing TYPO3 Data (Advanced)

These commands are useful for migrating or backing up specific parts of your TYPO3 installation. Replace /opt/RZphp82/bin/php-cli with the correct PHP CLI path for your Strato environment if it differs.

Exporting Data (e.g., content, users, system settings):

This command exports a comprehensive set of data, including content, users, and system configurations. The --include-related flags ensure all associated data is also exported.

/opt/RZphp82/bin/php-cli -f typo3/sysext/core/bin/typo3 impexp:export --type=t3d --pid=1 --levels=999 \
--table=backend_layout \
--table=be_dashboards \
--table=be_groups \
--table=be_users \
--table=fe_groups \
--table=fe_users \
--table=sys_category \
--table=sys_file \
--table=sys_file_collection \
--table=sys_file_metadata \
--table=sys_file_reference \
--table=sys_file_storage \
--table=sys_filemounts \
--table=sys_language \
--table=sys_news \
--table=sys_note \
--table=sys_template \
--table=tt_content \
--include-related=_backend_layout \
--include-related=be_dashboards \
--include-related=be_groups \
--include-related=be_users \
--include-related=fe_groups \
--include-related=fe_users \
--include-related=sys_category \
--include-related=sys_file \
--include-related=sys_file_collection \
--include-related=sys_file_metadata \
--include-related=sys_file_reference \
--include-related=sys_file_storage \
--include-related=sys_filemounts \
--include-related=sys_language \
--include-related=sys_news \
--include-related=sys_note \
--include-related=sys_template \
--include-related=tt_content \
--exclude-html-css \
--save-files-outside-export-file \
-vvv

Importing Data:

This command imports a previously exported .t3d file. Adjust the path to your exported file.

/opt/RZphp82/bin/php-cli -f vendor/bin/typo3 impexp:import --force-uid --enable-log typo313/public/fileadmin/user_upload/_temp_/importexport/T3D_tree_PID0_L1_2024-12-29_12-32.t3d -vvv

Exporting Users and Dashboard Settings (example):

This is a more specific export for user and dashboard related data.

/opt/RZphp82/bin/php-cli -f typo3/sysext/core/bin/typo3 impexp:export --type=t3d --pid=0 --levels=1 \
--table=be_dashboards \
--table=be_groups \
--table=be_users \
--table=fe_groups \
--table=fe_users \
--include-related=be_dashboards \
--include-related=be_groups \
--include-related=be_users \
--include-related=fe_groups \
--include-related=fe_users \
--exclude-html-css \
--save-files-outside-export-file \
-vvv

9. Creating a Custom Site Package

For custom themes and functionalities, you’ll want to create your own site package. TYPO3 offers a convenient tool for this:

Visit https://get.typo3.org/sitepackage/new/ to generate the basic structure of your site package.

Once generated, place the downloaded site package into your packages directory within your TYPO3 installation (e.g., typo313/packages/). Then, install it via Composer:

composer require my-vendor/my-site-package:@dev

Replace my-vendor/my-site-package with the actual vendor and package name of your generated site package. The @dev constraint is often used during development.