LocalGovDrupal distribution

Installs: 20 995

Dependents: 2

Suggesters: 0

Security: 0

Stars: 62

Watchers: 13

Forks: 19

Open Issues: 89


2.3.13 2023-01-30 14:54 UTC


Drupal distribution and install profile to help UK councils collaborate and share Drupal code for publishing website content.

This project is the Drupal installation profile that is best installed using composer to require a project template, localgov_project, to scaffold and build the codebase which includes this profile.

Supported branches

We are actively supporting and developing the 2.x branch for Drupal 9.

The 1.x branch is no longer actively supported and not recommended for new sites.

If you are still using the 1.x branch on your site, please create an issue on Github to let us know.


Further documentation for developers, content designers and other audiences can be found at https://docs.localgovdrupal.org/.

Requirements for installing LocalGov Drupal locally for testing and development

To install LocalGov Drupal locally you will need an appropriate versions of:

Many of us use the Lando file included to run a local docker environmnent for testing and development, but some people prefer to run the web servers natively on their host machine.

PHP requirements

We folllow Drupal's PHP recomendations: https://www.drupal.org/docs/system-requirements/php-requirements#versions

We currently recomend PHP 8.1 or 8.0 but also aim to support PHP 7.4.

You will also need to have certain PHP extensions enabled (see https://www.drupal.org/docs/system-requirements/php-requirements#extensions) including:

  • PHP mbstring
  • PHP cURL
  • GD library
  • XML

If you see errors when running composer require, double check your PHP extensions.

Composer and Lando

To install locally, you will need Composer and we recommend using Lando for a consistent developer environment.

Please also see the Lando requirements section for details of Docker requirements for different operating systems.


Installing LocalGov Drupal locally with composer

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

Change MY_PROJECT to whatever you'd like your project directory to be called.

composer create-project localgovdrupal/localgov-project MY_PROJECT --no-install 

Change directory into the MY_PROJECT directory and run lando start.

lando start

Once lando has finished building, use lando to run composer install and the site installer.

lando composer install
lando drush si localgov -y

Note: As you might be running a different version of PHP on your host machine from the version that Lando runs, it is advisable to run composer install from within Lando. This ensures dependencies reflect the PHP version that the webserver is actually running.

Composer notes

If developing locally and you want to force composer to clone again from source rather than use composer cache, you can add the --no-cache flag.

lando composer create-project localgovdrupal/localgov-project MY_PROJECT --stability dev --no-cache  --no-install 

If you just want to pull in the latest changes to LocalGov Drupal run composer update with the --no-cache flag.

lando composer update --no-cache

If you want to be sure you are getting the latest commits when developing, clearing composer cache, deleting the folders and re-running composer update seems to be a solid approach:

rm -rf web/profiles/contrib/ web/modules/contrib/ web/themes/contrib/;
composer clear-cache; composer update --with-dependencies --no-cache;
lando start;
lando drush si localgov -y;

If you run into memory limit errors when running Composer commands, prefix the commands with COMPOSER_MEMORY_LIMIT=-1. For example, to install the project run:

COMPOSER_MEMORY_LIMIT=-1 composer create-project localgovdrupal/localgov-project MY_PROJECT


See CONTRIBUTING.md for current contribution guidelines.

Issue tracking

In the early development stages, most issues will be tracked in this repository https://github.com/localgovdrupal/localgov/issues.

Development issues relating to specific projects or module should be tracked in the project repository. In the future we might set up a separate repository for centralised issue tracking of bug reports for end users.

Development setup

The main development environment in use is currently Lando – a Docker based development environment that works on Linux, MacOS and Windows.

@todo Document Lando setup.

Coding standards

PHP CodeSniffer is installed as a dev dependency by Composer and configured to use Drupal coding standards and best practices. It is a good idea to run these before committing any code. All code in pull requests should pass all CodeSniffer tests.

To check code using Lando run:

lando phpcs

To attempt to automatically fix coding errors in Lando run:

lando phix

Coding standards resources

Running tests

The included phpunit.xml.dist file contains configuration for automatically running the LocalGov Drupal test suite.

To run all LocalGov Drupal tests with Lando use:

lando phpunit

To run all the tests for a specific module use:

lando phpunit web/modules/contrib/localgov_my_module

Tests can be filtered using the --filter option. To only run a specific test use:

lando phpunit --filter=myTestName

Testing resources

Security policy

It is important to have a way to report security issues safely and securely. Luckily this is something Drupal has done very well for many years, via the security team. We publish our distributions on drupal.org and opt in to the security advisory policy..

See https://www.drupal.org/drupal-security-team/general-information

How to report a security issue

If you discover or learn about a potential error, weakness, or threat that can compromise the security of Drupal, LocalGov Drupal or LocalGov Drupal Microsites, we ask you to keep it confidential and submit your concern to the Drupal security team.


This project is currently maintained by: