Magento Setup

Magento is a common eCommerce platform that is well known for suffering performance related issues. delivers huge speed improvements to Magento through caching HTML pages (and static assets) inside Varnish.

Different Approaches for Different Magento Versions

Prior to Magento 2.0, Varnish support is provided by the free Turpentine Magento extension.

As of Magento 2.0, support for Varnish to cache page content is integrated into Magento. offers “Instant Global Cache”, an extension that will let you get setup with Varnish and distribute it globally on’s CDN directly from the Magento Admin portal. You can also do a manual setup.

Magento 1.9 and Earlier

Process overview

Magento 1.9 and earlier does not support Varnish out of the box. Support is instead provided by the free Turpentine Magento extension.

The Turpentine extension issues commands required for correct operation to a management port intended for Varnish. A special “bridge” program listens on this port, and makes the platform look like a normal Varnish instance (Instead of a globally distributed platform that runs Varnish for you).

Follow the official instructions in order to install Turpentine. Since Varnish itself is already configured inside you’ll only need to complete the ‘Install this plugin’ steps.

  1. Sign up & create an application at using the final DNS name that your site will be accessed as.
  2. Download, install & configure the varnish-cli-bridge.
  3. Follow the standard Magento+Turpentine instructions, with some exceptions (see below).
  4. Apply the Varnish configuration from within Turpentine Configuration, to update
  5. Update your public DNS records to direct traffic to for your site.

Creating an application provides a customized Varnish image already configured for Magento Turpentine. Create your application using the Stack “Varnish v3 Magento Turpentine”.

Set up the varnish-cli-bridge

This program will listen for Varnish commands and foward them to the hosted Varnish platform.


Download the lastest cli bridge here. You will want the varnish-cli-bridge-vN.N.N-linux-amd64.tar.gz file.

Collect configuration details

There are 3 pieces of information required to run the bridge:

  1. API endpoint: This URL uniquely identifies your application within Most often, you’ll need the “Production varnish Proxy API endpoint” from the Configuration > API page in’s management portal.
  2. API username: This is a username that has permission to perform API actions.
  3. API password: This is a password for the specified user to perform API actions.

Run as a service

We have an Upstart script available to to run the bridge as a service.

Install Upstart if it is not already installed on your server. Copy the script above with the new name “varnish-cli-bridge.conf” into /etc/init/. Change the endpoint, username & password to match your application.

#Install Bridge
cd /tmp
curl  --remote-name --location
tar xvzf varnish-cli-bridge-v?.?.?-linux-amd64.tar.gz
cp ./varnish-cli-bridge /usr/local/bin/varnish-cli-bridge

#Setup bridge to run
cd /etc/init
curl --location --output varnishclibridge.conf
#EDIT /etc/init/varnishclibridge.conf WITH YOUR DETAILS
vi varnishclibridge.conf
start varnishclibridge

#Check bridge log for success - Should see a line like: 2015/01/14 05:55:14 main.go:159: Listening on ''.
tail /var/log/varnish-cli-bridge.log

Otherwise, use whatever solution is available with your distribution to run the binary as a service.

Deviations from official Turpentine instructions


See the turpentine installation guide.

Step 1-3: Skip these steps. There is no need to install or configure a local Varnish server.


See the turpentine configuration guide.

No special configuration is required to use Turpentine with the bridge &

Upload Turpentine configuration to

The configuration must be applied/uploaded into by manually hitting the Apply Varnish Configuration button on the Cache Management page.


There are 2 recommended tests to validate your implementation:

  1. Test Pages Are Coming From Cache - Reload your browser 3-5 times on a single page, You should start to see multiple Varnish ID’s in the HTTP response headers (In a browser debugger such as Chromes debugger) and see page response times around ~50-100ms
  2. Test Bans Are Reaching the Platform - Using a Product page on your site refresh 3-5 times to ensure pages are in cache. Once the page is in cache, Add a product to your shopping cart. This will cause Turpentine to send a Ban statement to to clear out the block on all pages for the user that contains the shopping cart. You should see the shopping cart updated successfully on page refresh.

Magento 2.0 and Later

With the release of Magento 2, Varnish is required for production usage. The means that you have to have a Varnish implementation to run your Magento 2 site. We offer an extension, Instant Global Cache, for you to get setup within the Magento portal, or follow the directions below for manual setup.

Magento 2 extension

To get started with and Varnish directly from the Magento Admin portal, you first must download the “Instant Global Cache” extension from the Magento Marketplace.

Once the extension is added, go to Reports in the left Nav and then find listed in your Reports.


We will ask you to login with credentials. To get these credentials, go to This will give you access to our demo account Bootcamp. It will also send you an email to verify your email address. This is required for us to setup your application.

When you are logged in on your Magento Admin Portal with your credentials, we will determine if you already have an application setup with us. If you do, we will show you the accounts you have with us. If you do not, we will create an application for you.

If you do not have Varnish Cache as your chosen Full Page Cache Caching Application, will will show an error message for you to update this. To update this field, go to Stores -> Configuration (under Settings) -> Advanced -> System. Then toggle the Caching Application under Full Page Cache to Varnish Cache.


Now you have a application created with Varnish 4 and Varnish Cache setup as your Full Page Cache solution in Magento.

Next, on the extension, you will see a Management section. The first button says “Update varnish configuration.” Clicking this button will pull in the recommended Magento VCL (Varnish Configuration Language) into your application.


There is also a button to pull in free HTTPS certificate. This will ensure your website has the green padlock next to the url. This is a free certificate included with your application that we will managed on your behalf, to include prourement, installation, and renewal. Please ensure your website has an endpoint exposed to the internet so we can validate the certificate before you go live.

To go live with Varnish and your application, you willl need to change a DNS record to point to Detailed instructions can be found here. You can also find more information from your hosting provider as to where to go to make this change. Once you have made the change, you can click verify to see if the change was successful and traffic is currently flowing through section.o.

Manual Magento 2 setup supports Magento 2 without any additional configuration or modules. The process to setup a Magento 2 site on is to select the “Varnish 4 (Magento 2.0.0)” dropdown when setting up your application. If this option is not in your dropdown please email and we will enable this feature for you.

Process overview

Except for installing your own copy of Varnish, you will essentially follow Magento’s own standard documentation at Configure and use Varnish.

  1. Sign up & create an application at using the final DNS name that your site will be accessed as.
  2. Follow the standard Magento+Varnish instructions, with some exceptions (see below).
  3. Finally, update your public DNS records to direct traffic to for your site.

Deviations from official instructions

Configure and use Varnish

See the Configure and Use Varnish documentation.

Known issues - Varnish does not support SSL: supports SSL with an integrated SSL termination proxy.

Install Varnish

See the Install Varnish documentation.

Skip this step. You will be using Varnish installed and managed by

Configure Varnish and your web server

See the Configure Varnish and your web server documentation.

Configure your web server - Skip this step. You do not need to configure your web server to listen on a port other than the default port 80 because Varnish will not be installed on the same server.

Modify the Varnish system configuration - Skip this step. You will not install Varnish.

Verify Varnish is working - Skip this step. You will not install Varnish.

Configure Magento to use Varnish

See the Configure Magento to use Varnish documentation.

Step 8. Instead of replacing a local existing default.vcl, paste the exported VCL into your application’s configuration using’s management portal under Configuration > Proxy, and Commit the change.

Step 9. There is no need to restart Varnish.