Site icon Sudhanshu's Blog

How to setup Varnish 6 on MAC ?

Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. Today I’m sharing the steps to get started with Varnish installation and configuration. By default it will install the latest Varnish version.

STEP 1 : Press Command+Space and type Terminal and press enter/return key.

STEP 2 : Install varnish

$ brew install varnish

STEP 3 : Above command places the varnishd to /usr/local/bins/varnishd.

$ which varnishd
# What you'd expect:
/usr/local/bin/varnishd
# What you probably get instead:
varnishd not found

STEP 4 : Move varnishd to correct location so that you can run which command.

$ sudo mv /usr/local/sbin/varnishd /usr/local/bin/varnishd

STEP 5 : Now you should be able to run which varnishd


$ which varnishd
/usr/local/bin/varnishd

STEP 6 : You can now start up Varnish by using the varnishd command. This command takes a few parameters which can be useful.


$ sudo varnishd -a 127.0.0.1:8080 -b 127.0.0.1:80 -s file,/tmp,500M
# Output will be
# Debug: Version: varnish-6.3.2 revision 6870fd661a2b42c2e8adad838b5d92a71f27dccd
# Debug: Platform: Darwin,19.2.0,x86_64,-jnone,-sfile,-sdefault,-hcritbit
# Debug: Child (6566) Started

Basic options:
-a <[hostname]:port> : listen address, can be specified multiple times.

-f <filename> : VCL, can be specified multiple times.

-p <parameter=value> : set tunable parameters

-S <secretfile> : authentication secret for management

T <hostname:port> : Management interface

-s <storagetype,options> : where and how to store objects

Exit mobile version