This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

📣 Join our live AMA on the Future of Page Builders with Brizy's CEO! Register Now →

How to Install Varnish on Drupal 7

Updated on July 28, 2017

4 Min Read

Previously in the quest to maximize the performance of a Drupal 7 website hosted on Cloudways, I’ve shown you the installation process for Redis and Memcache for Drupal. In this post, I will demonstrate how to install Varnish on Drupal 7.

Varnish on Drupal 7 Banner

To get a complete idea of what a powerhouse Varnish truly is, read its Wikipedia page. To give you a taste of its power, consider the fact that Varnish could speed up your website up to 300 times.

So, without further ado, let’s get into it. Here are the steps involved in the process:

  1. Setup Varnish on the server
  2. Ensure Varnish is running on the server
  3. Enable Varnish on your Drupal application
  4. Install Varnish module on Drupal website
  5. Configure Varnish settings
  6. Verify Varnish is operational on your website

Nothing as Easy as Deploying Drupal Apps on Cloud

With Cloudways, you can have your Drupal apps up and running on managed cloud servers in just a few minutes.

Setup Varnish on the Server

The real advantage of using Cloudways is that you get Varnish pre-installed on your server. This means that you don’t have to deal with the hassles of setting up Varnish and entering long commands at the CLI to get it running on your server. This is just one way on which Cloudways offer peace of mind to its customers.

Ensure Varnish is running on the Server

To make sure that Varnish is running on your server, you can check its status in just a few clicks. Simply navigate to your server’s dashboard and click the Manage Services tab in the left sidebar.

Cloudways running services

Here, you will be presented with the various services running on the server. Locate Varnish and verify that the status is green (running). You can also purge it or disable it (in one click) from this location.

Enable Varnish on your Application

The really cool thing about Cloudways is that not only can you enable Varnish on your server through the really easy-to-use GUI, but you can also enable it on your application in much the same way. Simply navigate to your Drupal application’s dashboard and click the Application Settings button in the left toolbar.

Application settings

Simply click the Varnish toggle to enable it.

Install the Varnish Module on your Drupal website

Now, normally in the case of other hosts, you will be required to install the Varnish module for Drupal 7 yourself. However, in the case of Cloudways, you will notice in the Drupal module’s list that the Cloudways already provides the Varnish module pre-installed and enabled on your site.

Drupal Varnish Module install

Configure Varnish Settings

Next, you can go to the Varnish module’s configuration page and change any settings to your preferences. Although the choice of the settings is up to you, remember that messing up with settings could seriously impact the performance of your website.

Verify that Varnish is Active on your Website

The last step of the process is the confirm that Varnish is active on the Drupal website. The easiest method is through the network tab in the Google Chrome’s inspect element. Go to your Drupal website and log out. Right click anywhere on your website and click inspect. This will bring up the following screen:


Click the network tab on the top and refresh the page.

Inspect Network

Now click the name of your website. This will open a new sub-tab. In this section, click the header tab and locate X-Varnish-Cache heading. Make sure it is set to HIT. This shows that Varnish is running properly on your website.

Inspect network varnish status


Cloudways makes it incredibly easy to deploy the best caching methods available right now. Installing Varnish is a breeze on a Drupal website hosted at Cloudways, thanks to the very simple GUI.

If you need further help with the process, do leave a comment and I will get back to you.


Share your opinion in the comment section. COMMENT NOW

Share This Article

Hamza Zia

Hamza is a Drupal Community Manager at Cloudways - A Managed Drupal Hosting Platform. He loves to write about Drupal and related topics. During his free time, he can be seen obsessing over Football, Cars, Android and Gaming.


Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!


Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Want to Experience the Cloudways Platform in Its Full Glory?

Take a FREE guided tour of Cloudways and see for yourself how easily you can manage your server & apps on the leading cloud-hosting platform.

Start my tour


  • 0


  • 0


  • 0


  • 0



For 4 Months &
40 Free Migrations

For 4 Months &
40 Free Migrations

Upgrade Now