Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

Install Varnish 5.1.2 – CentOS 7.3

If you’re here, you know why you want Varnish-Cache, if you still aren’t sure, read this.

The people behind Varnish-Cache have changed things up a bit with regards to installation, The repo is now being managed by Package Cloud.

Start off by adding the repo to your server, add the file varnish5.repo to the location: /etc/yum.repos.d

Add the following to it:

[varnishcache_varnish5]
name=varnishcache_varnish5
baseurl=https://packagecloud.io/varnishcache/varnish5/el/7/$basearch
repo_gpgcheck=1
enabled=1
gpgkey=https://packagecloud.io/varnishcache/varnish5/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[varnishcache_varnish5-source]
name=varnishcache_varnish5-source
baseurl=https://packagecloud.io/varnishcache/varnish5/el/7/SRPMS
repo_gpgcheck=1
enabled=1
gpgkey=https://packagecloud.io/varnishcache/varnish5/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

Now all you need to do is run:

yum install varnish

Note: If you have varnish previously installed you will need to backup it’s configuration, remove it and then install the new one.

At the time of writing this I received a GPG Mismatch error, to bypass this, modify the install statement like below:

yum --nogpg install varnish

That’s it, you’re done!