Skip to content

WordPress

INFO

🚧   This chapter is work in progress (WIP) . Happy to hear your feedback / ideas!

Quick install

Installing WordPress with DDEV is super simple. DDEV has already built-in support for the WordPress Command Line Tools (WP-CLI).

If you create a DDEV project with ddev config --project-type=wordpress, a wp-config.php is created which already contains the correct database connection settings (db, db, db) for DDEV.

Therefore it is really easy to install a fresh WordPress with just a few commands:

Embedded Video

By loading this video, you accept the privacy policy and terms of YouTube/Google.

The commands shown in this video:

mkdir my-wp-site
cd my-wp-site/

# create a new DDEV project inside the newly created folder
# (the primary URL is automatically set to https://<folder>.ddev.site)
ddev config --project-type=wordpress
ddev start

# download latest WordPress (via WP-CLI)
ddev wp core download

# finish the installtion in your browser:
ddev launch

Source: Quick start docs for DDEV + WordPress

Vite integration

See latest demo repository https://github.com/mandrasch/ddev-wp-vite-demo and more information on this docs page: DDEV + Vite.

ACF Blocks + Svelte + Vite 🧡

https://github.com/mandrasch/ddev-wp-acf-blocks-svelte

Pulling WordPress (ddev pull)

DDEV offers an incredible feature called Hosting Provider Integration. This enables writing little scripts which can pull databases and files from remote servers to your local development project.

I wrote an example online tool to help you get started with the basic configuration:

Here is an example video for SSH pull:

Embedded Video

By loading this video, you accept the privacy policy and terms of YouTube/Google.

Pull via SSH

More information, maybe slightly outdated:

Pull via SSH into Gitpod

TODO: Add this method / how to use SSH keys there?

Pull via BackWPup

Don't want to fiddle around with SSH? You can just use the free BackWpUp plugin to create a .zip backup and import it into a DDEV WordPress project.

TODO: Add screencast

More resources, maybe slightly outdated:

Pull via BackWPup into GitPod

You can even use DDEV in your browser (via Gitpod cloud), if you don't have a local development environment currently setup. This could be also a good way to let designers participate in PHP projects in future:

TODO: Add screencast TODO: Add more information

Roots Sage (+ Roots Bedrock) (old experiment)

Roots offers "Advanced WordPress Development Tools". I decided to test them with DDEV:

Current open question regarding HMR and internal links

Timber (old experiment)

Timber "helps you create fully-customized WordPress themes faster with more sustainable code. With Timber, you write your HTML using the Twig Template Engine separate from your PHP files.".

I created some example repositories, v2 is currently in beta and my demo is not fully functional yet:

Connect with community 🤗

There is a dedicated #WordPress-Channel on DDEV discord!