{"id":1397,"date":"2020-08-21T04:55:22","date_gmt":"2020-08-21T04:55:22","guid":{"rendered":"http:\/\/ubiq.co\/tech-blog\/?p=1397"},"modified":"2025-08-19T06:15:48","modified_gmt":"2025-08-19T06:15:48","slug":"install-varnish-ubuntu","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/","title":{"rendered":"How to Install Varnish in Ubuntu"},"content":{"rendered":"<p>Varnish is a high performance caching module commonly used for Apache web server. Here&#8217;s how to install Varnish in Ubuntu. In this article we will see how to setup varnish, how to change port on varnish, how to configure varnish and how to restart varnish. You can also use these steps to install Varnish in CentOS, Debian, Redhat and other Linux systems.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#How_to_Install_Varnish_in_Ubuntu\" >How to Install Varnish in Ubuntu<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#1_Install_Apache\" >1. Install Apache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#2_Test_Apache_installation\" >2. Test Apache installation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#3_Install_Varnish_HTTP_Cache\" >3. Install Varnish HTTP Cache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#4_Change_ports_for_Apache\" >4. Change ports for Apache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#5_Change_Varnish_Port_to_80\" >5. Change Varnish Port to 80<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#6_Restart_Apache_Varnish_and_Systemd_Daemon\" >6. Restart Apache, Varnish and Systemd Daemon<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#7_Test_the_Varnish_Configuration\" >7. Test the Varnish Configuration<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Install_Varnish_in_Ubuntu\"><\/span>How to Install Varnish in Ubuntu<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Here are the steps to install Varnish in Ubuntu.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"1_Install_Apache\"><\/span>1. Install Apache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you have already installed Apache web server, you can skip to step 3.<\/p>\n<p>Open terminal, and run the following command to update Ubuntu modules.<\/p>\n<pre>$ sudo apt-get update\n<\/pre>\n<p>Then run the following command to install Apache on Ubuntu.<\/p>\n<pre>$ sudo apt-get install apache2\n<\/pre>\n<p>Enter Y if asked for confirmation.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"2_Test_Apache_installation\"><\/span>2. Test Apache installation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Open web browser and type the following in address bar<\/p>\n<pre>http:\/\/127.0.0.1\n<\/pre>\n<p>You will see the default Apache web page with message &#8220;It works!&#8221;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Install_Varnish_HTTP_Cache\"><\/span>3. Install Varnish HTTP Cache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Run the following command to install Varnish in Ubuntu.<\/p>\n<pre>$ sudo apt-get install varnish\n<\/pre>\n<p>Enter Y when asked for confirmation.<\/p>\n<p>Bonus Read : <a href=\"http:\/\/ubiq.co\/tech-blog\/fix-503-service-temporarily-unavailable-error-apache\/\">How to Fix 503 Service Temporarily Available Error<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_Change_ports_for_Apache\"><\/span>4. Change ports for Apache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>By default, Apache runs on port 80. We need to make Varnish run on port 80 and Apache run on another port (e.g 8080) to install Varnish in Ubuntu.<\/p>\n<p>So open Apache&#8217;s port configuration file using the following command<\/p>\n<pre>$ sudo nano \/etc\/apache2\/ports.conf<\/pre>\n<p>Change the line <strong>Listen 80<\/strong> to <strong>Listen 8080<\/strong> so it will look as shown below<\/p>\n<pre><strong>Listen 8080<\/strong>\n&lt;IfModule ssl_module&gt;\n     Listen 443\n&lt;\/IfModule&gt;\n&lt;IfModule mod_gnutls.c&gt;\n     Listen 443\n&lt;\/IfModule&gt;\n<\/pre>\n<p>Save and exit the file.<\/p>\n<p>We also need to change listening port for Apache virtual hosts. Open Apache&#8217;s default virtual host file<\/p>\n<pre>$ sudo nano \/etc\/apache2\/sites-enabled\/000-default.conf\n<\/pre>\n<p>Change &lt;VirtualHost *:<strong>80<\/strong>&gt; to &lt;VirtualHost *:<strong>8080<\/strong>&gt; to make it as shown below.<\/p>\n<pre>&lt;VirtualHost *:<strong>8080<\/strong>&gt;\n   ...\n&lt;\/VirtualHost&gt;\n<\/pre>\n<p>Save and exit the file.<\/p>\n<p>Restart Apache web server to apply changes and make it run on port 8080.<\/p>\n<pre>$ sudo service apache2 restart\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"5_Change_Varnish_Port_to_80\"><\/span>5. Change Varnish Port to 80<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Next we configure Varnish to listen to port 80 and forward requests to port 8080. For that, open Varnish configuration file<\/p>\n<pre>$ sudo nano \/etc\/default\/varnish\n<\/pre>\n<p>Look for DAEMON_OPTS directive and change the listening port from 6081 to 80<\/p>\n<pre>DAEMON_OPTS=\"-a :<strong>80<\/strong> \\\n             -T localhost:6082 \\\n             -f \/etc\/varnish\/default.vcl \\\n             -S \/etc\/varnish\/secret \\\n             -s malloc,256m\"\n<\/pre>\n<p>Save and close the file<\/p>\n<p>Next, open <b>\/etc\/varnish\/default.vcl<\/b> using text editor.<\/p>\n<pre>$ sudo nano \/etc\/varnish\/default.vcl\n<\/pre>\n<p>Its contents will look something like the following. Make sure the port value is 8080 as shown in <strong>bold<\/strong><\/p>\n<pre># Default backend definition. Set this to point to your content server.\nbackend default {\n     .host = \"127.0.0.1\";\n     .port = \"<strong>8080<\/strong>\";\n}\n<\/pre>\n<p>Lastly, we need to edit the port number in <b><i>\/lib\/systemd\/system\/varnish.service<\/i><\/b><strong>. <\/strong>Open it in a text editor<\/p>\n<pre>$ sudo nano \/lib\/systemd\/system\/varnish.service\n<\/pre>\n<p>Change the port from 6081 to 80 as show in <strong>bold<\/strong><\/p>\n<pre>[Unit]\nDescription=Varnish HTTP accelerator\nDocumentation=https:\/\/www.varnish-cache.org\/docs\/4.1\/ man:varnishd\n[Service]\nType=simple\nLimitNOFILE=131072\nLimitMEMLOCK=82000\nExecStart=\/usr\/sbin\/varnishd -j unix,user=vcache -F -a :<strong>80<\/strong> -T localhost:6082 -f$\nExecReload=\/usr\/share\/varnish\/varnishreload\nProtectSystem=full\nProtectHome=true\nPrivateTmp=true\nPrivateDevices=true\n[Install]\nWantedBy=multi-user.target\n<\/pre>\n<p>Bonus Read : <a href=\"http:\/\/ubiq.co\/tech-blog\/fix-500-internal-server-error-apache\/\">How to Fix 500 Internal Server Error in Apache<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"6_Restart_Apache_Varnish_and_Systemd_Daemon\"><\/span>6. Restart Apache, Varnish and Systemd Daemon<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Open terminal and run the following commands to restart Apache, Varnish and Systemd Daemon. This will apply all changes.<\/p>\n<pre>$ sudo systemctl restart apache2\n$ sudo systemctl daemon-reload\n$ sudo systemctl restart varnish\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"7_Test_the_Varnish_Configuration\"><\/span>7. Test the Varnish Configuration<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Run the following curl command to get the output from our web server<\/p>\n<pre>$ curl -I <em>server_IP<\/em>\n<\/pre>\n<p>You will see response similar to following. The response header parts in <strong>bold<\/strong> indicates that Varnish cache is working.<\/p>\n<pre>HTTP\/1.1 200 OK\nDate: Thu, 05 Jul 2018 20:56:11 GMT\nServer: Apache\/2.4.29 (Ubuntu)\nLast-Modified: Fri, 29 Jun 2018 07:19:34 GMT\nVary: Accept-Encoding\nContent-Type: text\/html\n<strong>X-Varnish: 7<\/strong>\nAge: 0\n<strong>Via: 1.1 varnish (Varnish\/5.2)<\/strong>\nETag: W\/\"2aa6-56fc2ab77545d-gzip\"\nAccept-Ranges: bytes\nConnection: keep-alive\n<\/pre>\n<p>That&#8217;s it! You have installed Varnish cache in Ubuntu.<\/p>\n<p><a href=\"http:\/\/ubiq.co\/\">Ubiq<\/a>\u00a0makes it easy to visualize data in minutes, and monitor in real-time dashboards.\u00a0<a href=\"http:\/\/ubiq.co\/accounts\/register\">Try it<\/a>\u00a0Today!<\/p>\n<p>Also read:<br \/>\n<a href=\"https:\/\/ubiq.co\/tech-blog\/apache-load-balancer-configuration\/\">How to Configure Apache Load Balancer<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Varnish is a high-performance cache module for Apache web server. Here&#8217;s how to install varnish in Ubuntu, CentOS, Debian, Redhat and other Linux systems.<\/p>\n","protected":false},"author":1,"featured_media":1403,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[120,118,119],"class_list":["post-1397","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","tag-configure-varnish","tag-install-varnish","tag-setup-varnish"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install Varnish in Ubuntu - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Varnish is a high-performance cache module for Apache web server. Here&#039;s how to install varnish in Ubuntu, CentOS, Debian, Redhat and other Linux systems.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Varnish in Ubuntu - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Varnish is a high-performance cache module for Apache web server. Here&#039;s how to install varnish in Ubuntu, CentOS, Debian, Redhat and other Linux systems.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-21T04:55:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-19T06:15:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/08\/how-to-install-varnish-cache-ubuntu.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Install Varnish in Ubuntu\",\"datePublished\":\"2020-08-21T04:55:22+00:00\",\"dateModified\":\"2025-08-19T06:15:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/\"},\"wordCount\":487,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/how-to-install-varnish-cache-ubuntu.jpg?fit=1200%2C600&ssl=1\",\"keywords\":[\"configure varnish\",\"install varnish\",\"setup varnish\"],\"articleSection\":[\"Apache\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/\",\"name\":\"How to Install Varnish in Ubuntu - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/how-to-install-varnish-cache-ubuntu.jpg?fit=1200%2C600&ssl=1\",\"datePublished\":\"2020-08-21T04:55:22+00:00\",\"dateModified\":\"2025-08-19T06:15:48+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Varnish is a high-performance cache module for Apache web server. Here's how to install varnish in Ubuntu, CentOS, Debian, Redhat and other Linux systems.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/how-to-install-varnish-cache-ubuntu.jpg?fit=1200%2C600&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/how-to-install-varnish-cache-ubuntu.jpg?fit=1200%2C600&ssl=1\",\"width\":1200,\"height\":600,\"caption\":\"how to install varnish cache in ubuntu\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/install-varnish-ubuntu\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Varnish in Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Varnish in Ubuntu - Ubiq BI","description":"Varnish is a high-performance cache module for Apache web server. Here's how to install varnish in Ubuntu, CentOS, Debian, Redhat and other Linux systems.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Varnish in Ubuntu - Ubiq BI","og_description":"Varnish is a high-performance cache module for Apache web server. Here's how to install varnish in Ubuntu, CentOS, Debian, Redhat and other Linux systems.","og_url":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-08-21T04:55:22+00:00","article_modified_time":"2025-08-19T06:15:48+00:00","og_image":[{"width":1200,"height":600,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/08\/how-to-install-varnish-cache-ubuntu.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Install Varnish in Ubuntu","datePublished":"2020-08-21T04:55:22+00:00","dateModified":"2025-08-19T06:15:48+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/"},"wordCount":487,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/08\/how-to-install-varnish-cache-ubuntu.jpg?fit=1200%2C600&ssl=1","keywords":["configure varnish","install varnish","setup varnish"],"articleSection":["Apache"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/","url":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/","name":"How to Install Varnish in Ubuntu - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/08\/how-to-install-varnish-cache-ubuntu.jpg?fit=1200%2C600&ssl=1","datePublished":"2020-08-21T04:55:22+00:00","dateModified":"2025-08-19T06:15:48+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Varnish is a high-performance cache module for Apache web server. Here's how to install varnish in Ubuntu, CentOS, Debian, Redhat and other Linux systems.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/08\/how-to-install-varnish-cache-ubuntu.jpg?fit=1200%2C600&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/08\/how-to-install-varnish-cache-ubuntu.jpg?fit=1200%2C600&ssl=1","width":1200,"height":600,"caption":"how to install varnish cache in ubuntu"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Install Varnish in Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/08\/how-to-install-varnish-cache-ubuntu.jpg?fit=1200%2C600&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-mx","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=1397"}],"version-history":[{"count":12,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1397\/revisions"}],"predecessor-version":[{"id":9215,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1397\/revisions\/9215"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/1403"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=1397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=1397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=1397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}