Search

Getting started with Varnish Enterprise 6.0 Tutorial

Introduction

In this tutorial, you’ll learn how to do an initial installation of Varnish Enterprise 6.0 on Debian 9 (Stretch). Looking for another platform?

Prerequisites

Before starting this tutorial, you should have:

  • A host running Debian 9 (Stretch).
  • 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://TOKEN:@packagecloud.io/varnishplus/60/debian/ stretch main

Add the following contents to /etc/apt/sources.list.d/sources.list:

deb http://deb.debian.org/debian stretch-backports main

Step 2 - Installation

Install Varnish Enterprise and VMODs:

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

Step 3 - Initial configuration

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.

  • /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

Verify if Varnish is running using the following command:

sudo systemctl status -l varnish

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

Next steps

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