github.com/ddev/ddev@v1.23.2-0.20240519125000-d824ffe36ff3/docs/content/users/quickstart.md (about) 1 # CMS Quickstarts 2 3 DDEV is [ready to go](./project.md) with generic project types for PHP and Python frameworks, and more specific project types for working with popular platforms and CMSes. To learn more about how to manage projects in DDEV visit [Managing Projects](../users/usage/managing-projects.md). 4 5 Before proceeding, make sure your installation of DDEV is up to date. In a new and empty project folder, using your favorite shell, run the following commands: 6 7 ## Backdrop 8 9 To get started with [Backdrop](https://backdropcms.org), clone the project repository and navigate to the project directory. 10 11 === "New projects" 12 13 ```bash 14 mkdir my-backdrop-site && cd my-backdrop-site 15 curl -LJO https://github.com/backdrop/backdrop/releases/latest/download/backdrop.zip 16 unzip ./backdrop.zip && rm backdrop.zip && mv -f ./backdrop/{.,}* . && rm -r backdrop 17 ddev config --project-type=backdrop 18 ddev start 19 ddev launch 20 ``` 21 22 === "Existing projects" 23 24 You can start using DDEV with an existing project, too—but make sure you have a database backup handy! 25 26 27 ```bash 28 # Clone an existing repository (or navigate to a local project directory): 29 git clone https://github.com/example/example-site my-backdrop-site 30 cd my-backdrop-site 31 32 # Set up the DDEV environment: 33 ddev config --project-type=backdrop 34 35 # Boot the project and install Composer packages (if required): 36 ddev start 37 ddev composer install 38 39 # Import a database backup and open the site in your browser: 40 ddev import-db --file=/path/to/db.sql.gz 41 ddev launch 42 ``` 43 44 ## CakePHP 45 46 You can start a new [CakePHP](https://cakephp.org) project or configure an existing one. 47 48 The CakePHP project type can be used with any CakePHP project >= 3.x, but it has been fully tested with CakePHP 5.x. DDEV automatically creates the `.env` file with the database information, email transport configuration and a random salt. If `.env` file already exists, `.env.ddev` will be created, so you can take any variable and put it into your `.env` file. 49 50 Please note that you will need to change the PHP version to 7.4 to be able to work with CakePHP 3.x. 51 52 === "Composer" 53 54 ```bash 55 mkdir my-cakephp-site && cd my-cakephp-site 56 ddev config --project-type=cakephp --docroot=webroot 57 ddev composer create --prefer-dist cakephp/app:~5.0 58 ddev cake 59 ddev launch 60 ``` 61 62 === "Git Clone" 63 64 ```bash 65 git clone <my-cakephp-repo> my-cakephp-site 66 cd my-cakephp-site 67 ddev config --project-type=cakephp --docroot=webroot 68 ddev start 69 ddev composer install 70 ddev cake 71 ddev launch 72 ``` 73 74 ## Craft CMS 75 76 Start a new [Craft CMS](https://craftcms.com) project or retrofit an existing one. 77 78 !!!tip "Compatibility with Craft CMS 3" 79 The `craftcms` project type is best with Craft CMS 4+, which is more opinionated about some settings. If you are using Craft CMS 3 or earlier, you may want to use the `php` project type and [manage settings yourself](https://github.com/ddev/ddev/issues/4650). 80 81 Environment variables will be automatically added to your `.env` file to simplify the first boot of a project. For _new_ installations, this means the default URL and database connection settings displayed during installation can be used without modification. If _existing_ projects expect environment variables to be named in a particular way, you are welcome to rename them. 82 83 === "New projects" 84 85 ```bash 86 # Create a project directory and move into it: 87 mkdir my-craft-site && cd my-craft-site 88 89 # Set up the DDEV environment: 90 ddev config --project-type=craftcms --docroot=web 91 92 # Boot the project and install the starter project: 93 ddev start 94 ddev composer create craftcms/craft 95 ddev launch 96 ``` 97 98 Third-party starter projects can by used the same way—substitute the package name when running `ddev composer create`. 99 100 === "Existing projects" 101 102 You can start using DDEV with an existing project, too—but make sure you have a database backup handy! 103 104 ```bash 105 # Clone an existing repository (or navigate to a local project directory): 106 git clone https://github.com/example/example-site my-craft-site 107 cd my-craft-site 108 109 # Set up the DDEV environment: 110 ddev config --project-type=craftcms 111 112 # Boot the project and install Composer packages: 113 ddev start 114 ddev composer install 115 116 # Import a database backup and open the site in your browser: 117 ddev import-db --file=/path/to/db.sql.gz 118 ddev launch 119 ``` 120 121 Craft CMS projects use MySQL 8.0, by default. You can override this setting (and the PHP version) during setup with [`config` command flags](./usage/commands.md#config) or after setup via the [configuration files](./configuration/config.md). 122 123 !!!tip "Upgrading or using a generic project type?" 124 If you previously set up DDEV in a Craft project using the generic `php` project type, update the `type:` setting in `.ddev/config.yaml` to `craftcms`, then run [`ddev restart`](../users/usage/commands.md#restart) apply the changes. 125 126 ### Running Craft in a Subdirectory 127 128 In order for `ddev craft` to work when Craft is installed in a subdirectory, you will need to change the location of the `craft` executable by providing the `CRAFT_CMD_ROOT` environment variable to the web container. For example, if the installation lives in `my-craft-site/app`, you would run `ddev config --web-environment-add=CRAFT_CMD_ROOT=./app`. `CRAFT_CMD_ROOT` defaults to `./`, the project root directory. Run `ddev restart` to apply the change. 129 130 Read more about customizing the environment and persisting configuration in [Providing Custom Environment Variables to a Container](./extend/customization-extendibility.md#providing-custom-environment-variables-to-a-container). 131 132 !!!tip "Installing Craft" 133 Read more about installing Craft in the [official documentation](https://craftcms.com/docs). 134 135 ## Django 4 (Experimental) 136 137 ```bash 138 git clone https://github.com/example/my-django-site 139 cd my-django-site 140 ddev config # Follow the prompts 141 # If your settings file is not `settings.py` you must add a DJANGO_SETTINGS_MODULE 142 ddev config --web-environment-add=DJANGO_SETTINGS_MODULE=<myapp.settings.local> 143 ddev start 144 # If your app requires setup, do it here: 145 # ddev python manage.py migrate 146 ddev launch 147 ``` 148 149 * DDEV will install everything in your `requirements.txt` or `pyproject.toml` into a `venv`. This takes a little while on first startup. 150 * DDEV appends a stanza to your settings file which includes the DDEV settings only if running in DDEV context. 151 * You can watch the `pip install` in real time on that first slow startup with `ddev logs -f` in another window. 152 * If your `requirements.txt` includes `psycopg2` it requires build tools, so either set `ddev config --web-extra-packages=build-essential` or change your requirement to `psycopg2-binary`. 153 154 ## Drupal 155 156 For all versions of Drupal 8+ the Composer techniques work. The settings configuration is done differently for each Drupal version, but the project type is "drupal". 157 158 === "Drupal 10" 159 160 ```bash 161 mkdir my-drupal-site && cd my-drupal-site 162 ddev config --project-type=drupal --php-version=8.3 --docroot=web 163 ddev start 164 ddev composer create drupal/recommended-project:^10 165 ddev config --update 166 ddev composer require drush/drush 167 ddev drush site:install --account-name=admin --account-pass=admin -y 168 # use the one-time link (CTRL/CMD + Click) from the command below to edit your admin account details. 169 ddev drush uli 170 ddev launch 171 ``` 172 173 === "Drupal 11 (dev)" 174 175 ```bash 176 mkdir my-drupal-site && cd my-drupal-site 177 ddev config --project-type=drupal --php-version=8.3 --docroot=web 178 ddev start 179 ddev composer create drupal/recommended-project:^11.x-dev 180 ddev config --update 181 ddev restart 182 ddev composer require drush/drush 183 ddev drush site:install --account-name=admin --account-pass=admin -y 184 # use the one-time link (CTRL/CMD + Click) from the command below to edit your admin account details. 185 ddev drush uli 186 ddev launch 187 ``` 188 189 === "Drupal 9 (EOL)" 190 191 ```bash 192 mkdir my-drupal-site && cd my-drupal-site 193 ddev config --project-type=drupal --php-version=8.1 --docroot=web 194 ddev start 195 ddev composer create drupal/recommended-project:^9 196 ddev config --update 197 ddev composer require drush/drush 198 ddev drush site:install --account-name=admin --account-pass=admin -y 199 # use the one-time link (CTRL/CMD + Click) from the command below to edit your admin account details. 200 ddev drush uli 201 ddev launch 202 ``` 203 204 === "Drupal 6/7" 205 206 ```bash 207 git clone https://github.com/example/my-drupal-site 208 cd my-drupal-site 209 ddev config # Follow the prompts to select type and docroot 210 ddev start 211 ddev launch /install.php 212 ``` 213 214 Drupal 7 doesn’t know how to redirect from the front page to `/install.php` if the database is not set up but the settings files *are* set up, so launching with `/install.php` gets you started with an installation. You can also run `drush site-install`, then `ddev exec drush site-install --yes`. 215 216 See [Importing a Database](./usage/managing-projects.md#importing-a-database). 217 218 === "Git Clone" 219 220 ```bash 221 git clone https://github.com/example/my-drupal-site 222 cd my-drupal-site 223 ddev config # Follow the prompts to set Drupal version and docroot 224 ddev composer install # If a composer build 225 ddev launch 226 ``` 227 228 ## ExpressionEngine 229 230 === "ExpressionEngine ZIP File Download" 231 232 ```bash 233 mkdir my-ee-site && cd my-ee-site 234 # Download the zip archive for ExpressionEngine at https://github.com/ExpressionEngine/ExpressionEngine/releases/latest unarchive and move its content into the root of the my-ee-site directory 235 ddev config --database=mysql:8.0 236 ddev start 237 ddev launch /admin.php # Open installation wizard in browser 238 ``` 239 240 When the installation wizard prompts for database settings, enter `db` for the _DB Server Address_, _DB Name_, _DB Username_, and _DB Password_. 241 242 Visit your site. 243 244 === "ExpressionEngine Git Checkout" 245 246 Follow these steps based on the [ExpressionEngine Git Repository README.md](https://github.com/ExpressionEngine/ExpressionEngine#how-to-install): 247 248 ```bash 249 git clone https://github.com/ExpressionEngine/ExpressionEngine my-ee-site # for example 250 cd my-ee-site 251 ddev config # Accept the defaults 252 ddev start 253 ddev composer install 254 touch system/user/config/config.php 255 echo "EE_INSTALL_MODE=TRUE" >.env.php 256 ddev start 257 ddev launch /admin.php # Open installation wizard in browser 258 ``` 259 260 When the installation wizard prompts for database settings, enter `db` for the _DB Server Address_, _DB Name_, _DB Username_, and _DB Password_. 261 262 ## Grav 263 264 === "Composer" 265 266 ```bash 267 mkdir my-grav-site && cd my-grav-site 268 ddev config --omit-containers=db 269 ddev start 270 ddev composer create getgrav/grav 271 ddev exec gpm install admin -y 272 ddev launch 273 ``` 274 275 === "Git Clone" 276 277 ```bash 278 mkdir my-grav-site && cd my-grav-site 279 git clone -b master https://github.com/getgrav/grav.git . 280 ddev config --omit-containers=db 281 ddev start 282 ddev composer install 283 ddev exec grav install 284 ddev exec gpm install admin -y 285 ddev launch 286 ``` 287 288 !!!tip "How to update?" 289 Upgrade Grave core: 290 291 ```bash 292 ddev exec gpm selfupgrade -f 293 ``` 294 295 Update plugins and themes: 296 297 ```bash 298 ddev exec gpm update -f 299 ``` 300 301 Visit the [Grav Documentation](https://learn.getgrav.org/17) for more information about Grav in general and visit [Local Development with DDEV](https://learn.getgrav.org/17/webservers-hosting/local-development-with-ddev) for more details about the usage of Grav with DDEV. 302 303 ## Ibexa DXP 304 305 Install [Ibexa DXP](https://www.ibexa.co) OSS Edition. 306 307 ```bash 308 mkdir my-ibexa-site && cd my-ibexa-site 309 ddev config --project-type=php --docroot=public --web-environment-add DATABASE_URL=mysql://db:db@db:3306/db 310 ddev start 311 ddev composer create ibexa/oss-skeleton 312 ddev exec console ibexa:install 313 ddev exec console ibexa:graphql:generate-schema 314 ddev launch /admin/login 315 ``` 316 317 In the web browser, log into your account using `admin` and `publish`. 318 319 Visit [Ibexa documentation](https://doc.ibexa.co/en/latest/getting_started/install_with_ddev/) for more cases. 320 321 ## Kirby CMS 322 323 Start a new [Kirby CMS](https://getkirby.com) project or use an existing one. 324 325 === "New projects" 326 327 Create a new Kirby CMS project from the official [Starterkit](https://github.com/getkirby/starterkit) using DDEV’s [`composer create` command](../users/usage/commands.md#composer): 328 329 ```bash 330 # Create a new project directory and navigate into it 331 mkdir my-kirby-site && cd my-kirby-site 332 333 # Set up the DDEV environment 334 ddev config --omit-containers=db 335 336 # Spin up the project and install the Kirby Starterkit 337 ddev start 338 ddev composer create getkirby/starterkit 339 340 # Open the site in your browser 341 ddev launch 342 ``` 343 344 === "Existing projects" 345 346 You can start using DDEV with an existing project as well: 347 348 ```bash 349 # Navigate to a existing project directory (or clone/download an existing project): 350 cd my-kirby-site 351 352 # Set up the DDEV environment 353 ddev config --omit-containers=db 354 355 # Spin up the project 356 ddev start 357 358 # Open the site in your browser 359 ddev launch 360 ``` 361 362 !!!tip "Installing Kirby" 363 Read more about developing your Kirby project with DDEV in our [extensive DDEV guide](https://getkirby.com/docs/cookbook/setup/ddev). 364 365 ## Laravel 366 367 Use a new or existing Composer project, or clone a Git repository. 368 369 The Laravel project type can be used for [Lumen](https://lumen.laravel.com/) like it can for Laravel. DDEV automatically updates or creates the `.env` file with the database information. 370 371 === "Composer" 372 373 ```bash 374 mkdir my-laravel-site && cd my-laravel-site 375 ddev config --project-type=laravel --docroot=public 376 ddev composer create --prefer-dist laravel/laravel:^11 377 ddev launch 378 ``` 379 380 === "Git Clone" 381 382 ```bash 383 git clone <my-laravel-repo> my-laravel-site 384 cd my-laravel-site 385 ddev config --project-type=laravel --docroot=public 386 ddev start 387 ddev composer install 388 ddev php artisan key:generate 389 ddev launch 390 ``` 391 392 !!!tip "Want to use a SQLite database for Laravel?" 393 DDEV defaults to using a MariaDB database to better represent a production environment. 394 395 To select the [Laravel 11 defaults](https://laravel.com/docs/11.x/releases#application-defaults) for SQLite, use this command for `ddev config`: 396 ```bash 397 ddev config --project-type=laravel --docroot=public --omit-containers=db --disable-settings-management=true 398 ``` 399 400 ## Magento 401 402 === "Magento 2" 403 404 Normal details of a Composer build for Magento 2 are on the [Magento 2 site](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/composer.html). You must have a public and private key to install from Magento’s repository. When prompted for “username” and “password” in `composer create`, it’s asking for your public key as "username" and private key as "password". 405 406 Note that you can install the Adobe/Magento composer credentials in your global `~/.ddev/homeadditions/.composer/auth.json` and never have to find them again. See [In-Container Home Directory and Shell Configuration](extend/in-container-configuration.md). 407 408 ```bash 409 mkdir my-magento2-site && cd my-magento2-site 410 ddev config --project-type=magento2 --docroot=pub --disable-settings-management \ 411 --upload-dirs=media --web-environment-add=COMPOSER_HOME="/var/www/html/.ddev/homeadditions/.composer" 412 413 ddev get ddev/ddev-elasticsearch 414 ddev start 415 ddev composer create --repository=https://repo.magento.com/ magento/project-community-edition 416 rm -f app/etc/env.php 417 echo "/auth.json" >.ddev/homeadditions/.composer/.gitignore 418 419 # Change the base-url below to your project's URL 420 ddev magento setup:install --base-url="https://my-magento2-site.ddev.site/" \ 421 --cleanup-database --db-host=db --db-name=db --db-user=db --db-password=db \ 422 --elasticsearch-host=elasticsearch --search-engine=elasticsearch7 --elasticsearch-port=9200 \ 423 --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \ 424 --admin-user=admin --admin-password=Password123 --language=en_US 425 426 ddev magento deploy:mode:set developer 427 ddev magento module:disable Magento_TwoFactorAuth Magento_AdminAdobeImsTwoFactorAuth 428 ddev config --disable-settings-management=false 429 ddev php bin/magento info:adminuri 430 # Append the URI returned by the previous command either to ddev launch, like for example ddev launch /admin_XXXXXXX, or just run ddev launch and append the URI to the path in the browser 431 ddev launch 432 ``` 433 434 Change the admin name and related information as needed. 435 436 The admin login URL is specified by `frontName` in `app/etc/env.php`. 437 438 You may want to add the [Magento 2 Sample Data](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/next-steps/sample-data/composer-packages.html) with: 439 440 ``` 441 ddev magento sampledata:deploy 442 ddev magento setup:upgrade 443 ``` 444 445 === "OpenMage/Magento 1" 446 447 1. Download OpenMage from [release page](https://github.com/OpenMage/magento-lts/releases). 448 2. Make a directory for it, for example `mkdir ~/workspace/OpenMage` and change to the new directory `cd ~/workspace/OpenMage`. 449 3. Run [`ddev config`](../users/usage/commands.md#config) and accept the defaults. 450 4. Install sample data. (See below.) 451 5. Run [`ddev start`](../users/usage/commands.md#start). 452 6. Follow the URL to the base site. 453 454 You may want the [Magento 1 Sample Data](https://github.com/Vinai/compressed-magento-sample-data) for experimentation: 455 456 * Download Magento [1.9.2.4 Sample Data](https://github.com/Vinai/compressed-magento-sample-data/raw/master/compressed-magento-sample-data-1.9.2.4.tgz). 457 * Extract the download: 458 `tar -zxf ~/Downloads/compressed-magento-sample-data-1.9.2.4.tgz --strip-components=1` 459 * Import the example database `magento_sample_data_for_1.9.2.4.sql` with `ddev import-db --file=magento_sample_data_for_1.9.2.4.sql` to database **before** running OpenMage install. 460 461 OpenMage is a huge codebase, and we recommend [using Mutagen for performance](install/performance.md#mutagen) on macOS and traditional Windows. 462 463 ## Moodle 464 465 === "Composer" 466 467 ```bash 468 mkdir my-moodle-site && cd my-moodle-site 469 ddev config --composer-root=public --docroot=public --webserver-type=apache-fpm 470 ddev start 471 ddev composer create moodle/moodle 472 ddev exec 'php public/admin/cli/install.php --non-interactive --agree-license --wwwroot=$DDEV_PRIMARY_URL --dbtype=mariadb --dbhost=db --dbname=db --dbuser=db --dbpass=db --fullname="DDEV Moodle Demo" --shortname=Demo --adminpass=password' 473 ddev launch /login 474 ``` 475 476 In the web browser, log into your account using `admin` and `password`. 477 478 Visit the [Moodle Admin Quick Guide](https://docs.moodle.org/400/en/Admin_quick_guide) for more information. 479 480 !!!tip 481 Moodle relies on a periodic cron job—don’t forget to set that up! See [ddev/ddev-cron](https://github.com/ddev/ddev-cron). 482 483 ## Pimcore 484 485 === "Composer" 486 487 Using the [Pimcore skeleton](https://github.com/pimcore/skeleton) repository: 488 489 ``` bash 490 mkdir my-pimcore-site && cd my-pimcore-site 491 ddev config --docroot=public 492 493 ddev start 494 ddev composer create pimcore/skeleton 495 ddev exec pimcore-install --mysql-username=db --mysql-password=db --mysql-host-socket=db --mysql-database=db --admin-password=admin --admin-username=admin --no-interaction 496 echo "web_extra_daemons: 497 - name: consumer 498 command: 'while true; do /var/www/html/bin/console messenger:consume pimcore_core pimcore_maintenance pimcore_scheduled_tasks pimcore_image_optimize pimcore_asset_update --memory-limit=250M --time-limit=3600; done' 499 directory: /var/www/html" >.ddev/config.pimcore.yaml 500 501 ddev start 502 ddev launch /admin 503 ``` 504 505 ## Python/Flask (Experimental) 506 507 ```bash 508 git clone https://github.com/example/my-python-site 509 cd my-python-site 510 ddev config # Follow the prompts 511 # Tell gunicorn where your app is (WSGI_APP) 512 ddev config --web-environment-add=WSGI_APP=<my-app:app> 513 ddev start 514 # If you need to do setup before the site can go live, do it: 515 # ddev exec flask forge 516 ddev launch 517 ``` 518 519 * DDEV will install all everything in your `requirements.txt` or `pyproject.toml` into a `venv`. This takes a little while on first startup. 520 * If your app requires settings, you can add them as environment variables, or otherwise configure your app to use the database, etc. (Database settings are host: `db`, database: `db`, user: `db`, password `db` no matter whether you're using PostgreSQL, MariaDB, or MySQL.) 521 * You can watch `pip install` output in real time on that first slow startup with `ddev logs -f` in another window. 522 * If your `requirements.txt` includes `psycopg2` it requires build tools, so either set `ddev config --web-extra-packages=build-essential` or change your requirement to `psycopg2-binary`. 523 524 ## Shopware 525 526 === "Composer" 527 528 Though you can set up a Shopware 6 environment many ways, we recommend the following technique. DDEV creates a `.env.local` file for you by default; if you already have one DDEV adds necessary information to it. When `ddev composer create` asks if you want to include Docker configuration, answer `x`, as this approach does not use their Docker configuration. 529 530 ```bash 531 mkdir my-shopware-site && cd my-shopware-site 532 ddev config --project-type=shopware6 --docroot=public 533 ddev composer create shopware/production:^v6.5 534 # If it asks `Do you want to include Docker configuration from recipes?` 535 # answer `x`, as we're using DDEV for this rather than its recipes. 536 ddev exec console system:install --basic-setup 537 ddev launch /admin 538 # Default username and password are `admin` and `shopware` 539 ``` 540 541 Log into the admin site (`/admin`) using the web browser. The default credentials are username `admin` and password `shopware`. You can use the web UI to install sample data or accomplish many other tasks. 542 543 For more advanced tasks like adding elasticsearch, building and watching storefront and administration, see [susi.dev](https://susi.dev/ddev-shopware-6). 544 545 ## Silverstripe 546 547 Use a new or existing Composer project, or clone a Git repository. 548 549 === "Composer" 550 551 ```bash 552 mkdir my-silverstripe-site && cd my-silverstripe-site 553 ddev config --project-type=silverstripe --docroot=public 554 ddev start 555 ddev composer create --prefer-dist silverstripe/installer 556 ddev sake dev/build flush=all 557 ddev launch /admin 558 ``` 559 560 === "Git Clone" 561 562 ```bash 563 git clone <my-silverstripe-repo> my-silverstripe-site 564 cd my-silverstripe-site 565 ddev config --project-type=silverstripe --docroot=public 566 ddev start 567 ddev composer install 568 ddev sake dev/build flush=all 569 ``` 570 571 Your Silverstripe project is now ready. 572 The CMS can be found at /admin, log into the default admin account using `admin` and `password`. 573 574 Visit the [Silverstripe documentation](https://userhelp.silverstripe.org/en/5/) for more information. 575 576 `ddev sake` can be used as a shorthand for the Silverstripe Make command `ddev exec vendor/bin/sake` 577 578 To open the CMS directly from CLI, run `ddev launch /admin`. 579 580 ## Statamic 581 582 Use a new or existing Composer project, or clone a Git repository. 583 584 The Laravel project type can be used for [Statamic](https://statamic.com/) like it can for Laravel. DDEV automatically updates or creates the `.env` file with the database information. 585 586 === "Composer" 587 588 ```bash 589 mkdir my-statamic-site && cd my-statamic-site 590 ddev config --project-type=laravel --docroot=public 591 ddev composer create --prefer-dist statamic/statamic 592 ddev php please make:user 593 ddev launch /cp 594 ``` 595 === "Git Clone" 596 597 ```bash 598 git clone <my-statamic-repo> my-statamic-site 599 cd my-statamic-site 600 ddev config --project-type=laravel --docroot=public 601 ddev start 602 ddev composer install 603 ddev exec "php artisan key:generate" 604 ddev launch /cp 605 ``` 606 607 ## Symfony 608 609 There are many ways to install Symfony, here are a few of them based on the [Symfony docs](https://symfony.com/doc/current/setup.html). 610 611 If your project uses a database you'll want to set the [DB connection string](https://symfony.com/doc/current/doctrine.html#configuring-the-database) in the `.env`. If using the default MariaDB configuration, you'll want `DATABASE_URL="mysql://db:db@db:3306/db?serverVersion=10.11"`. If you're using a different database type or version, see `ddev describe` for the type and version. 612 613 === "Composer" 614 615 ```bash 616 mkdir my-symfony-site && cd my-symfony-site 617 ddev config --docroot=public 618 ddev composer create symfony/skeleton 619 ddev composer require webapp 620 # When it asks if you want to include docker configuration, say "no" with "x" 621 ddev launch 622 ``` 623 624 === "Symfony CLI" 625 626 ```bash 627 mkdir my-symfony-site && cd my-symfony-site 628 ddev config --docroot=public 629 ddev start 630 ddev exec symfony check:requirements 631 ddev exec symfony new temp --version="7.0.*" --webapp 632 ddev exec 'rsync -rltgopD temp/ ./ && rm -rf temp' 633 ddev launch 634 ``` 635 636 === "Git Clone" 637 638 ```bash 639 git clone <my-symfony-repo> my-symfony-site 640 cd my-symfony-site 641 ddev config --docroot=public 642 ddev start 643 ddev composer install 644 ddev launch 645 ``` 646 647 ## TYPO3 648 649 === "Composer" 650 651 ```bash 652 mkdir my-typo3-site && cd my-typo3-site 653 ddev config --project-type=typo3 --docroot=public --php-version=8.3 654 ddev start 655 ddev composer create "typo3/cms-base-distribution" 656 ddev exec touch public/FIRST_INSTALL 657 ddev launch 658 ``` 659 660 === "Git Clone" 661 662 ```bash 663 git clone https://github.com/example/example-site my-typo3-site 664 cd my-typo3-site 665 ddev config --project-type=typo3 --docroot=public --php-version=8.3 666 ddev composer install 667 ddev restart 668 ddev exec touch public/FIRST_INSTALL 669 ddev launch 670 ``` 671 672 ## WordPress 673 674 There are several easy ways to use DDEV with WordPress: 675 676 === "WP-CLI" 677 678 DDEV has built-in support for [WP-CLI](https://wp-cli.org/), the command-line interface for WordPress. 679 680 ```bash 681 mkdir my-wp-site && cd my-wp-site 682 683 # Create a new DDEV project inside the newly-created folder 684 # (Primary URL automatically set to `https://<folder>.ddev.site`) 685 ddev config --project-type=wordpress 686 ddev start 687 688 # Download WordPress 689 ddev wp core download 690 691 # Launch in browser to finish installation 692 ddev launch 693 694 # OR use the following installation command 695 # (we need to use single quotes to get the primary site URL from `.ddev/config.yaml` as variable) 696 ddev wp core install --url='$DDEV_PRIMARY_URL' --title='New-WordPress' --admin_user=admin --admin_email=admin@example.com --prompt=admin_password 697 698 # Launch WordPress admin dashboard in your browser 699 ddev launch wp-admin/ 700 ``` 701 702 === "Bedrock" 703 704 [Bedrock](https://roots.io/bedrock/) is a modern, Composer-based installation in WordPress: 705 706 ```bash 707 mkdir my-wp-bedrock-site && cd my-wp-bedrock-site 708 ddev config --project-type=wordpress --docroot=web 709 ddev start 710 ddev composer create roots/bedrock 711 ``` 712 713 Rename the file `.env.example` to `.env` in the project root and make the following adjustments: 714 715 ``` 716 DB_NAME=db 717 DB_USER=db 718 DB_PASSWORD=db 719 DB_HOST=db 720 WP_HOME=${DDEV_PRIMARY_URL} 721 WP_SITEURL=${WP_HOME}/wp 722 WP_ENV=development 723 ``` 724 725 You can then run [`ddev start`](../users/usage/commands.md#start) and [`ddev launch`](../users/usage/commands.md#launch). 726 727 For more details, see [Bedrock installation](https://docs.roots.io/bedrock/master/installation/). 728 729 === "Git Clone" 730 731 To get started using DDEV with an existing WordPress project, clone the project’s repository. 732 733 ```bash 734 git clone https://github.com/example/my-site.git my-wp-site 735 cd my-wp-site 736 ddev config 737 ``` 738 739 You’ll see a message like: 740 741 > An existing user-managed wp-config.php file has been detected! 742 > Project DDEV settings have been written to: 743 > 744 > /Users/rfay/workspace/bedrock/web/wp-config-ddev.php 745 746 Comment out any database connection settings in your `wp-config.php` file and add the following snippet to your `wp-config.php`, near the bottom of the file and before the include of `wp-settings.php`: 747 748 ```php 749 // Include for DDEV-managed settings in wp-config-ddev.php. 750 $ddev_settings = dirname(__FILE__) . '/wp-config-ddev.php'; 751 if (is_readable($ddev_settings) && !defined('DB_USER')) { 752 require_once($ddev_settings); 753 } 754 ``` 755 756 If you don't care about those settings, or config is managed elsewhere (like in a `.env` file), you can eliminate this message by adding a comment to `wp-config.php`: 757 758 ```php 759 // wp-config-ddev.php not needed 760 ``` 761 762 Now run [`ddev start`](../users/usage/commands.md#start) and continue [Importing a Database](./usage/managing-projects.md#importing-a-database) if you need to.