Setup development environment for Drupal on windows 10

Being a Drupal developer, I would prefer to work on a Mac or Linux (Ubuntu) operating system for fast and hassle-free development work, but sometimes you will not get such preferences, may be due to organizations’ norms.

Assume you have a Windows machine for local development and have been assigned to a Drupal project, and you have now configured your local machine for the Drupal project.

In this post, I'll walk you through the steps for setting up a local development environment for Drupal.

Let's dive into the process of installing all the required software. I am assuming you have permission to install WSL from your organization's administrator team.

The following sets of applications will be needed in order to setup the local environment:

  • Install the Windows Subsystem for Linux (WSL)
  • Install VS code along with WSL plugin.
  • Install PHP, MySql, Apache2/Nginx.
    sudo apt-get install lamp-server^
    
  • Git
  • Composer - refer Download Composer
  • Drush
    sudo apt-get install git
    composer global require drush/drush
    

That's all you need to start with your development. You might need to create a separate user for your MySQL.

sudo mysql -u root
[sudo] password for :

mysql> USE mysql;
mysql> CREATE USER 'drupal'@'localhost' IDENTIFIED BY 'drupal';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'drupal'@'localhost';
mysql> ALTER USER 'drupal'@'localhost' IDENTIFIED WITH mysql_native_password
BY 'drupal'; 
mysql> FLUSH PRIVILEGES;
mysql> exit
0/5