Productive TYPO3 Development: LAMP/MAMP/WAMP vs Docker/DDEV/Composer

Productive TYPO3 Development: LAMP/MAMP/WAMP vs Docker/DDEV/Composer

Productive TYPO3 Development: LAMP/MAMP/WAMP vs Docker/DDEV/Composer

Nowadays, I’m sure you are hearing more about modern development tools like DDEV, Composer, Docker in TYPO3 universe, and interested in dig-into-depth for the same? Then, you are at the right place!

Here, I would like to guide you from Start to Intermediate level of knowledge to a modern local environment for your TYPO3 projects.

No worries, You will not require any basic or start-up level skills, I have tried my best to write a step-by-step guide to install and configure everything.

What is a Traditional (LAMP, MAMP, WAMP, etc.,) Development?

Productive_TYPO3_Development_with_Docker_DDEV_Composer1

Source: http://pikandeeweb.com/wp-content/uploads/2014/09/lamp_wamp_mamp-blog.gif

So, How are you managing your TYPO3 projects at your local environment? Most probably people still use old-way by separate each software like Apache server, MySQL server, Install PHP, etc.,

Traditional local development environment probably knows as;

  • LAMP (Linux Apache MySQL PHP)
  • MAMP (Mac Apache MySQL PHP)
  • WAMP (Windows Apache MySQL PHP)
  • XAMP (X-cross-platform Apache MySQL PHP)
  • So on.,

Let’s see, How many steps you will need to perform to set up your TYPO3 project?

Step 1: Install & configure Apache, MySQL, PHP

Step 2: Test if everything works together well (probably, you will get issues eg., Permission issue to an apache-www user)

Step 3: Manually prepare Virtual host using Apache conf (eg., typo3-project.local)

Step 4: Download TYPO3 https://get.typo3.org/

Step 5: Test if the server environment is compatible with TYPO3 pre-requisites (probably, you will get issues eg., ImageMagick not installed)

Step 6: Install and configure TYPO3

Step 7: Download and install require TYPO3 extensions from https://extensions.typo3.org/ (probably, you will get issues eg., If a particular extension is dependent on other extensions)

And much more... As you realize, it’s a waste of time to perform each step to just “setup your TYPO3 project”. Don’t you think so?

What’s about Modern Local Development Environment?

Productive_TYPO3_Development_with_Docker_DDEV_Composer2

Source: https://cdn-images-1.medium.com/max/2600/1*asSDJQpw1EQPFN-BqQSU0Q.png

The modern local development environment is one of the most famous, Docker + DDEV + Composer.

Just imagine, you've got a new TYPO3 project, it will set up & run just few simple commands:

ddev config
ddev composer
ddev start

 it cool, huh? I’ll guide, how it works ;)

Traditional vs Modern Development Tools

LAMP/MAMP/WAMP/XAMP vs Docker/DDEV/Composer

  • Traditional Way = Manually Prepare Local Environment + Manually Download TYPO3 and Extensions
  • Modern Way = Automatically Prepare Local Environment + Automatically Setup TYPO3 and Extensions

What are the advantages of Modern ways TYPO3 project setup?

  • Quickly initiate your TYPO3 project
  • Managing dependencies of TYPO3 and Extensions
  • Save time and energy to install and configure your TYPO3 project
  • Avoid confliction of server’s environment
  • More security
  • Platform independencies
  • Speed-up your development
  • Easy deployments
  • Hesitate free development
  • OpenSource free tools
  • And so on.,

Step-by-step Guide to Install and Configure Modern TYPO3 Development

I hope you feel the power and importance of Modern way development, now let’s go through to experience it.

Notes

  • It will be too long to write down a step-by-step guide of each Operating System.
  • For the following example, I’m considering Linux Ubuntu 19 which is my favorite. Of course, I’ll keep writing official documentation reference, so you can find your commands/instructions ;)
  • One more thing, Please make sure to read an official document of your particular Operating system for “System minimum requirement”.

Productive_TYPO3_Development_with_Docker_DDEV_Composer3

Source: https://www.changepond.com/wp-content/uploads/2018/08/docker_post_img8.jpg

Install and Configure Docker Community Edition

The first step to setup Docker which is quite easy. Just open a terminal and run following commands.

Installations

sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

sudo apt-key fingerprint 0EBFCD88

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo apt install apt-transport-https ca-certificates curl software-properties-common

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu disco stable"

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io		

Test-drive

If you’ve successfully run above commands, then check Docker with following:

docker --version

Expected  Output

Productive_TYPO3_Development_with_Docker_DDEV_Composer4

Reference

Read your particular OS installation instruction of Docker at https://hub.docker.com/search/?type=edition&offering=community

