Skip to main content

Vagrant, PHING, core development and automation

At PreviousNext we rely heavily on vagrant for development environments and phing for performing automated tasks to speed up site building and project development. These tools are hugely beneficial in the long run. In this blog we'll have a look at how we as drupal core developers can automate the tedious tasks like site install/ re-install, testing, coding standards validation and enable modules.

by jibran.ijaz /

nick_schuch has created a repo "Vagrant Drupal 8 on github.

To install and use this is very simple. You can either go through the or read further.

Install vagrant (1.3 to 1.5) and Virtualbox (4.3.6). After installing vagrant install vagrant plugins: (all latest version of these will work just fine.)

  • auto-network
  • hostsupdater
  • vbguest

vagrant plugin install vagrant-auto_network vagrant plugin install vagrant- hostsupdater vagrant plugin install vagrant- vbguest

Next step:

git clone cd vd8 vagrant up

Or open vd8 directory in phpstorm as a project.


Go to Tools → Vagrant → Up



After the provisioning

git clone --branch 8.0.x app phing install

Or in phpstorm VCS → Checkout from Version Control → Git



  • Git Repository URL:
  • Parent Directory: <path to vd8>
  • Directory Name: app


After the clone completion select no when PHPStorm will prompt to open app dir as project.

Open build.xml in the editor or select it in the Project tool window, and then choose Add as Phing build file on the context menu of the selection.


It'll show you the phing build window and double click on install command.



After the install open login using username: admin with password: password. You can reinstall drupal using phing reinstall command or by double clicking the reinstall in phing build window.

As you know we can run phpunit using phpstorm but now you can also run simpletests in phpstorm. Use simpletest:enable to enable simpletest module and to test the class use simpletest:class command it'll prompt you for class name or you can use simpletest:group to test specific test group this command will prompt you for group name.



As a contrib developer it is a real pain to install contrib modules after install or reinstall but now you can automate that process as well without writing new profile. Create a files in vd8 root. Add following lines to the file

drupal.profile=standard ;Allows you to install different profile i.e. testing and minimal drupal.pass=secret ;Change drupal installation password. modules.enable=true ;Set it to true to enable modules during install or reinstall modules.list=dynamic_entity_reference bideo ;Module's name seprated by space.


You can also check the coding standard of your code by using phpcs:dir command. This command will prompt you the directory path you can add path relative to app directory.

If you want to add new command to phing build task please create an issue or submit a PR for vd8 repository. Please leave a comment below to share you experience.

PS: If you are going to use this on ubuntu then please look at

Posted by jibran.ijaz
Senior Drupal Developer



Comment by Bollo


Very useful. Thank you!

Comment by Anonymous


Following along at times it too long to work out what was intended

vagrant plugin install vagrant-auto_network vagrant plugin install vagrant- hostsupdater vagrant plugin install vagrant- vbguest

Yes that text is missing semicolons and a space after the hyphen should be removed in both cases

Comment by jibran.ijaz


Fixed. Thanks for pointing that out.

Comment by Steve Purkiss


Thanks, this is great! Still getting used to IDEs after years of VIM :D

I've just managed to get it to set up a D8 site on OSX. I hadn't set up PHP or PEAR or anything so once I figured that out it the main issue I had was (and perhaps this just got committed to D8) it's now looking for a services.yml copied from not a settings.php copied from default.settings.php.

Also a little confused as to the install vs reinstall - the reinstall has the commands for creating the files directory and copying the settings.php/services.yml so to set it up I need to do reinstall.

Thanks again,


Comment by finasteride


Lerman, it is a great post thanks for writing it!

Comment by jibran.ijaz


Thanks for the appreciation.

Comment by dman


Mostly about OSX + vagrant + phpstorm + vagrant hostsupdater and other plugins...
The tutorial failed for me at the provision-via-phpstorm step because it had "no askpass" and could not mount the /vagrant folder on the guest without admin intervention.
fix here…
was necessary for me. Or just doing 'vagrant up' from the cli directly.