Installing TYPO3 with DDEV: A Step-by-Step Guide

Installing TYPO3 with DDEV: A Step-by-Step Guide

Welcome to our comprehensive guide on Installing TYPO3 with DDEV—a step-by-step journey into setting up the TYPO3 development environment. In this tutorial, we will walk you through the process of harnessing the power of DDEV, Docker, and Composer to create a local development environment for TYPO3. Whether you're an experienced developer or just beginning your TYPO3 journey, this guide will provide you with the tools and knowledge to have your TYPO3 development workflow. Let's get on with Installing TYPO3 with DDEV!

Things to Keep in Mind

Before we begin, make sure you have the following prerequisites installed on your local setup:

  • Get the Docker Installed
  • Get the DDEV Installed

Note: DDEV and Docker must be installed before proceeding with TYPO3 installation. If you encounter any issues while installing DDEV, you can seek support on the DDEV Discord server.

How to Install Docker?

Visit https://www.docker.com/ to download and install the recommended version of Docker for your operating system.

How to Install DDEV?

Follow the DDEV installation guide to install DDEV.

Creating the Installation Directory

  1. Open your terminal or command prompt.
  2. Create a new directory where you want to install TYPO3. 

For example:

mkdir t3example
   cd t3example

Creating a New DDEV Project

Now, let's create a new DDEV project for TYPO3

When prompted, provide the following information:

ddev config --php-version 8.1

# Give the following answers when prompted:

Project name (t3example):

Docroot Location (current directory): public

Create docroot at /home/myuser/projects/t3/t3example/public? [Y/n] (yes): Y

Project Type [php, typo3, ...] (php): typo3

Alternatively, you can supply all the required parameters in a single command:

ddev config --project-type=typo3 --docroot=public --create-docroot --php-version 8.1

Please Note:

Project Type: It is essential to set this value as "typo3."

Docroot: This directory contains all the files accessible through a web browser. Typically, it's referred to as the "public" folder.

Create-Docroot: By enabling this option, DDEV will create the directory if it doesn't already exist, ensuring a smooth setup process.

Starting the Project

Once the project is configured, start it by running:

ddev start

Note: TYPO3 is not installed yet.

Installing TYPO3

To install TYPO3, use Composer by running the following command within your project directory:

ddev composer create "typo3/cms-base-distribution:^12"

When prompted, confirm that it's okay to overwrite files in this directory by typing "yes."

Congratulations! You now have a Composer-based TYPO3 installation.

Running the Installation Setup Tool

With TYPO3 installed, you can set it up using either the command line or the web-based installer.

Command Line Setup (TYPO3 12.1 and newer):

Starting with TYPO3 12.1, you can use a CLI command to set up TYPO3:

ddev exec ./vendor/bin/typo3 setup

Web-Based Setup (1,2,3 Install Tool):

1. Create a file named `FIRST_INSTALL` in your webroot:
Generate a file named 'FIRST_INSTALL' within your webroot using the following command.

ddev exec touch public/FIRST_INSTALL

2.Now, open the installer in your browser:
Launch the TYPO3 installer by running:

ddev launch typo3/install.php

3.Access the TYPO3 Backend:
After completing the installation, navigate to the TYPO3 backend by entering:

ddev launch typo3

You can now log in using the credentials you provided during the installation process.

Managing the Database

DDEV automatically created a database for your TYPO3 project during configuration. Database credentials are stored in the `config/system/additional.php` file.

To interact with the database, you can use the following command:

ddev launch -p

Sending E-Mail

DDEV sets up a configuration for fake email sending in `config/system/additional.php`. You can check what emails have been sent using the following command:

ddev launch -m

Stopping a DDEV Instance

To stop all running DDEV projects, use the following command:

ddev poweroff

Deleting a DDEV Instance

If you need to delete a specific project, navigate to the project's root folder and use the following command:

ddev delete --omit-snapshot

This will remove all containers related to the project and delete the associated database.

Conclusion

You've successfully installed TYPO3 on your local machine using DDEV, Docker, and Composer. This development environment allows you to build and test TYPO3 websites and applications with ease. Happy TYPO3 development! 

You might find similar topics of interest on this blog here:

Comments and Responses

×

Name is required!

Enter valid name

Valid email is required!

Enter valid email address

Comment is required!

* These fields are required.

Be the First to Comment