Drupal 7 on PuPHPet (Vagrant)
As a long time maintainer of the brewStack project, I have been spending time evaluating better ways to develop Drupal projects locally. Using VM based tools is a huge win because if you mess up a system configuration or setup, you can just throw away the VM and and start over. brewStack has been a great toolset, but you are altering your local Macs setup. Using Vagrant makes that much easier since you don't have to maintain VM snapshots or backups.
I started using Hobo on my Mac because it is super simple, but it will not allow me to use puppet manifests in its portable .hobo
files. While looking at some options, I came back across PuPHPet, which allows you to use a web UI to create the exact Vagrant development setup you want. It even allows you to deploy the setup to a number of hosting providers. PuPHPet has improved a lot since the last time I used it. It now supports a number of Linux distributions, nodejs, and plenty of configuration options. Vagrant and as result, PuPHPet now support multi-machine setups. This is a great way to separate services and create additional related machines within the same PuPHPet configuration.
I have setup a repo for my current Drupal 7 PuPHPet configuration. I encourage you to give it a go and contribute any improvements as pull requests. There seem is so much more than can be improved on this starter setup.
Want to give it a go? Here is how:
- Requirements
$ git clone git@github.com:shrop/drupal7-puphpet.git
$ cd drupal7-puphpet
$ vagrant up
- After the install/setup, you can browse to
http://192.168.56.101
and see Apache is running. - Back at the command line, you can download drush into the html folder
$ drush dl drupal-7 --drupal-project-rename="html" -y
- You can optionally add a hosts entry in
/etc/hosts
so you don't have to remember the IP address.- Example:
192.168.56.101 drupal7.dev
- Make sure to clear you DNS cache. Here is how to do it for OS X El Capitan: http://osxdaily.com/2015/11/16/howto-flush-dns-cache-os-x-elcap
- Example:
- Now just browse to http://drupal7.dev and install Drupal 7
- The
root
password for MySQL isdrupal
There are some other really nice Drupal development environments worth checking out. I have included a couple that I have come across. Please add comments with your other findings.
What's next? Docker-based local Drupal development. Look for an upcoming blog post.
Blog Category: