Search

Getting Started with Varnish Enterprise 6.0 Tutorial

Introduction

This tutorial shows you how to perform an initial installation of Varnish Enterprise 6.0 on Red Hat Enterprise Linux (RHEL) 9, AlmaLinux 9 and Rocky Linux 9. Looking for another platform?

Prerequisites

Before starting this tutorial, you should have:

  • A host running RHEL 9 or one of the alternatives listed above.
  • Credentials to access the Varnish Software EL repository.

Step 1 - Repository Setup

Create the file /etc/yum.repos.d/varnish-software.repo with the following:

[varnish-enterprise-6.0]
name=Varnish Enterprise
baseurl=https://TOKEN:@packagecloud.io/varnishplus/60/el/9/x86_64
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://TOKEN:@packagecloud.io/varnishplus/60/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

Enable the Extra Packages for Enterprise Linux (EPEL) repository by installing the epel-release package:

sudo dnf install epel-release

Step 2 - Installation

Install Varnish Enterprise and VMODs:

sudo dnf install varnish-plus

The package varnish-plus-vmods-extra is optional and comes with VMODs that have additional dependencies. In EL9, some of these dependencies are satisfied by packages from the Code Ready Builder (CRB) repository. If you’d like to install varnish-plus-vmods-extra, please enable the CRB repository first:

# Only needed if dnf config-manager is not installed
sudo dnf install -y 'dnf-command(config-manager)'

sudo dnf config-manager --set-enabled crb
sudo dnf install varnish-plus-vmods-extra

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.

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

    The systemd unit file specifying 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 starts, stops, restarts, and reloads 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. At this point, it is possible to dive in to VCL and VMODs.

VCL Resources: