Getting a minimal Drupal install up for training or development

In preparation for Agaric’s migration training at DrupalCon Seattle, we’ve seen again that getting a development environment suitable for working on Drupal with Composer is a big road block. For that reason, here are instructions for getting it all going, suitable for our training or for working on Drupal in a code sprint, with only one hard requirement: PHP. Three beach shovels standing up in the sand next to a pail.

Getting a local development going is a problem for everyone, including programmers and people who should be skilled at this. Vagrant and DrupalVM were created to make identical development environments work on any computer. Unfortunately, that’s more a pipe dream than a promise, as our own experiences and support requests we’ve received can attest,

Docker is another attempt to make local development match production environments, and a newer generation of Drupal-adjacent development workflow tools, such as DDEV, Lando, Docksal, and Humpback, build on it. Using an online development environment is also an option, but has too much reliance on working WiFi for conference situations.

The goal is any Drupal development environment—any of the above or anything else—where you can go to your project root directory in a terminal and type, say, composer update and have If you don’t have a local development environment of any kind, here is the minimalist approach. All the steps start with opening your terminal.

mkdir ~/sandbox
cd ~/sandbox
php composer.phar create-project drupal-composer/drupal-project:8.x-dev just-drupal --no-interaction
cd just-drupal
php ../composer.phar require drush/drush

… if that works, you’re good to go!

To see the site, use:

php web/core/scripts/drupal quick-start standard

If it works, it will install Drupal with the Standard installation profile and log you in, opening your local site in your browser. Your terminal window, meanwhile, is dedicated to running the server. Open a new tab in your terminal to be able to run more composer or other commands.

In the migration training for instance we have people use composer to get the code for the address module, so from ~/sandbox/just-drupal in our example we would run:

php ../composer.phar require drupal/address

This minimalist approach might not work either! If it doesn’t, there may be more PHP things to install. For instance, if you run into an error about SQLite, you may need to enable or install SQLite with PHP first.

Questions

Why can’t we at least use php composer.phar without changing directory?

Because the composer project refused, way back in 2014, over the please of many, to allow composer create project to create a project in the current directory, even if there’s nothing in there but a composer.phar file.

Note: If you have composer installed globally you can use composer instead of ../composer.phar.

php web/core/scripts/drupal quick-start

php -S localhost:8008

If all else fails, yes, doing this training with an online install is possible, as long as

This is ben, one of the trainers who will be assisting Mauricio. I just wanted to say that getting a local development going is a problem for everyone, including programmers and people who should be skilled at this. That’s why Vagrant and DrupalVM were created, to make identical development environments work on any computer, but as you’ve experienced that’s more a pipe dream than a promise.

If you use any of the local development environments that integrate with Pantheon those should also work fine (such as Lando or Drud, more modern than DrupalVM but requiring Docker). As Mauricio noted, doing this training all on an online Drupal install such as Pantheon offers will also work, so long as the wifi works.

If you don’t have a local development environment of any kind, here is the minimalist approach. All the steps start with opening Terminal. E-mail can cut off longer lines meant to be copy and pasted, so i’ve also posted these instructions on our site: https://agaric.coop/blog/just-enough-local-drupal-development-environment

PHP (5.5.9+, 7.1+ preferred; test in a terminal with php –version). Install composer in that folder by copying the four lines that begin with php at the top of https://getcomposer.org/download/ php composer.phar create-project drupal-composer/drupal-project:8.x-dev . –no-interaction cd web php composer.phar require drush/drush php composer.phar require drupal/address

… if that works, you’re good to go! (We’ll add some more modules as part of the training.)

To see the site, use:

php web/core/scripts/drupal quick-start standard

This might not work either! If it doesn’t, there may be more PHP things to install. We’ll help tomorrow, it’s quite late today anyway, sorry about that.

best,

ben

I downloaded Drupal 8.6.3 and MAMP. I found a completely separate YouTube Video but MAMP won’t start up the localhost even after I moved the drupal files into the MAMP folder and renamed them htdocs. I’ll try to get there early on Monday. I realize for people who are skilled with this that this seems absurd, and I have been able to intall drupal locally in the past, just not with the tools you are suggesting nor for some reason MAMP.

