Setting up your Local Development Environment ( A guide for Ubies ) Part 1

If you are entering into the AcquiaU program or just happen to be starting down the Drupal path on your own then there is a good chance that you are using Acquia Dev Desktop for your local site installations. Acquia Dev Desktop is a great tool and probably one of the quickest ways to get a Drupal site up and running on your local machine. Eventually though you will most likely reach a point where you wish to have more control and ability to customize your development environment. There are a large number of ways to go about doing this: LAMP stacks, MAMP, WAMP, XAMPP, Virtual Machine environments, and so on. It seems that every developer has their own prefered environment and may go through several setups trying to find it. The aim of this post is to try and take a little bit of that pain away and do a step by step walk through of setting up a virtual server and integrating that server with PHPStorm for a fully functional development environment. This guide isn't just for Ubies or people just starting out, but chances are if you have some experience then this guide may be a little overkill for you and might just want to skip straight to the source of the tools we will be using.

For this setup I'll be using vagrant to quickly setup a virtual server through VirtualBox. VirtualBox allows users to load multiple guest operating systems under a single host OS. These guest OS's can be independently started, stopped, paused, backed up, and independently configured in their respective virtual machine. If you wanted you could go ahead and download VirtualBox, a linux distro such as ubuntu and go through the process of manually setting up a virtual server on your local machine and I highly recommend you go through the process at least once on your own, but as I said for this walkthrough we will be using vagrant. Vagrant provides quick, portable, pre-configured work environments, in fact there are several vagrant installs you can download to meet all kinds of development needs. Other than the fact that vagrant setups are quick and easy, they also provide the benefit of creating consistent environments. If you are a developer on a team of developers and everyone is using the same vagrant install then you know that everyone is using the same development resources. Eliminating issues that could be caused by individual configurations of development environments ("I don't understand, it works just fine on my machine."). Since we are concerned with drupal development we will be using a vagrant box called Drupal VM. Created by Jeff Geerling, Drupal VM aims to create a virtual server running Ubuntu 14.04, a drupal site install, drush, and pretty much all the extras you will need for drupal development. So let's get started!

What we need to get started

First thing we will do is head over to the Drupal-VM git repository. If you take a look through the readme you will see that the initial set-up is pretty straight forward. You could just follow the initial steps already documented there to get started and I will re-iterate them here for simplicity sake.

1. To start off, head over to the VirtualBox download site, download and install VirtualBox onto your computer.
2. Next we will want to download and install vagrant onto our computer.
3. Finally if you are on a Mac, you will want to download and install Ansible. There are several methods for installation documented here, look for the method that best suits the operating system you are using (if you are on a windows machine then check out the notes already documented by Jeff Geerling in the Drupal VM readme).

If you aren't already familiar with any of these programs, take a few minutes to read through the documentation to get a better understanding of what they do and what they are used for.

Downloading the virtual machine

Now we need to get Drupal VM onto our machines. Keep in mind you don't have to use the same directory structure as myself but you may want to your first time through just to follow along.

Open a terminal window and type the following commands.

cd ~/Sites
mkdir local_dev_setup
cd local_dev_setup
git clone

Perform a ls command to ensure that the Drupal VM directory did indeed get cloned onto your machine. Go ahead and cd into the Drupal VM directory and perform another ls and you should see all the files there. Take note of the example.config.yml and the example.drupal.make.yml files, these are the two files that will concern us moving forward.

At this point we now have everything we need to move forward with installing our virtual machine. In fact we could just rename the two example files to config.yml and drupal.make.yml, run vagrant up from the command line, and watch as a virtual server and Drupal 8 are installed onto our systems. Let's dig in though and look at how we can customize the installation to our liking and we will cover that in the next section.

Setting up your Local Development Environment ( A guide for Ubies ) Part 2

About the Author

John Cunningham

I joined the U.S. Marine Corp at the age of 17. I served for five years part of which fell during Operation Enduring Freedom. Following the Marines, I attended the university of Central Florida and received my Bachelors of Science in Biology.

User login