Topic

A development environment is any copy of your site that operates separately from the live site. Development environments allow you to make changes, try new modules, write new code, and test new ideas, on a copy of your site instead of the real thing, ensuring those changes happen in a sandbox where you're not affecting anyone trying to use the live version of your application.

This is typically done by installing the server software required to run Drupal on your own computer and then creating a clone of your existing database and files. Or you might have a separate instance of the site setup on the existing infrastructure.

Here's a basic recipe for setting up a new development environment:

  1. Install web server, database server, PHP, and Git
  2. Either install Drupal if starting from scratch, or clone the code, database, and user-generated files from your live site
  3. Clear the cache

Example tasks

  • Install Drupal on, or copy an existing site to, your computer to do development
  • Test modules and code without affecting the production site
  • Test server configuration changes on your localhost before deploying them to production

Confidence

There are dozens of ways to do this, and none is the only right way. The bare minimum requirement is that you have PHP, a web server, and a database running on the computer where you would like to install Drupal. Beyond that, it's mostly personal preference.

Drupalize.Me resources

More Guides

We have guides on many Drupal skills and topics.

Explore guides

External resources

Some development environments the Drupalize.Me team are currently using include:

  • SimplyTest.me, and Try Drupal (drupal.org)
    • Sometimes you just need to create a quick Drupal site to try out a new module or a proof of concept. SimplyTest.me is the fastest way we know of to do that. If you want something that doesn't expire after 24 hours, try one of the hosting providers with free options from Drupal.org.
  • Drupal VM (drupalvm.com)
    • Uses Ansible, and either a Vagrant VM or Docker containers to set up a Drupal-centered environment. Includes many convenient utilities for local development. A little harder to install but gives more flexibility and bundled features.
  • Kalabox (kalabox.io)
    • Uses Docker containers with sane defaults for Drupal development. Includes features for synchronizing with your host that are especially useful if you host with Pantheon. Includes a GUI for spinning up new Drupal 7 & 8 sites
  • PHP 5.3 to 7.1 for OS X / macOS 10.6 to 10.12 as binary package (php-osx.liip.ch)
    • This package installs the latest PHP binary on OS X as well as many useful extensions and ini-settings. It's especially suited for Symfony 2 development. It also provides a decent php.ini with all settings configured according to "Best Practices". It doesn't install Apache, MySQL or any other external programs. It uses the Apache installation, which comes with OS X. For installing MySQL you can, for example, use Homebrew. The package is based on entropy's php package.