Search
Varnish Enterprise

Installation

The Varnish Enterprise offering has Enterprise at its core, as most components interact with it in one way or another. Though installing Enterprise first is recommended, some other components (like the Varnish Administration Console) can be installed independently.

When you sign up for Varnish Enterprise, you’ll receive a welcome letter with the necessary installation information. This includes a unique token for your account, which will be represented as TOKEN in this guide.

Installing Varnish Enterprise is a two step process:

  1. Configure the repository for your Linux distribution.
  2. Install the software using the built in package manager.

Note: If you can’t locate your username and password, contact support@varnish-software.com.

Supported platforms

Varnish Enterprise is in prepackaged form and supports the most common Linux operating system distributions:

  • RedHat Enterprise Linux 7
  • RedHat Enterprise Linux 8
  • Ubuntu Linux 16.04 LTS (xenial)
  • Ubuntu Linux 18.04 LTS (bionic)
  • Ubuntu Linux 20.04 LTS (focal)
  • Debian 9.0 (stretch)
  • Debian 10.0 (buster)

Legacy versions have different sets of supported platforms.

Varnish Enterprise is supported on 64bit systems with Intel or AMD processors (x64).

Repository configuration and Varnish Enterprise installation

Since we’re modifying system configurations and installing new packages, all commands below are expected to be run as root. As usual, great powers comes with great responsibility, please make sure that important information is backed up before proceeding.

RedHat Enterprise Linux and derivatives

Note: On RHEL platforms, Transparent Huge Pages are usually active by default. Please check the Notes section below on how to deactivate them.

Disable the Varnish DNF Module in EL 8

You’ll need to disable the Varnish DNF module before installation to avoid conflicts and issues related to package compatibility. This is for RHEL 8 based distributions only.

Run the following command:

dnf -y module disable varnish

Sample output:

