Install & Develop Drupal 10 websites on Windows using FREE tools

To set up your local development environment and all the tools you need, follow this step by step guide. It'll show you how to install WAMP (Windows, Apache, MySQL and PHP), Git (for version control and moving code between environments), Composer (downloads our software and their dependencies), Drush (a command line tool for Drupal) and Visual Studio Code IDE (Integrated Development Environment; text editor, terminal and remote connections, all in one program with lots of supporting extensions for free).

Once you have your development environment and empty database ready to go, you can follow this. These commands are entered into the terminal within Visual Studio Code.

Create a new directory. 

Replace the example.com with your domain name. 

mkdir /c/wamp64/www/example.com && cd /c/wamp64/www/example.com

Composer commands

Composer commands essential download the software that we want on our website, whilst also managing the dependencies. So if we tell it that we want a specific module for example, it will automatically download the other software that it needs in order to work.

Get Drupal 

I made a mistake in the video and downloaded Drupal to "some_dir" - oops! This improved command resolves that issue.

composer create-project drupal-composer/drupal-project:10.x-dev . --no-interaction

Get the upgrades

These are the modules that all my websites start with. They help deal with admin UI improvements, common features, performance and SEO.

composer require 'drupal/paragraphs' 'drupal/bootstrap_paragraphs' 'drupal/eva' 'drupal/inline_entity_form' 'drupal/advagg:^6.0@alpha' 'drupal/admin_toolbar' 'drupal/adminimal_admin_toolbar' 'drupal/bootstrap5' 'drupal/adminimal_theme' 'drupal/image_url_formatter' 'drupal/antibot' 'drupal/eu_cookie_compliance' 'drupal/google_analytics' 'drupal/metatag' 'drupal/pathauto' 'drupal/redirect' 'drupal/search404' 'drupal/xmlsitemap' 'drupal/module_filter' 'drupal/twig_tweak'

Drush Commands

Install Drupal

Replace values to suit your needs

drush site-install standard --db-url='mysql://root:@localhost/name_of_database' --site-name='Example Website' --account-name=admin --account-pass=testpassword

Enable the upgrades

drush theme:enable adminimal_theme && drush theme:enable bootstrap5 && drush config-set system.theme admin adminimal_theme -y && drush en twig_tweak metatag_open_graph paragraphs bootstrap_paragraphs eva inline_entity_form inline_form_errors admin_toolbar module_filter admin_toolbar_tools advagg antibot eu_cookie_compliance media metatag metatag_facebook metatag_views settings_tray telephone pathauto redirect search404 xmlsitemap google_analytics image_url_formatter admin_toolbar_links_access_filter advagg_css_minify advagg_js_minify adminimal_admin_toolbar -y && drush pm-uninstall automated_cron color tour  && drush cache:rebuild

Create a virtual host

For the website to be viewable via your browser, you need a virtual host. Obviously change example to your project name. Keep .wamp at the end. It helps keep things organised for ongoing web development.

Visit http://localhost and click Add virtual host.

Set the alias to: example.wamp
Set the complete path to: c:/wamp64/www/example.com/web
Restart your WAMP server via the tray icon.

Now visit (making sure to put the proceeding /): http://example.wamp/

Conclusion

Setting up a fresh Drupal website takes about 15 mins. Most of that is waiting for commands to execute.

So that's it. Welcome to the world of Drupal development!

Post type: 
Drupal version: