Step 1: configure and start the project
Run these commands from the project directory. Choose the document root and PHP version supported by the application; placeholders are intentionally not real values.
Configure a PHP project
Creates or updates DDEV configuration for a conventional PHP application whose public entry point is in public/.
ddev config --project-type=php --docroot=public --php-version=<supported-php-version>
Configure a Magento project
Selects DDEV’s Magento project type and Magento’s pub/ web root.
ddev config --project-type=magento2 --docroot=pub --php-version=<supported-php-version>
Start the environment
Builds and starts the project containers, then reports the local project URLs.
ddev start
Inspect the environment
Shows project URLs, services, ports, database details, and current status without changing the environment.
ddev describe
Step 2: control and diagnose the environment
These lifecycle commands cover the daily loop. Use poweroff when you want to stop every DDEV project, not just the current one.
Restart after configuration changes
Stops and starts the current project so configuration changes take effect.
ddev restart
Follow application logs
Streams logs from the web container until you stop the command.
ddev logs -f
Open a container shell
Starts an interactive shell inside the web container with the project directory mounted.
ddev ssh
Run one container command
Executes one command in the web container without opening an interactive shell.
ddev exec <command>
Stop one or all projects
The first command stops the current project. The second stops every running DDEV project and supporting container.
ddev stop
ddev poweroff
Step 3: back up, inspect, and restore the database
Treat imports and project deletion as destructive operations. Create an export or snapshot first and verify that you are in the intended project.
Create a portable database export
Writes the current project database to a compressed file that can be archived or imported elsewhere.
ddev export-db --file=backup.sql.gz
Create a quick local snapshot
Stores a named database snapshot managed by DDEV for quick local recovery.
ddev snapshot --name=before-change
Import a database
Replaces the project database with the selected dump.
ddev import-db --file=backup.sql.gz
Open the database client
Connects to the project database using DDEV-managed local credentials.
ddev mysql
Step 4: run Composer and Magento commands
DDEV wrappers use the project’s container versions, so the host does not need a matching PHP or Composer installation.
Install locked dependencies
Installs the exact dependency versions recorded in composer.lock.
ddev composer install
Review a package change
The first command previews dependency resolution; the second applies it after review.
ddev composer require <vendor/package> --dry-run
ddev composer require <vendor/package>
Check Magento status
Reports deployment mode, cache types, and indexer state without changing data.
ddev magento deploy:mode:show
ddev magento cache:status
ddev magento indexer:status
Apply Magento database updates
Applies module schema and data changes, then removes application cache entries.
ddev magento setup:upgrade
ddev magento cache:clean
Step 5: remove a local project safely
Stopping is reversible; deleting a project’s managed data is not. Keep the backup outside the project directory if the directory may also be removed.
Back up and stop
Creates a last portable database dump and stops the current project.
ddev export-db --file=final-backup.sql.gz
ddev stop
Delete the DDEV project
Starts DDEV’s project deletion flow and asks for confirmation.
ddev delete