How to install Drupal on Windows Subsystem for Linux (WSL/Ubuntu)

Submitted by dryer on Sun, 08/07/2016 - 10:11
Windows Logo

Windows 10 can now run a native Linux shell using a novel technology. Previously running PHP applications like Drupal was cumbersome under the world's most popular desktop operating system, but with the Windows Subsystem for Linux developers can enjoy a near-native Ubuntu shell within Windows.

Using the standard Ubuntu / Debian tools like apt-get to install you can setup a great local development environment for LAMP development. There is nothing stopping from using more contemporary components like Nginx, PHP 7 and Redis too. Interoperability with Windows also ensures that you can actually run some services like MySQL or Solr / Elastic Search as Windows services.

The capability was only made available in August 2016 with the Windows 10 Anniversary Update and the WSL still ships with the Beta label. Still it is already completely functional and you can even compile your own software against the Windows provided Linux Kernel shim without the Ubuntu Linux layer even being aware that it is running on the Windows NT Kernel.

Setting up a Drupal installation on Windows Subsystem for Linux (WSL for short) is identical to setting Drupal on any Debian / Ubuntu based Linux distributions:

  • Install components with the APT server
  • Setup web server with PHP and the correct URL rewrites for Drupal
  • Setup a MySQL database (either on Windows or the WSL)
  • Install Drupal and start development

Using any common tools like Git or Emacs is also identical to a native shell. So in addition to a development environment you've got a powerful toolkit to work with your Windows volumes using standard UNIX/Linux tooling.

More about the Windows Subsystem for Linux