Installing some version of Varnish is quite easy: your Linux distribution’s package managers probably have a Varnish Cache package available. You can even compile Varnish from source, and follow the development of the project, if you wish.
There are a lot more ways to get a hold of Varnish, both Varnish Cache and Varnish Enterprise. The official packages by Varnish Software will give you the recommended version of Varnish.
The recommended official package repositories are hosted on Packagecloud, and they’re available for Debian-based systems (Debian and Ubuntu), and for RPM-based systems (Red Hat, CentOS, Fedora), both for Varnish Cache, and for Varnish Enterprise.
For Varnish Cache, you can find these packages on https://packagecloud.io/varnishcache. You can either pick individual releases, or one of the weekly builds. Since these packages are supported for a limited time, my advice is to just install Varnish 6.0 LTS.
There is an equivalent for Varnish Enterprise, but it requires an access token, which comes with the Varnish Enterprise license.
Using Packagecloud repositories is quite easy. For Debian-based systems, you can run the following command to set up the repository on your machine:
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish60lts/script.deb.sh | sudo bash
This snippet will download and execute a Bash script, that detects which
Linux distribution you have. It provisions the right channels, and you
can run apt-get install varnish to install Varnish using our official
packages.
There is also a manual way of configuring the repositories, if you are uncomfortable running a Bash script you have downloaded from the internet as the root user.
For RPM-based systems, you’ll have to run the following equivalent:
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish60lts/script.rpm.sh | sudo bash
And you install Varnish using our official packages by running
yum install varnish
Varnish Cache is open source, so yes, you can access and download the source.
The Releases & Downloads page on the Varnish Cache website provides every release, from Varnish Cache 0.9 all the way up to Varnish Cache 6.6.
The development of Varnish Cache happens on GitHub. You can look at individual commits, issues, pull requests, and various branches. The releases page also offers all released versions of Varnish Cache, as well as beta versions, and release candidates. If you do not want to install from source, the weekly packages provide a convenient way to check out the latest developments of Varnish Cache.
There is an official Docker image for Varnish Cache on the Docker Hub.
By running the following command, you spin up a Docker container using the latest version of Varnish Cache, which currently is version 6.6:
docker run --name my-running-varnish -v /path/to/default.vcl:/etc/varnish/default.vcl:ro --tmpfs /var/lib/varnish:exec -d -p 8080:80 varnish:latest
This command will:
latest tag of the varnish Docker imagemy-running-varnish/path/to/default.vcl onto
/etc/varnish/default.vcl in the container/var/lib/varnish folder as a temporary file system in
memory with exec privilegesAt this point the latest tag on the varnish Docker image refers to
version 6.6, which can also be used as a tag. Another tag that refers
to the same version is fresh. That’s what we call the latest Varnish
Cache release.
However, you can also run a Varnish 6.0 LTS Docker container by using
either the 6.0 tag, or the stable tag.
In summary, these are the tags of the official Varnish Cache Docker image that are currently available:
varnish:latest (version 6.6.0)varnish:fresh (version 6.6.0)varnish:6 (version 6.6.0)varnish:6.6 (version 6.6.0)varnish:6.6.0 (version 6.6.0)varnish:stable (version 6.0.8)varnish:6.0 (version 6.0.8)varnish:6.0.8 (version 6.0.8)A collection of official Varnish images is available in the respective marketplace of cloud providers like:
These images contain pre-installed versions of Varnish with the required configuration to get started immediately.
AWS, Azure, GCP, and OCI offer Varnish Enterprise images, whereas DigitalOcean currently only offers Varnish Cache images.
The Varnish Enterprise image also comes with pre-installed and pre-configured tools like:
What makes this cloud offering so interesting is that users can try Varnish Enterprise without having to buy a license upfront: there is an hourly license cost associated with running these images, which the cloud provider bills on top of their own service charges.
You’re not interacting with Varnish Software directly, because your cloud platform’s marketplace will act as a broker.
The licensing model for AWS, Azure, and GCP is flexible in such a way that you can spin up a Varnish Enterprise virtual machine using our official images for a couple of hours, and end up spending only $1 on licensing.
Oracle’s OCI platform applies a bring your own license model, which works well for enterprise users.
However, if you don’t buy a license with Varnish Software, you’re not entitled to the same level of service and support that Varnish Software clients enjoy.
On DigitalOcean there is no license fee because Varnish Cache is an open source project. The only bill you will get there is your infrastructure bill.