A copy-paste reference of the DDEV commands you need day to day. Jump straight to a task:
- Webhaven commands
- Start, stop and restart DDEV
- Delete or remove a DDEV project
- Export and import a DDEV database
- Drush commands
- Composer commands
- Disable the DDEV usage statistics prompt
Webhaven commands
Custom DDEV commands that ship with every Webhaven project.
Install a Webhaven project
ddev installStarts the environment, installs dependencies, unpacks recipes, configures config sync, and opens the site in your browser. Safe to re-run at any time. See the Installation guide for the full walkthrough.
Create a custom theme
ddev create-theme theme_machine_nameGenerates a custom theme based on the Webhaven starterkit and sets it as the default theme. See Create a custom theme for building, watching and linting your new theme.
Enable development mode
ddev dev-modeDisables Drupal caching and CSS/JS aggregation, and enables Twig debug.
Disable development mode
ddev dev-mode disableRestores default caching, aggregation, and Twig settings.
Start, stop and restart DDEV
Start a project
ddev startRestart a project
ddev restartOpen the project in your browser
ddev launchStop a project
ddev stopStops the project's containers without removing the project or its data.
Stop all running DDEV projects
ddev poweroffStops every running project at once, including the shared SSH agent and network.
SSH into the web container
ddev sshView container logs
ddev logsShow project information
ddev describeDelete or remove a DDEV project
None of these commands touch your codebase. Deleting a project removes its containers and database, your files stay where they are.
Delete a project (keeps a database snapshot)
ddev deleteDelete a project without a snapshot
ddev delete --omit-snapshotAdd --yes (or use the shorthand ddev delete -Oy) to skip the confirmation prompt, handy in scripts:
ddev delete --omit-snapshot --yesRemove a project from the project list
ddev stop --unlistHides the project from ddev list without deleting anything. It reappears the next time you start it.
Export and import a DDEV database
Export a database
ddev export-db --file=path/to/db.sql.gzYou can also pipe the dump to a file directly:
ddev export-db > db.sql.gzImport a database
ddev import-db --file=path/to/db.sql.gzOlder guides use --src; that flag was renamed to --file.
Drop or reset the database
ddev drush sql:drop -yEmpties all tables so you can import a fresh dump. To remove the database entirely, delete the project with ddev delete --omit-snapshot.
Snapshot and restore a database
ddev snapshotRestore the most recent snapshot with:
ddev snapshot restore --latestOpen the database CLI
ddev mysqlOpen the database in a GUI
ddev sequelaceOpens the project database in Sequel Ace on macOS. Similar commands exist for other clients, such as ddev tableplus.
Drush commands
Clear the Drupal cache
ddev drush crLog in without a password
ddev drush uliGenerates a one-time login link for the admin account.
Import configuration
ddev drush cimExport configuration
ddev drush cexRun database updates
ddev drush updbEnable a module
ddev drush en module_nameUninstall a module
ddev drush pmu module_nameRun cron manually
ddev drush cronRun a full deployment
ddev drush deployRuns database updates, imports configuration and rebuilds caches in the right order. See the Drush documentation for details.
Composer commands
Install all dependencies
ddev composer installUpdate all dependencies
ddev composer updateAdd a new package
ddev composer require drupal/packageRemove a package
ddev composer remove drupal/packageDisable the DDEV usage statistics prompt
DDEV asks once whether it may collect anonymous usage data. Opt out permanently with:
ddev config global --instrumentation-opt-in=falseIn CI pipelines or scripts, use environment variables instead: DDEV_NO_INSTRUMENTATION=true disables usage reporting and DDEV_NONINTERACTIVE=true skips all interactive prompts:
DDEV_NONINTERACTIVE=true DDEV_NO_INSTRUMENTATION=true ddev startSupport DDEV
If you enjoy using DDEV, please consider showing your support for the project.