A local development environment is a complete copy of a site — web server, database, PHP — running on your own computer, where breaking things costs nothing and teaches plenty. DDEV is the tool we use for this on every project: it wraps Docker so you never have to learn Docker, and it speaks Drupal, WordPress, and plain PHP out of the box. You’ll need a computer with 8 GB of RAM or more and a copy of a site’s code (even a fresh empty project works for this lesson).
Install a Docker runtime
DDEV runs its servers inside Docker containers, so a Docker provider goes on first. On macOS, install OrbStack — it’s what DDEV’s own docs recommend, fast and low-fuss (Docker Desktop and Colima work too). On Windows, use WSL2 with Docker installed inside it. On Linux, install Docker Engine from your distribution. Open the provider once so it’s running before the next step.
Install DDEV
macOS or Linux with Homebrew:
brew install ddev/ddev/ddev
Or the official install script on Linux/WSL2:
curl -fsSL https://ddev.com/install.sh | bash
Then confirm it landed:
ddev --version
If it offers to run mkcert -install, say yes — that’s what makes your
local sites load over https without browser warnings.
Configure your first project
From the folder that holds the site’s code:
cd ~/Sites/my-site
ddev config
DDEV inspects the folder, guesses the project type (Drupal, WordPress,
generic PHP), and asks you to confirm. Accepting the defaults is almost
always right. The result is a .ddev/ folder — configuration, not
magic, and safe to commit once the site is
under version control.
Start it and open the site
ddev start
ddev launch
First start pulls the container images, so give it a few minutes; every
start after that takes seconds. ddev launch opens the site in your
browser at an address like https://my-site.ddev.site. A fresh project
will want an install or a database import — ddev import-db --file=backup.sql.gz handles the latter, and the
copy-a-live-drupal-site-to-ddev
lesson walks the full pull.
Learn the daily commands
Six cover almost every day you’ll spend in it:
ddev start # bring the project up
ddev stop # put it away
ddev describe # URLs, database creds, status
ddev ssh # a shell inside the web container
ddev composer install # run composer inside the project
ddev poweroff # stop everything DDEV is running
The habit that matters: run site tools through ddev — ddev composer,
ddev drush, ddev wp — so they use the project’s PHP and database
instead of whatever your laptop happens to have. (If Composer itself is
new to you, here’s what it actually does.)
Verify with a throwaway experiment
The point of local is that mistakes are free, so verify by making one. Open a template or theme file in the project, type something obviously wrong into it, save, and reload the browser — you should see your mistake staring back, which proves this copy is really yours. Now undo the edit and reload again: clean. The live site never noticed, because there’s no wire between them. That’s the whole gift of a local environment — your own private lake, and every capsize is just a swim.