Install wkhtmltopdf 0.12.1 on Ubuntu Server – How to

aptsoftware installationwkhtmltopdf

I am trying to install current stable version 0.12.1, but it only installs 0.9.9.
Any chance to install latest version with apt-get install? It seems that 0.9.9 is very old 🙁

Best Answer

In Ubuntu 16.04 and later wkhtmltopdf 0.12.2+ can be installed from the default Ubuntu repositories.

In Ubuntu 14.04, open the terminal and type:

sudo add-apt-repository ppa:ecometrica/servers
sudo apt-get update
sudo apt-get install wkhtmltopdf  

In Ubuntu 12.04, open the terminal and type:

sudo add-apt-repository ppa:pov/wkhtmltopdf
sudo apt-get update
sudo apt-get install wkhtmltopdf 

and one step after this is to reboot the server or else you will get the error: wkhtmltopdf: cannot connect to X server .