Chapter 2. Go, Go, Go and Get Started!

Now that you know what Varnish is all about, you’re probably eager to learn how to install, configure, and use it. This chapter will cover the basic installation procedure on the most commonly supported operating systems and the typical configuration parameters that you can tune to your liking.

Installing Varnish

Varnish is supported on the following operating systems:

  • Linux

  • FreeBSD

  • Solaris

You can get it to work on other UNIX-like systems (OS X, OpenBSD, NetBSD, and Windows with Cygwin), but there’s no official support for those.


In reality, you’ll probably install Varnish on a Linux system. For development purposes, you might even run it on OS X. Linux is the most commonly used operating system for production systems. Some people do local development on a Mac and want to test their code locally. Therefore, it could make sense to install Varnish on OS X, just to see how your code behaves when it gets cached by Varnish.

The supported Linux distributions are:

  • Ubuntu

  • Debian

  • Red Hat

  • CentOS

You can easily install Varnish using the package manager of your operating system, but you can also compile Varnish from source.

Installing Varnish Using a Package Manager

Compiling from source is all fun and games, but it takes a lot of time. If you get one of the dependencies wrong or you install the wrong version of a dependency, you’re going to have a bad day. Why bother doing it the hard way (unless you have your reasons) if ...

Get Getting Started with Varnish Cache now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.