Search

Getting started with Varnish Enterprise 6.0 Tutorial

Introduction

In this tutorial, you will learn how to perform an initial installation of Varnish Enterprise 6.0 on Debian 10 (Buster). Looking for another platform?

Prerequisites

Before you can start this tutorial, you should have:

  • A host running Debian 10 (Buster).
  • Credentials to access the Varnish Software Debian repository.

Step 1 - Repository setup

Install packages needed to set up the repository:

sudo apt-get update
sudo apt-get install apt-transport-https curl

Add the Varnish Enterprise gpg key to the keyring used by APT:

curl -L https://TOKEN:@packagecloud.io/varnishplus/60/gpgkey | sudo apt-key add -

Create the file /etc/apt/sources.list.d/varnish-software.list with the following contents:

deb https://packagecloud.io/varnishplus/60/debian/ buster main

Create the file /etc/apt/auth.conf with the following contents:

machine packagecloud.io/varnishplus/60
login TOKEN

Make sure the file auth.conf is not world readable:

sudo chown root:root /etc/apt/auth.conf
sudo chmod 600 /etc/apt/auth.conf

Authenticated access to multiple repositories

The order of entries in /etc/apt/auth.conf matters. If enabling authenticated access to multiple repositories, make sure to have the more specific machine names on top in /etc/apt/auth.conf. The following is an example showing how to enable multiple Varnish related repositories:

machine packagecloud.io/varnishplus/60-extra1
login TOKEN1

machine packagecloud.io/varnishplus/60-extra2
login TOKEN2

machine packagecloud.io/varnishplus/60
login TOKEN

Step 2 - Installation

Install Varnish Enterprise and VMODs:

sudo apt-get update
sudo apt-get install varnish-plus

The configuration files for Varnish are:

  • /etc/varnish/default.vcl

    The VCL configuration file that is loaded by default when Varnish starts. In this file you can specify the location of your web servers.

  • /usr/lib/systemd/system/varnish.service

    The systemd unit file specifying the Varnish parameters, storage engines and the VCL configuration file to load on startup. This file should not be edited but overridden according to systemd best practices.

Step 4 - Process management

Varnish is started, stopped, restarted and reloaded using the following commands:

sudo systemctl start varnish
sudo systemctl stop varnish
sudo systemctl restart varnish
sudo systemctl reload varnish

Verify if Varnish is running using the following command:

sudo systemctl status -l varnish

Next steps

Varnish Enterprise 6.0 has now been installed in Debian 10 (Buster). Now it’s time to dive into VCL and VMODs.