In another article we anticipated what Varnish Cache is and what it is for and now it's time to show an installation guide for Varnish Cache in Ubuntu. This article is focused on how to install Varnish on Ubuntu but in the end I will leave some useful links for installation on CentOS and Debian.
The easiest way to install Varnish on Ubuntu is with the command: sudo apt-get install varnish
sudo apt-get install varnish
This command has the disadvantage that the version of the official Ubuntu repositories may not be the last one , but it is usually sufficient. Even so if you are of what you want to always have the newest, I will show you how to install a more updated version.
If you need a VPS server you can visit the article on cheap VPS server ideal for practice.
If you have an Ubuntu LTS version, you can add the official Varnish repository and install the latest stable version from it. To perform this task we follow the following steps (example valid for Ubuntu 12.04 LTS):
curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add -
echo "deb http://repo.varnish-cache.org/ubuntu/ precise varnish-3.0" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
Eye! I repeat that it is only available for LTS versions of Ubuntu (Ubuntu 12.04 Precise Pangolin) .
The steps are very simple, we execute the following commands:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/varnish
This method is possible thanks to the personal PPA repository of Ondřej Surý , also very famous for keeping Apache and PHP server packages updated. About a week ago, I contacted Ondřej Surý to ask him to upgrade to Varnish version 3.0.4, since version 3.0.3 was still in his repository. A few days later Ondřej Surý sent me an email informing me that it was already updated, so from Vozidea.com we thank you for your great work.
Repositories are also available to install Varnish Cache in:
Debian : https://www.varnish-cache.org/installation/debian CentOS : http://repo.varnish-cache.org/redhat/varnish-3.0/
I've only tried to compile it on Ubuntu 12.10 without much luck, but I leave the link to the official Varnish compilation guide in case anyone needs it:
Compile Varnish from source code : https://www.varnish-cache.org/docs/trunk/installation/install.html
9.1k questions
11.2k answers
86 comments
2 users
Most popular questions within the last 20 days