Setup Docker Compose

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.

To characterize and run multi-container Docker applications, Compose is just the perfect tool. With Compose, one can utilize their YAML file to arrange their application's administrations. At that point, with a single command, you can begin and create all your service configurations from your design.

Installations

sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Test-drive

docker-compose --version

Expected Output

Productive_TYPO3_Development_with_Docker_DDEV_Composer5

Reference

Read your particular OS installation instruction of Docker Compose at https://docs.docker.com/compose/install/

Check If Docker Works Well

Test-drive

Let’s make sure that you’ve well-setup Docker, Just execute the following command.

docker run hello-world

Expected Output

The docker’s “Hello World” should be like:

Productive_TYPO3_Development_with_Docker_DDEV_Composer6

DDEV - a local PHP development environment system

Productive_TYPO3_Development_with_Docker_DDEV_Composer7

Source: https://workingconcept.com/img/blog/475/mamp-ddev_3d063ec117dfdd7eb20688855c94efd4.png

ddev, an open source tool that makes it very easy to get PHP development local environment ready for action in minutes.

It's ground-breaking and adaptable because of its per-venture condition arrangements, which can be expanded, rendition controlled and shared.
Let me put it plainly, ddev goals to permit developers to utilize Docker in their work process without the complexities of bespoke design.

Installations

curl -L https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh | bash

Test-drive

ddev

Expected Output

Productive_TYPO3_Development_with_Docker_DDEV_Composer8

Reference

Read your particular OS installation instruction of DDEV at https://ddev.readthedocs.io/en/stable/
Hurray! You are ready with Docker, Compose, and DDEV. Now let’s go to quickly set up your first TYPO3 project.

Marc user can watch this video to setup DDEV https://www.youtube.com/watch?v=1kG94UjS8XE

Oh! Wait wait, but what about the composer? No worries, You don’t need to manually install composer, the great DDEV will take care ;)

Test-drive

ddev composer

Expected Output

Productive_TYPO3_Development_with_Docker_DDEV_Composer9

Let’s Setup TYPO3 Project

Can you believe your TYPO3 project will run in a few commands? Follows the steps:

Step 1: Create your project’s folder

mkdir your-typo3-site
cd your-typo3-site

Step 2: Let’s tell DDEV to configure this project as “TYPO3”

ddev config --project-type typo3

Productive_TYPO3_Development_with_Docker_DDEV_Composer10

Step 3: Download latest TYPO3 LTS version

ddev composer create typo3/cms-base-distribution ^9 --no-interaction

Or

ddev composer create typo3/minimal ^9 --no-interaction

Productive_TYPO3_Development_with_Docker_DDEV_Composer11

Tips

Are you looking for custom TYPO3 setup?

composer require typo3/cms-backend typo3/cms-core typo3/cms-extbase typo3/cms-extensionmanager typo3/cms-filelist typo3/cms-fluid typo3/cms-frontend typo3/cms-install typo3/cms-recordlist

Recommend to watch https://get.typo3.org/misc/composer/helper

Step 4: Let’s start DDEV

ddev start

Productive_TYPO3_Development_with_Docker_DDEV_Composer12

Hoho! Your first TYPO3 project is ready! You can access your project, Go to http://your-typo3-site.ddev.local/

Installation and Configuration of TYPO3 CMS

Step 1: Check Server Environment

Well, DDEV already pre-configured every pre-requisites of TYPO3 CMS, so no worries!

Productive_TYPO3_Development_with_Docker_DDEV_Composer13

Step 2: Create an Administrator & Site-name

If you’ve noticed, TYPO3 installation has skipped step 3 and 4. Yeah, because DDEV already pre-configured AdditionalLocalConfiguration.php for the Database settings.

Productive_TYPO3_Development_with_Docker_DDEV_Composer14

Productive_TYPO3_Development_with_Docker_DDEV_Composer15

Step 3: Done!

Everything is done, Just go to backend and start the development of your TYPO3 project.

Productive_TYPO3_Development_with_Docker_DDEV_Composer16

Productive_TYPO3_Development_with_Docker_DDEV_Composer17

Files and Directories Structure of TYPO3

As we have installed TYPO3 CMS using composer, the folder structure will be bit different and more secure compared to traditional TYPO3 setup.

Productive_TYPO3_Development_with_Docker_DDEV_Composer18

.ddev

It contains all the configuration of DDEV especially config.yaml contains TYPO3 setup

composer.json

Based on your installation require and update composer commands, Automatically generate and maintain composer.json

public

Your TYPO3 site has been routed to the public directory which contains typo3conf, fileadmin, typo3 folders, etc.,

