How to install WKHTMLTOX on Linux 9

Share on Social Media

In this Linux Tutorial, you will learn how to install WKHTMLTOX on Linux 9 or other Red Hat based Linux distributions. #centlinux #linux


WKHTMLTOX is a combination of wkhtmltopdf and wkhtmltoimage, that are open source (LGPLv3) 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.

Video to install WKHTMLTOX on Linux:

YouTube player

Environment Specification:

We are using a minimal Rocky Linux 9 operating system with following specifications.

  • CPU – 3.4 Ghz (2 cores)
  • Memory – 2 GB
  • Storage – 20 GB
  • Operating System – Rocky Linux release 9.1 (Blue Onyx)
  • Hostname –
  • IP Address –

Prepare your Linux Server:

Login as root user on your Rocky Linux server, with the help of a ssh client.

Update software packages in your Linux operating system by using dnf package manager.

# dnf update -y

Occasionally, above command also updates your Linux Kernel. If it happens, then you should reboot your Linux operating system before moving forward in this Linux tutorial.

# reboot

After reboot, check the Linux operating system and Kernel versions.

# cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.1 (Blue Onyx)"
ID_LIKE="rhel centos fedora"
PRETTY_NAME="Rocky Linux 9.1 (Blue Onyx)"

# uname -r

WKHTMLTOX is not available in standard yum repositories. But you can download the latest version of WKHTMLTOX from their official website.

To download WKHTMLTOX rpm you may need wget command. Therefore, install it now with the help of dnf command.

# dnf install -y wget

Install WKHTMLTOX on Linux:

Now, use wget command to download WKHTMLTOX rpm. You can either use the following commands to download WKHTMLTOX or get the URL of latest version from their website.

# cd /tmp
# wget
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16198412 (15M) [application/octet-stream]
Saving to: ‘wkhtmltox-’

wkhtmltox- 100%[===================>]  15.45M   515KB/s    in 20s

2023-03-27 12:08:50 (801 KB/s) - ‘wkhtmltox-’ saved [16198412/16198412]

Execute following command to install WKHTMLTOX on your Rocky Linux server.

# dnf localinstall -y wkhtmltox-

After installation, check the versions of wkhtmltopdf and wkhtmltoimage commands.

# wkhtmltopdf --version
wkhtmltopdf (with patched qt)

# wkhtmltoimage --version
wkhtmltoimage (with patched qt)

WKHTMLTOX has been installed successfully.

You can use –help switch as follows to get help on wkhtmltopdf and wkhtmltoimage commands.

# wkhtmltopdf --help
# wkhtmltoimage --help


In this Linux tutorial, you have learned how to install WKHTMLTOX on Linux 9 or other Red Hat based Linux distributions.