| name | typo3-ddev |
| description | Best practices for TYPO3 local development with DDEV, including configuration, database management, multi-version testing, and common workflows for v13/v14. Use when working with ddev, local, development, docker, environment, multi-version. |
| compatibility | TYPO3 13.0 - 14.x |
| metadata | {"version":"2.1.0"} |
TYPO3 DDEV Local Development
Compatibility: TYPO3 v13.x and v14.x (v14 preferred)
All configurations in this skill support both TYPO3 v13 and v14.
TYPO3 API First: Always use TYPO3's built-in APIs, core features, and established conventions before creating custom implementations. Do not reinvent what TYPO3 already provides. Always verify that the APIs and methods you use exist and are not deprecated in your target TYPO3 version (v13 or v14) by checking the official TYPO3 documentation.
Container Priority
Always check for existing containers first:
- Check
.ddev/ exists → use ddev exec
- Check
docker-compose.yml exists → use docker compose exec
- Only use system tools if no container environment
Critical: Use the project's configured PHP version, not system PHP.
1. Project Initialization
New TYPO3 Project (v14 - Preferred)
mkdir my-typo3-project && cd my-typo3-project
ddev config --project-type=typo3 --docroot=public --php-version=8.3
ddev start
ddev composer create "typo3/cms-base-distribution:^14"
ddev typo3 setup
New TYPO3 Project (v13 LTS)
mkdir my-typo3-project && cd my-typo3-project
ddev config --project-type=typo3 --docroot=public --php-version=8.2
ddev start
ddev composer create "typo3/cms-base-distribution:^13"
ddev typo3 setup
Existing TYPO3 Project
git clone git@github.com:org/project.git
cd project
ddev config --project-type=typo3 --docroot=public --php-version=8.3
ddev start
ddev composer install
2. Recommended Configuration
.ddev/config.yaml (v13/v14 Compatible)
name: my-typo3-project
type: typo3
docroot: public
php_version: "8.3"
webserver_type: nginx-fpm
database:
type: mariadb
version: "10.11"
host_db_port: "33060"
host_webserver_port: "8080"
host_https_port: "8443"
mailpit_http_port: "8025"
web_environment:
- TYPO3_CONTEXT=Development
- PHP_IDE_CONFIG=serverName=my-typo3-project.ddev.site
hooks:
post-start:
- exec: composer install --no-interaction
.ddev/config.local.yaml (Personal Overrides)
host_db_port: "33061"
PHP Version Matrix
| TYPO3 Version | Minimum PHP | Recommended PHP | MariaDB |
|---|
| v13.4 LTS | 8.2 | 8.3 | 10.11+ |
| v14.x | 8.2 | 8.3 / 8.4 | 10.11+ |
3. Database Operations
Import Database
ddev import-db --file=dump.sql
ddev import-db --file=dump.sql.gz
ssh user@server "mysqldump -u root dbname | gzip" | gunzip | ddev import-db
Export Database
ddev export-db --file=backup.sql.gz
ddev export-db --gzip=false --file=backup.sql
Database Snapshots
ddev snapshot --name=before-upgrade
ddev snapshot --list
ddev snapshot restore before-upgrade
ddev snapshot delete before-upgrade
Direct MySQL Access
ddev mysql
ddev mysql -e "SELECT uid, title FROM pages WHERE hidden = 0"
4. TYPO3 CLI Commands
Console Commands
ddev typo3 list
ddev typo3 cache:flush
ddev typo3 cache:flush --group=pages
ddev typo3 database:updateschema
ddev typo3 referenceindex:update
ddev typo3 scheduler:run
ddev typo3 upgrade:list
ddev typo3 upgrade:run
Extension Management
ddev composer require typo3/cms-seo
ddev composer require vendor/extension-name
ddev typo3 extension:setup
ddev typo3 extension:activate my_extension
ddev typo3 extension:deactivate my_extension
5. Composer Operations
ddev composer install
ddev composer update
ddev composer update typo3/cms-core --with-dependencies
ddev composer require "vendor/package:^1.0"
ddev composer remove vendor/package
ddev composer clear-cache
Dual-Version Development
For extensions supporting both v13 and v14:
ddev composer require "typo3/cms-core:^13.0 || ^14.0" --no-update
6. File Operations
SSH into Container
ddev ssh
ddev ssh -s web -u root
ddev ssh -s db
File Sync
ddev exec cp /path/in/container /other/path
docker cp localfile.txt ddev-myproject-web:/var/www/html/
ddev exec cat /var/www/html/somefile > localfile
7. Debugging with Xdebug
Enable/Disable
ddev xdebug on
ddev xdebug off
ddev xdebug status
IDE Configuration (PhpStorm/Cursor)
- Set breakpoint in PHP file
- Start listening for connections (PhpStorm: "Start Listening")
- Enable Xdebug:
ddev xdebug on
- Trigger request in browser
- Debugger should connect
Xdebug Environment
web_environment:
- XDEBUG_MODE=debug,develop
- XDEBUG_CONFIG=client_host=host.docker.internal
8. Multi-Site Configuration
Additional Hostnames
additional_hostnames:
- site1
- site2
additional_fqdns:
- site1.myproject.ddev.site
- site2.myproject.ddev.site
Site Configuration
mkdir -p config/sites/site1
base: 'https://site1.myproject.ddev.site/'
rootPageId: 1
languages:
- title: English
languageId: 0
locale: en_US.UTF-8
9. Services and Add-ons
Common Add-ons
ddev get ddev/ddev-redis
ddev get ddev/ddev-elasticsearch
ddev get ddev/ddev-solr
Custom Services
services:
redis:
image: redis:7-alpine
container_name: ddev-${DDEV_SITENAME}-redis
command: redis-server --appendonly yes
volumes:
- redis-data:/data
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
volumes:
redis-data:
Redis Caching Configuration (v13/v14)
<?php
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['hash']['backend']
= \TYPO3\CMS\Core\Cache\Backend\RedisBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['hash']['options'] = [
'hostname' => 'redis',
'port' => 6379,
'database' => 0,
];
10. Troubleshooting
Common Issues
ddev restart
ddev stop && ddev start
ddev delete -O && ddev start
ddev logs
ddev logs -s web
ddev logs -s db
Port Conflicts
lsof -i :80
router_http_port: "8080"
router_https_port: "8443"
Permission Issues
ddev exec chmod -R g+w var/
ddev exec chmod -R g+w public/fileadmin/
ddev exec chmod -R g+w public/typo3temp/
11. Environment Variables
TYPO3 Context
TYPO3_CONTEXT=Development
TYPO3_CONTEXT=Production
TYPO3_CONTEXT=Development/Docker
Custom Variables
web_environment:
- MY_API_KEY=secret123
- FEATURE_FLAG=enabled
Access in TYPO3:
<?php
$apiKey = getenv('MY_API_KEY');
$apiKey = $_ENV['MY_API_KEY'];
12. Best Practices
Performance
- Disable Xdebug when not debugging (
ddev xdebug off)
- Use snapshots instead of full imports for quick state changes
- Mount with Mutagen on macOS for better file sync performance
- Use PHP 8.3 for best performance on v13/v14
Team Workflow
- Commit
.ddev/config.yaml to repository
- Gitignore
.ddev/config.local.yaml for personal overrides
- Document additional setup steps in
README.md
- Share database snapshots for consistent development data
Security
- Never expose DDEV ports publicly
- Don't use DDEV in production
- Rotate any sensitive data in development databases
13. Multi-Version Testing (Extension Development)
When developing extensions that need to work across multiple TYPO3 versions:
Setup for Multi-Version Testing
name: my-extension
type: php
docroot: ""
php_version: "8.3"
additional_hostnames:
- v13
- v14
Install Multiple TYPO3 Versions
mkdir -p v13 v14
cd v13
ddev composer create "typo3/cms-base-distribution:^13"
cd ..
cd v14
ddev composer create "typo3/cms-base-distribution:^14"
cd ..
ln -s ../../../ v13/packages/my_extension
ln -s ../../../ v14/packages/my_extension
Access URLs
| Environment | URL |
|---|
| TYPO3 v13 | https://v13.my-extension.ddev.site/typo3/ |
| TYPO3 v14 | https://v14.my-extension.ddev.site/typo3/ |
Default Credentials: admin / Joh316!
Version-Specific Commands
ddev exec -d /var/www/html/v13 vendor/bin/phpunit
ddev exec -d /var/www/html/v14 vendor/bin/phpunit
ddev exec -d /var/www/html/v13 vendor/bin/typo3 cache:flush
Credits & Attribution
Thanks to Netresearch DTT GmbH for their contributions to the TYPO3 community.