Missing guide/tutorial for setting up Varnish server

Posted November 6, 2019 2.1k views
NginxCachingUbuntu 18.04

Hi there,

I have failed to find a updated/good tutorial/article on setting up Varnish on a Ubuntu server running nginx and with SSL enabled.

Could anyone point me in the right directions or tell me how I could set this up?

I’m running a “normal” setup with Nginx and SSL on Ubuntu 18.04.


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hello, @mattiasf

I believe the existing tutorial we have is for Ubuntu 14.04:

May I ask if there is a specific reason that you want to use Varnish? As you know Varnish does not support SSL termination natively.

Looking forward to hearing from you.


by Mitchell Anicas
Varnish Cache is a caching HTTP reverse proxy, or HTTP accelerator, which reduces the time it takes to serve content to a user. In this tutorial, we will cover how to use Varnish Cache 4.0 to improve the performance of your existing web server. We will also show you a way to add HTTPS support to Varnish, with Nginx performing the SSL termination.
  • Hi, thanks for your answer. The article is for LAMP though, and I have a LEMP setup.

    Also, I’d like to use varnish to speed my up WordPress installation.

    • The tutorial explains how to use Nginx for the SSL termination. I would recommend you to make sure your WordPress site is fully optimized and then go with Varnish or any other cache engine.

      There are a lot of things you can do in order to speed a WordPress site. Most of them are related with the website configuration itself - reduce the number of active plugins you have, reduce the website’s size (front page and etc), reduce the number of heavy database queries and external/3rd party requests for css/js and any other content as well.

      If you’re interested in hosting your WordPress site with us you can check this article and see how you can speed up your asset delivery using our Spaces CDN:

      If you have any questions, feel free to ask!


      by Hanif Jetha
      In this Solutions guide, we'll demonstrate how to offload your WordPress Media Library and other static assets to DigitalOcean Spaces, and deliver these to end users using the DigitalOcean Spaces CDN.