We use Pantheon at ___. It’s such a piece of cake to spin up a drupal install.

Thanks for replying. I’ll try to get to the training early on Monday and see if someone can help me.

Best,


Do you by any chance have a local Drupal installation via any method? Most tools will require to interact with a command line and/or git. There are some that try to abstract that from you, but it you also a bit of control of what you can do. Two options are Acquia Dev Desktop https://dev.acquia.com/downloads https://urldefense.proofpoint.com/v2/url?u=https-3A__dev.acquia.com_downloads&d=DwMFaQ&c=l45AxH-kUV29SRQusp9vYR0n1GycN4_2jInuKy6zbqQ&r=LmaBLpjwePkJ-QcU4YNz6TgC9m4aLjjIl9zC3iD6JwQ&m=Am9_RGPl_Hz9SvBgw9Eo_gDPKlVDpOkvhwbssW-wQRg&s=0T93ni2QH4SE9NzWGUot_ufO4f_lo9BC0jd2j74Q7e8&e= and BitNami Drupal https://bitnami.com/stack/drupal https://urldefense.proofpoint.com/v2/url?u=https-3A__bitnami.com_stack_drupal&d=DwMFaQ&c=l45AxH-kUV29SRQusp9vYR0n1GycN4_2jInuKy6zbqQ&r=LmaBLpjwePkJ-QcU4YNz6TgC9m4aLjjIl9zC3iD6JwQ&m=Am9_RGPl_Hz9SvBgw9Eo_gDPKlVDpOkvhwbssW-wQRg&s=km-__zo71ODBzsubee6jtggGUF3ad944fOv4mTaMJh8&e= I have not used any of them in the context of the training. Other than getting Drupal installed I don’t know how helpful they will be.

It is possible to follow the training using an online version of Drupal, like the one provided by Pantheon. You can create an account at https://dashboard.pantheon.io/register https://urldefense.proofpoint.com/v2/url?u=https-3A__dashboard.pantheon.io_register&d=DwMFaQ&c=l45AxH-kUV29SRQusp9vYR0n1GycN4_2jInuKy6zbqQ&r=LmaBLpjwePkJ-QcU4YNz6TgC9m4aLjjIl9zC3iD6JwQ&m=Am9_RGPl_Hz9SvBgw9Eo_gDPKlVDpOkvhwbssW-wQRg&s=ezdjBeNDasejOkF_03HemXimRVXhf2F0SZNlnH10ums&e= and get two Drupal testing sites for free. That will require an Internet connection to work though. That’s why it is advised to have a local installation.

If you can’t get a local installation in advance, we can offer help on site. I would not worry too much. We can get up and running fairly quick. Just make sure to arrive early.

Respectfully, Mauricio Dinarte

Hi Mauricio

This link you sent makes no sense to me, I'm sorry. There is no audio on
the video and it takes me to a Git page that I don't know what to do
with. Sorry, is there something more explicit for people who are not
programmers?


Could you please provide more context? Which operating systems are you
using? What versions of Vagrant and VirtualBox are you trying to install?

Drupal VM is recommended as it provides all that is needed for the
training, but it is not a hard requirement. If you already have a local
drupal installation, via MAMP/LAMP/XAMP or any other method, that would
suffice for the training. What you need is a local installation, being
able to install modules via composer, and have Drush available. The
shortest way to get everything going is using Drupal core's own
quick-start installation script. You can read a blog post about getting
it set up at
https://www.mediacurrent.com/blog/ready-set-spin-how-get-drupal-86-running-locally-5-steps/

If everything else fails, we can offer on site support the day of the
training. Just arrive early to get you set up.



    Sorry, the VM Box is also failing. ____


    I wanted to let you know that I have been trying to install Vagrant
    since yesterday. I have deleted and redownloaded the dmg,
    uninstalled and attempted to install a couple of times.____

     ____

    Please advise.____

     ____

    Thanks,____
    The Vagrant install fails with a message of: ____

    The Installer Failed:____

    The installer encountered an error that caused the installation to
    fail. Contact the software manufacturer for assistance.____

     ____

    Please advise.____

     ____

    Thank you.____