Introduction
Here at TC we have been learning about LocalGov Drupal (LGD), a Drupal distribution aimed at local councils. It comes with a whole range of interesting features, content types, page components, and more.
In this article we'll cover how to install LGD locally using DDEV, a cross platform tool to manage local docker-base development environments.
This article assumes you are already familiar with DDEV and assumes you have DDEV and Docker installed on your local machine.
Prepare your LGD project
Start by creating a new LocalGov Drupal project.
From inside your project folder run the following, replacing LGD with the name of your project:
composer create-project localgovdrupal/localgov-project LGD --no-install
This command sets up a directory structure structure all the needed packages to create a LocalGov Drupal project.
Configure the DDEV environment
Change into the project folder and run:
ddev config
Provide the project name, the docroot location ("web"), and the project type ("Drupal 10")
Fetch the source code
Start your DDEV environment:
ddev start
Install the source code:
ddev composer install
Perform the LGD Drupal installation
ddev drush si localgov -y
Alternatively, you can set the administrator username and password at the same time:
ddev drush si localgov --account-name=admin --account-pass=admin -y
Note: Be sure to change your username and password into something more secure than admin/admin before you make your site public.
Browse to your new site
Launch the site in your browser:
ddev launch
Once you are logged in, you will be taken to the content dashboard where you can add one of the 3 default content types:
- Service landing page
- Service page
- Service Sub-landing Page
At this point your LGD distribution is fully installed and ready for you to start building your own LGD site.
Next steps
Select and install one of the many modules that come with LocalGov Drupal. If you aren’t sure which modules you might want to try first, go ahead and install the LocalGov Demo Content module to get a fully featured LGD site to explore.
Once you have the demo installed, your site should look something like this:
Looking for a quick way to get started with LocalGov Drupal?
We offer both live training and on-demand remote training on Drupal and LocalGov Drupal.
We've supported Hammersmith & Fulham, Audit Wales, and the Shared Resource Service Wales on their learning journey, and would love to work with your teams too.
→ contact us at [email protected].