I’m trying to deploy TYPO3 version 10 to an EC2 instance using AWS Elastic Beanstalk, however, none of the methods described in the official documentation works (manual installation and via composer). I have created PHP 7.4 environment on Amazon Linux 2 with nginx and tried different ways to get it running: uploaded a source bundle as zip archive for deployment and also tried to install it directly on the machine as the root user. Nothing works! I either get a completely blank page or 403 from nginx. I have also checked the environment: the web-server and PHP work fine, I am able to get info.php page, I am also able to install WordPress on this environment, but not TYPO3! Any ideas what could be the problem here?
Advertisement
Answer
TYPO3 requires some specific actions to deploy/install the system on a fresh instance (see Installation and Upgrade Guide for further details). It is not enough to just upload the source package to an empty web directory.
That said, AWS Elastic Beanstalk supports modern PHP package management out-of-the-box. You can supply a composer.json
file and Elastic Beanstalk takes care of downloading and installing the PHP packages. As this is also supported by TYPO3, you can roll out a complete TYPO3 deployment by uploading a single JSON file as part of your Elastic Beanstalk application setup.
I created a proof-of-concept and a step-by-step documentation, see Github repository. The additional Elastic Beanstalk configuration files create a swap file to prevent out-of-memory issues on small EC2 instances, adjust the PHP and web server settings, and make sure that the system uses the newest Composer version.
To install TYPO3 v10 LTS on AWS Elastic Beanstalk, follow these steps:
➊ Create an application source bundle based on the config files in the Git repository.
git clone https://github.com/typo3-on-aws/typo3-on-elastic-beanstalk cd typo3-on-elastic-beanstalk/source/ zip ../typo3.zip -r * .[^.]*
➋ Configure the environment/application and upload the source bundle (file typo3.zip
).
➌ Open the web application to finish the TYPO3 installation.
Keep in mind that Elastic Beanstalk offers a wide range of options and various setups. It is up to you to plan, design, architect, deploy, and test the solution that meets your project requirements. More sophisticated setups are possible (e.g. TYPO3 across several EC2 instances with a shared file system and shared database), but out-of-scope of the proof-of-concept.
References
- TYPO3 CMS
- AWS Elastic Beanstalk | documentation
- TYPO3-on-Elastic-Beanstalk repository on GitHub, including further details