Ready to get started? Follow this guide to create local PHP web development environments quickly with DDEV.
Step 1. Install DDEV-Local
First, install or update the requirements, such as Docker and Docker Compose.
Next, follow the instructions to install DDEV-Local for your operating system.
For macOS/Linux users, we recommend downloading, installing, and upgrading via Homebrew/Linuxbrew.
brew tap drud/ddev && brew install ddev
For Windows users, we recommend downloading, installing, and upgrading via Chocolatey.
choco install ddev
To see which ddev commands are available, check the manual pages:
Tip: If you’re already running a webserver on port 80, follow troubleshooting steps to resolve port conflicts.
Step 2. First-time project setup
Check out the existing site repository to a local directory. This is the project directory.
Set up a project for the first time with
ddev config. You only need to do this once per project. To set up a new project, answer three questions:
- What’s site name?
- What’s the location of the docroot?
- What type of project is it? Such as Drupal, PHP, WordPress, etc.
Follow the configuration examples for the CMS you’re working within the Quickstart Guides in the documentation.
Depending on the CMS, and whether the project is a brand new site or an existing one, DDEV-Local attempts to make the CMS-specific settings files.
If you’re working with an existing project follow the steps to import the database. Then, run
ddev describe to get the database credentials for the project.
This was a one-time configuration, and configuration files were created for the project. Take a look at the project’s .ddev/ddev.yaml file.
Step 3. Use DDEV-Local everyday
To see a list of the current DDEV projects type
ddev list. The terminal will display what projects are configured, their status, and a link to access each project.
Start your project
Each time you want to work on a project run
ddev start from the project directory. Or, to start any project, from anywhere, run:
ddev start projectname
It’s the same with other DDEV CLI commands. Run them directly from within the project (docroot), or specify the project name from anywhere.
Done working? Remove the container.
When you’re done with your tasks, remove the project while maintaining the database and keeping the state of the project intact without using up resources:
ddev stop is not destructive (it maintains the database) it makes starting up next time much easier. So that means, to start this project type
ddev start projectname, or cd into the project directory and type
If you do need to wipe out the database, add a flag to remove the database with
ddev stop --remove-data
Step 4. Stay up-to-date
From this point on, when you need to update DDEV-Local follow the instructions under the installation guide. For macOS users using Homebrew, type:
brew upgrade ddev
For Windows users using Chocolatey, type:
choco upgrade ddev
When you start up DDEV, we’ll notify you about new releases, but please do sign up to our mailing list for release news.
Join the DDEV Community
DDEV is an open source project, with a growing community.
We support DDEV-Local on Stack Overflow too, just search for DDEV (or questions tagged ddev) there.
Come talk to us on the #ddev channel in the Drupal Slack team.
Find a bug? Have a feature proposal? Visit the issue queue on GitHub.