Skip to content

Local development setup with DDEV

For coders, we'll want a local development setup.

Using DDEV for local development

DDEV is the most popular tool for local development.

We recommend using DDEV for local development.

You might prefer Lando - skip to the Lando instructions on the next page if so.

Before you start, you'll need Composer, Docker Desktop and DDEV installed. The getting started guide covers installing these.

Code editors

Lots of people use VS Code. Open source IDE for code editing. https://code.visualstudio.com/

Some people like PHPStorm https://www.jetbrains.com/phpstorm/ (not free / not open source)

Install LocalGov Drupal locally

To install LocalGov Drupal locally for testing or development, use the Composer-based project template.

If desired, change MY_PROJECT to whatever you'd like your project directory to be called.

composer create-project --no-install drupal/localgov_project:^4.0 MY_PROJECT

Change directory into the MY_PROJECT directory and run ddev start.

cd MY_PROJECT
ddev start

DDEV will start local containers to run the web server and database for your local Drupal site.

Once started, we can use composer to download the rest of the code.

ddev composer install
With the code in place, we can now run the install.
ddev drush si localgov -y

If you run into memory limit errors when running Composer commands, prefix the commands with COMPOSER_MEMORY_LIMIT=-1. The create-project step runs on your host machine before any containers exist, so this is not prefixed with ddev:

COMPOSER_MEMORY_LIMIT=-1 composer create-project --no-install drupal/localgov_project:^4.0 MY_PROJECT

For Composer commands run after the project is started, prefix inside DDEV instead:

ddev composer install