How to create a local install with DDEV

Created on 18 March 2024, 9 months ago
Updated 29 April 2024, 8 months ago

Problem/Motivation

There is documentation on the project page to use with DDEV.

I saw this distribution use lando to install local, but I use DDEV so I try to do it.

Steps to reproduce

I install this ditribution with this steps

1- Creating a folder and go inside with command cd
2- Run the command ddev config and choose drupal10 and the path
3- Run the command ddev composer create localgovdrupal/localgov-project and begin all the installation process.

After this step I get a nginx error but I stop DDEV and begin again with a ddev start command I get the error message

Failed to start localgov: unable to start project localgov because the configured database type does not match the current actual database. Please change your database type back to mariadb:10.4 and start again, export, delete, and then change configuration and start. To get back to existing type use 'ddev config --database=mariadb:10.4' and then you might want to try 'ddev debug migrate-database mariadb:10.3', see docs at https://ddev.readthedocs.io/en/latest/users/extend/database-types/

I tyoe the command ddev config --database=mariadb:10.4 and run again the command: ddev start

And the site begin to work. I end the installation in local adress following the drupal instruction selecting the localgov ditribution.

Now the distribution work locally.

Remaining tasks

I believe more test need to be done to choose a correct path to begin with and I'm not sure if thos ditribution begin with some content or if this is only the configuration, content types etc.

💬 Support request
Status

Active

Version

3.0

Component

Documentation

Created by

🇲🇽Mexico koffer

Live updates comments and jobs are added and updated live.
  • distributions

    Used in Documentation issues for documentation of distributions

Sign in to follow issues

Comments & Activities

  • Issue created by @koffer
  • 🇬🇧United Kingdom aaron.ferris

    I also saw some issues setting ddev up in the flow you've described, I wonder if the issue is with configuring ddev before the project files are pulled down.

    ddev:
    1. mkdir my-localgov-site
    2. cd my-localgov-site
    3. composer create localgovdrupal/localgov-project
    4. cd localgov-project
    5. ddev config
    6. Use defaults
    7. ddev start

    Perhaps ddev could be bundled in with the project alongside Lando?

  • 🇳🇱Netherlands ekes

    DDEV is offered in addition to Lando. The project mentioned `composer create localgovdrupal/localgov-project` includes https://github.com/localgovdrupal/localgov_project/tree/3.x/.ddev

  • 🇬🇧United Kingdom aaron.ferris

    That would explain the issue in the OP, there's a mismatch in the ddev config thats pulled down and the config thats generated by ddev when creating a new project.

    In which case, the flow should just be

    1. mkdir my-localgov-site
    2.cd my-localgov-site
    3.composer create localgovdrupal/localgov-project
    4.cd localgov-project
    5.ddev start

  • 🇲🇽Mexico koffer

    I thought there was no documentation on how to use this distribution with ddev, but I see that the documentation is very complete! I will add a link to the documentation in my issue, but anyway, maybe this issue is not so necessary.

  • 🇩🇰Denmark ressa Copenhagen

    Wouldn't it be better to use the Composer included in DDEV, as seen in the DDEV Drupal Quickstart? (and not require Composer on the host machine)

    Something like this:

    mkdir localgov && cd localgov
    ddev config --project-type=drupal --php-version=8.3 --docroot=web
    ddev start
    ddev composer create localgovdrupal/localgov-project
    ddev drush site:install localgov -y
    

    Install the demo content, and generate a log in link:

    ddev drush in localgov_demo -y
    ddev drush uli
    

    Alternatively, if the .ddev folder and config from the project is needed, you can instead do this:

    git clone https://github.com/localgovdrupal/localgov_project localgov_git
    mkdir localgov
    cd localgov
    cp -r ../localgov_git/.ddev .
    

    PS. I added LocalGov Drupal to the Drupal distributions page: https://www.drupal.org/docs/getting-started/drupal-distributions/localgo...

Production build 0.71.5 2024