How to Install Varnish Cache on Windows

Caching is not just a process of storing data in a temporary storage unit but also one of the pillars of web performance optimization. It’s a powerful technique to make your website load faster. The website can’t be called optimized without using a caching system.

In Magento 2, cleaning and flushing cache is essential after modifying configuration files, to apply the required changes. It collects configuration from all modules, merges it, and saves the merged result to the cache. This cache also contains store-specific settings stored in the file system and database.

By default, you can configure Magento 2 ‘Caching Application’ from Stores > Configuration > Advanced > System > Full Page Cache . You can see ‘Varnish Cache’ option with the recommended label.

You have to install varnish cache on windows to use its functionalities and configure it as this post shows you how to do it.
Let me first introduce “varnish” to you and how it’s different from the Magento default cache.

Varnish cache is a web application accelerator which stores files or fragments of files in memory to reduce the response time and network bandwidth consumption on future equivalent requests. 

The varnish is a much quicker option and will give you the flexibility to cache most of your content, including HTML documents!

“Built-in “Full Page Cache” is enough for better performance”, and it’s the common misbelief while using Magento 2!

Individually, I recommend you to use built-in cache in development mode however when your store is in production mode, I strongly recommend using Varnish Cache for the optimal performance.

Steps to Install Varnish Cache on Windows

  1. Check the setup version and click on Next button.
    install varnish cache step1
  2. Choose the installation type. Here I want to install it from the internet.varnish step2
  3. Select the root directory where you want to install it.varnish step3
  4. Select local package directory from “Browse” button and click on the “Next” button.varnish step 4
  5. Select the site(s) from the list or add your site to the list by entering it in User URL textbox, and click “Add”.varnish step 5
  6. After progressing, the next dialogue box will display several packages and allow you to select packages to install.varnish step 6
  7. Search for ‘varnish’ in the Search filter of Select Packages popup, and then select the appropriate package and click “Next”.varnish-step-6.1
  8. It will display the list of installation packages to review and confirm. Click on “Next” once reviewed.
    varnish step 6.2
  9. Click on “Next” after it completes 100% progress.varnish step 6.3
  10. After it finishes the installation, double click its icon that resides on the desktop.logo

You can see the command prompt by double-clicking this icon.
To check if varnish is installed or not, run the following command in the terminal.

varnishd -V

It returns the version of Installed varnish.

command prompt
Finally, the installation is done. You can configure varnish cache from Magento 2 store’s backend.

That’s it!

Quite lengthy but installed!

If you have any doubts, just mention them in the Comments section below.

I would be happy to help.

Feel free to share the solution with Magento 2 community via social media.

Thank You.

(based on 15 Reviews)
How to Install Varnish Cache on Windows

Krishna Rajyaguru

Krishna is a Magento developer at Meetanshi. She is always ready to learn new things. Apart from work, she likes to read books and spend time with family.


  • Wakar Ahamad

    Hi Team,

    Thanks for the detail explanation.

    I am getting same problem that ‘Satish Choudhary’ is getting (after running command varnishd -V getting varnishd: command not found)…as checked, for me…varnished file is available at /usr/sbin.


  • Satish Choudhari

    Hi ..I installed varnish on windows but when i run the command varnishd -V ..i get the error that command not found.

Leave a Reply

Your email address will not be published.