var

It contains cache, log and sessions.

vendor

All the vendor packages are located like typo3, typo3fluid, Symfony, etc.,

Install and Maintain TYPO3 extensions through Composer

Productive_TYPO3_Development_with_Docker_DDEV_Composer19

Source: https://i1.wp.com/wp.laravel-news.com/wp-content/uploads/2017/05/composer-2017-version-stats.png?resize=2200%2C1125

Recommend to see my this blog post Step-by-step guide Composer
Now, you don’t need to manually download and install the extension from TER (TYPO3 Extensions Repository) - The free app store of TYPO3.

Download and Installation

composer require nitsan/ns-all-sliders
composer require nitsan/ns_ext_compatibility
composer require nitsan/ns-news-comments

You will easily get it from TER extension detail page.

Productive_TYPO3_Development_with_Docker_DDEV_Composer20

Update TYPO3 Extension

Whenever you get a new release for a particular extension, then just run the composer update command.

composer update nitsan/ns-all-sliders
composer update nitsan/ns_ext_compatibility
composer update nitsan/ns-news-comments

Explored the beauty of DDEV

Here, I would like to show you variance ddev commands and techniques which will help you during the development and deployment.

Access to Database

You may think, How can you access your database? You can access it with port 8036 eg., http://typo3-site.ddev.local:8036

Backdrop Quickstart

Do you want to download and set up the TYPO3 project from a different source, like Git?

git clone https://github.com/username/example-typo3-site
cd example-typo3-site
ddev config
ddev start

Import Your Database

Import a database with just one command; DDEV supports all the formats .sql, sql.gz, mysql, mysql.gz, tar, tar.gz, and zip.

ddev import-db --src=dumpfile.sql.gz

List of all TYPO3 Projects

ddev list

Productive_TYPO3_Development_with_Docker_DDEV_Composer21

See Details of the TYPO3 project

You can find detail information like MySQL server credentials, PHP version, phpMyAdmin, etc.,

ddev describe

Productive_TYPO3_Development_with_Docker_DDEV_Composer22

Email Access

In your traditional local environment, Setup local email server is one the challenge. Magic!! DDEV already does for us by accessing it with port 8025 eg., http://typo3-site.ddev.local:8025

Productive_TYPO3_Development_with_Docker_DDEV_Composer23

Productive_TYPO3_Development_with_Docker_DDEV_Composer24

Recommend

Highly recommend seeing list of commands and techniques which will useful for productive development eg., Connect with SSH, Export database, Importing assets, etc., https://ddev.readthedocs.io/en/stable/users/cli-usage/

Pro-tips

Uninstall LAMP (Apache, MySQL, and PHP) Environment

Are you happy with the above modern solution with Docker, DDEV, and Composer? Then probably you want to remove traditional LAMP environment.

Uninstall Apache Server

sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common

Uninstall MySQL Server

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean

Uninstall PHP

sudo apt-get purge 'php*'

Upgrade DDEV

Keep up-to-date your DDEV latest version :)

curl -L https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh | bash

Conclusion

  • Now, You know and feel the power of modern development with Docker, DDEV, and Composer.
  • We recommend to remove traditional development environment of LAMP, MAMP, WAMP, XAMP, etc., and Keep going with Docker Containers.
  • Of course, whenever you switch to something new, at the initial stage you may face few issues but just overcome it to keep work on world-class development.
  • Just set up your TYPO3 project in 2 mins by typing "ddev start", Heaven for the TYPO3 developer, Isn’t it?

Feedback

Thanks for reading! I would love to receive your feedback, and How do you prefer your TYPO3 local development environment?. Feel free to write down your problems and suggestions at below comment box.

Have a Happy & Productive TYPO3 Projects!

Sanjay Chauhan - TYPO3 Technopreneur

Ein junger Technologie-Enthusiast und Unternehmer. Mit 24 Jahren war er Mitbegründer von NITSAN - einer TYPO3-Agentur in Bhavnagar, Indien. Er ist ein gefragter Vermarkter von NITSAN, akkreditiert mit dem Management von Kundendienstteams, Kooperationen mit Agenturen und Kunden, Projektausführungen und mehr. Ein Tech-Typ im wahrsten Sinne des Wortes, Sanjay ist der eigentliche TYPO3 Guru bei NITSAN.

Hinterlasse einen Kommentar

Need expert tips? Check out our Blog!

Diese Webseite nutzt Cookies

Diese Webseite nutzt Cookies zur Verbesserung des Erlebnisses unserer Besucher. Indem Sie weiterhin auf dieser Webseite navigieren, erklären Sie sich mit unserer Verwendung von Cookies einverstanden.