DDEV is a Docker-based local development environment that makes it trivial to spin up PHP, Node.js, and Python projects with consistent, reproducible configurations. Instead of fighting version conflicts or managing multiple services manually, DDEV wraps everything in containers that match your production environment — so what works locally, works everywhere.

### Installing DDEV

On macOS, the fastest path is Homebrew:

```bash
brew install ddev/ddev/ddev
```

On Linux or Windows (WSL2), use the official install script:

```bash
curl -fsSL https://ddev.com/install.sh | bash
```

DDEV requires Docker to be running. If you don't have it yet, install [Docker Desktop](https://www.docker.com/products/docker-desktop/) first, then come back.

Verify your installation:

```bash
ddev version
```

You should see the DDEV version alongside Docker and system information.

### Setting Up Your First Project

Navigate to your project directory and run `ddev config` to initialize it:

```bash
cd my-project
ddev config --project-type=php --php-version=8.3
```

DDEV will detect your project type automatically in many cases, but specifying `--project-type` and `--php-version` explicitly is better practice — it makes the configuration explicit and reproducible. For a WordPress site, use `--project-type=wordpress`. For a generic PHP application, `php` works fine.

This creates a `.ddev/` directory in your project with a `config.yaml` file. You can inspect and edit it directly, though the defaults are sensible for most projects.

Start your environment:

```bash
ddev start
```

DDEV pulls the necessary container images, configures a local DNS entry, and installs a trusted SSL certificate. After it completes, your project is available at `https://my-project.ddev.site` — the project name is taken from the directory by default, or from `--project-name` if you specified it.

### Working With Your Environment

Once your project is running, the most useful commands to know:

```bash
ddev stop           # Stop containers without removing them
ddev restart        # Restart all containers
ddev describe       # Show URLs, ports, database credentials
ddev ssh            # Open a shell inside the web container
ddev exec <cmd>     # Run a command inside the container without a full shell
ddev share          # Expose your local site publicly via ngrok (useful for client demos)
```

Running Composer or npm inside the container ensures you use the exact PHP or Node version configured for your project:

```bash
ddev exec composer install
ddev exec npm install
ddev exec npm run build
```

For database work, `ddev describe` shows your connection credentials, and `ddev mysql` drops you straight into a MySQL shell. You can also import a database dump with `ddev import-db --file=dump.sql.gz`.

### Common Workflows

**Running database migrations:**
```bash
ddev exec php artisan migrate        # Laravel
ddev exec wp db migrate              # WP-CLI
```

**Viewing logs:**
```bash
ddev logs                # Combined logs from all containers
ddev logs -f             # Follow/tail mode
```

**Removing a project:**
```bash
ddev delete --omit-snapshot          # Removes containers and cleans up
```

Full documentation and configuration reference lives at [ddev.readthedocs.io](https://ddev.readthedocs.io/). The project source is on [GitHub](https://github.com/ddev/ddev) and is actively maintained.

---

### Deploying DDEV Projects with DeployHQ

DDEV handles the local development side of the equation — but once your code is ready, you need a reliable way to get it to production. That's where [DeployHQ](https://www.deployhq.com) comes in.

The workflow is straightforward: develop locally with DDEV, push your code to Git (GitHub, GitLab, Bitbucket, or any self-hosted Git server), and DeployHQ handles deploying it to your production or staging server automatically.

**Getting started with DeployHQ:**

1. Create a project in DeployHQ and connect your Git repository
2. Add your server — DeployHQ supports SFTP, SSH, and cloud providers
3. Configure your build commands to match your stack

For a PHP project using Composer, your build commands might look like:

```
composer install --no-dev --optimize-autoloader
php artisan config:cache
php artisan migrate --force
```

For a Node.js project:

```
npm ci
npm run build
```

4. Set up a webhook in your Git provider so DeployHQ automatically deploys whenever you push to your main branch

Because DDEV enforces consistent PHP and Node versions in your local environment, your build commands will work the same way locally as they do in DeployHQ's deployment pipeline — no surprises when you go live.

DeployHQ also supports environment variables, deployment notifications, and rollback to any previous deployment if something goes wrong. For teams, it handles multiple developers pushing to the same repository without stepping on each other's deployments.

---

Ready to streamline your deployments? [Sign up for DeployHQ](https://www.deployhq.com/signup) to connect your Git repositories and automate your deployment pipeline. Questions? Reach us at [support@deployhq.com](mailto:support@deployhq.com) or on Twitter at [@deployhq](https://x.com/deployhq).