[root@Your-Machine ~]# dnf -y module disable varnish
varnish-enterprise-60                                                                 1.4kB/s|833B 00:00
varnish-enterprise-60                                                                 39kB/s|3.8kB 00:00
Importing GPG key 0x96070917:
Userid :"https://packagecloud.io/varnishplus/60
(https://packagecloud.io/docs#gpg_signing) <support@packagecloud.io>"
Fingerprint: CE98 860E 21CE CAE9 5429 3743 5E00 8F49 9607 0917
From :
https://your-token-here:@packagecloud.io/varni shplus/60/gpgkey
varnish-enterprise-60                                                               337kB/s|224kB 00:00
Dependencies resolved.
==============================================================================
Package 	Architecture		Version 	Repository 	Size
===============================================================================
Disabling modules:
 varnish

Transaction Summary
==============================================================================

Configure yum repository for Varnish Enterprise

Create or edit /etc/yum.repos.d/varnish-enterprise-6.0.repo to contain the repository details:

[varnish-enterprise-60]
name=varnish-enterprise-60
baseurl=https://TOKEN:@packagecloud.io/varnishplus/60/el/$releasever/$basearch
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

Note: Be sure to replace the ${TOKEN} with the Package cloud token found in the credential section.

Enable epel-release repository

The epel-release repository or, “Extra Packages for Enterprise Linux” (EPEL), contains some dependencies that Varnish Enterprise packages will require.

Run the following command:

yum install -y epel-release

This output will confirm the installation:

...
Installed:
    epel-release-8-18.el8.noarch
...

Install Varnish Enterprise

Install Varnish Enterprise with the required dependencies.

Run the following command:

yum install -y varnish-plus

The following output will confirm the installation:

...
Installed:
 annobin-10.94-1.el8.x86_64                  binutils-2.30-119.el8.x86_64
cpp-8.5.0-18.el8.x86_64
 dwz-0.12-10.el8.x86_64                      efi-srpm-macros-3-3.el8.noarch
gcc-8.5.0-18.el8.x86_64
.
.
.
.
varnish-plus-selinux-6.0.11r4-1.el8.noarch
 zip-3.0-23.el8.x86_64
...

Ubuntu / Debian

Packages in our repositories are signed and distributed via HTTPS, so you’ll need to enable HTTPS support in the package manager and install our public key first:

apt-get install -y apt-transport-https
curl -L https://TOKEN:@packagecloud.io/varnishplus/60/gpgkey | apt-key add -

To use our Varnish Enterprise repositories, paste the following in /etc/apt/sources.list.d/varnish-enterprise-6.0.list:

# be sure to replace "DIST" with "ubuntu" or "debian", and "RELEASE" with
# "xenial", "bionic" or "stretch" depending on your exact platform

# Varnish Enterprise 6.0 and VMODs
deb https://TOKEN:@packagecloud.io/varnishplus/60/DIST/ RELEASE main

If you are using Debian 9.0 (stretch), paste the following in /etc/apt/sources.list.d/sources.list:

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

Finish by updating the apt database and installing the varnish-plus package:

apt-get update
apt-get install -y varnish-plus

After installation

Version

This checks the installed Varnish version, which could be helpful to include when submitting a support request. Note: Version may have changed from example below

The -V argument will output the exact varnishd version installed on your system (which should be varnish-plus):

[root@Your-Machine ~]# varnishd -V
varnishd (varnish-plus-6.0.11r4 revision 676b15e5f7393eb5d5700df47ea504055db032d4)
Copyright (c) 2006 Verdens Gang AS
Copyright (c) 2006-2023 Varnish Software AS

Service status

Enable the service and verify that it’s running:

[root@Your-Machine ~]# systemctl enable --now varnish && systemctl status varnish
 ● varnish.service - Varnish Cache Plus, a high-performance HTTP accelerator
   Loaded: loaded (/usr/lib/systemd/system/varnish.service; disabled; vendor preset: disabled)
        Active: active (running) since Wed 2023-08-09 23:26:28 UTC; 13min ago
        Process: 16004 ExecStart=/usr/sbin/varnishd -a :6081 -a
localhost:8443,proxy -T localhost:6082 -S /etc/varnish/secret -p feature=+http2 -r vcc_allow_inline_c -r allow_exec >
        Main PID: 16005 (varnishd)
         Tasks: 223
        Memory: 156.4M
        CGroup: /system.slice/varnish.service
            ├─16005 /usr/sbin/varnishd -a :6081 -a localhost:8443,proxy -T localhost:6082 -S /etc/varnish/secret -p feature=+http2 -r vcc_allow_inline_c -r allow_exec -f /etc/>
            └─16015 /usr/sbin/varnishd -a :6081 -a localhost:8443,proxy -T localhost:6082 -S /etc/varnish/secret -p feature=+http2 -r vcc_allow_inline_c -r allow_exec -f /etc/>

        Aug 09 23:26:28 AMSI-Machine varnishd[16005]: Debug: Version: varnish-plus-6.0.11r4 revision 676b15e5f7393eb5d5700df47ea504055db032d4
        Aug 09 23:26:28 AMSI-Machine varnishd[16005]: Debug: Platform: Linux,4.18.0-477.10.1.el8_8.x86_64,x86_64,-junix,-smse,-hcritbit
        Aug 09 23:26:28 AMSI-Machine varnishd[16005]: Version: varnish-plus-6.0.11r4 revision 676b15e5f7393eb5d5700df47ea504055db032d4
        Aug 09 23:26:28 AMSI-Machine varnishd[16005]: Platform: Linux,4.18.0-477.10.1.el8_8.x86_64,x86_64,-junix,-smse,-hcritbit
        Aug 09 23:26:28 AMSI-Machine varnishd[16005]: Debug: Child (16015) Started
        Aug 09 23:26:28 AMSI-Machine varnishd[16005]: Child (16015) Started
        Aug 09 23:26:28 AMSI-Machine varnishd[16005]: Child launched OK
        Aug 09 23:26:28 AMSI-Machine varnishd[16005]: Child (16015) said
Child starts
        Aug 09 23:26:28 AMSI-Machine systemd[1]: Started Varnish Cache Plus,
a high-performance HTTP accelerator.
        Aug 09 23:26:28 AMSI-Machine; varnishd[16005]: Child (16015) said
Environment mse fully populated in 0.00 seconds. (0.00 0.00 0.00 0 0 0/1 0 0 0 0)

HTTP connectivity

Using cURL against localhost at port 6081 indicates that Varnish is listening and responding to incoming traffic coming.

Run the following:

[root@Your-Machine ~]# curl -I localhost:6081

It should return something like this:

HTTP/1.1 503 Backend fetch failed
Date: Wed, 09 Aug 2023 23:29:22 GMT
Server: Varnish
Content-Type: text/html; charset=utf-8
Retry-After: 5
X-Varnish: 2
Age: 0
Via: 1.1 varnish (Varnish/6.0)
Content-Length: 278
Connection: keep-alive

The X-Varnish and Via headers confirm that we are, indeed, talking to Varnish.

Misc. commands

To find out more about OS:

[root@Your-Machine ~]# cat /etc/os-release

Notes

Transparent Huge Pages (THP)

Transparent Huge Pages is a Linux kernel feature to improve performance by more efficiently using a processors’ memory mapping hardware. This is a feature that is enabled by default on most recent Linux distributions.

Varnish does not perform well with this option enabled. As such, Transparent Huge Pages should be set to either madvice or never on any system where Varnish is operating.

The procedure to disable THP will vary based on the distribution being used. Please consult with the manual for your distribution for the correct steps to take.

For example, on RHEL 7 and later to disable THP add or modify the transparent_hugepage=never kernel parameter in /etc/default/grub.

The shared memory log

The shared memory log contains file which are used for communicating logs and counters to log consumers like varnishncsa and varnishlog. In some circumstances, having these files on a physical medium can create performance problems. For this reason it is strongly recommended to mount the /var/lib/varnish/ directory as a tmpfs file system.

If you choose to limit the size of the tmpfs file system, a reasonable size is three times the varnishd parameter vsl_space.

Varnish modules

In 6.0, many Varnish modules (VMODs) are embedded in the varnish-plus package and no extra installation is required.

Modules with third-party package dependencies (libcurl, libmemcached) are available in a separate package called varnish-plus-vmods-extra. This package is not installed by default.

The source code for some of these VMODs are available at https://github.com/varnish/varnish-modules/.