“wkhtmltopdf and wkhtmltoimage are open source (LGPL) command line tools to render HTML into PDF and various image formats using the QT Webkit rendering engine. These run entirely “headless” and do not require a display or display service.” Source:

There are two options:

  • standard: fewer features, requires X (and if your ClearOS is virtualized, it perhaps won't work)
  • patched QT: more features, doesn't require X (headless)

How to install wkhtmltopdf patched QT on ClearOS

  • Get the URL of the last stable version from the wkhtmltopdf download page
  • Attempt to install
    rpm -Uvh wkhtmltox-
    • The system will likely report missing dependencies. Just add them with the following (and try again to install)
      yum --enablerepo=clearos-core install PUTNAMEOFDEPENDENCYHERE
  • To test
    wkhtmltopdf wkhtmltopdf-test.pdf
  • To know what “WebKit path” to provide to your web app (ex.: Tiki)
    which wkhtmltopdf

    which will report something like:


How to install wkhtmltopdf on ClearOS

Experimental. Unless you know what you are doing, use the patched QT option above

The qtwebkit version is useful to check when there is a bug:

  • CentOS / ClearOS 6: 2.1.1
  • CentOS / ClearOS 7: 2.3.3

1.- Login to your ClearOS via SSH.

2.- Make sure epel-release in an active repo

rpm -ivh

3.- Activate ClearOS core repo

# In the marketplace (, activate the "Software Repository" app
# click "Detailed view"
# Click "Toggle" on the clearos-core line

4.- Enable repository by running rpm accordingly:

For 32 bits:

rpm -ivh

For 64 bits:

rpm -ivh

5.- Type:

yum install wkhtmltopdf

once yum finishes the dependency Resolution it will show you a summary and will ask you to confirm.

6.- Confirm with y, yum will download and install the required rpms and will inform o the completion.

7.-Install the Xvfb (X Virtual Frame Buffer) type:

yum install xorg-x11-server-Xvfb

and confirm installation with “y” and wait for completion.

8.- To use, include within the xvfb execution: Example:

xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltopdf google.pdf__

Output is visible with any reader application.

9- Make a to simplify Create a file /usr/local/bin/ containing the following“

xvfb-run -a -s "-screen 0 1024x768x24" wkhtmltopdf "$@"

Using the command tiki.pdf

To test:


as WebKit path in the tiki administration page

Related links

content/en_us/kb_wkhtmltopdf.txt · Last modified: 2015/06/17 14:01 (external edit)