Skip to content
Follow
Ubuntu Linux

How to Install wkhtmltopdf & wkhtmltoimage on Ubuntu Linux

Richard
Written by
Richard
Mar 27, 2020 Updated Aug 15, 2026 2 min read
How to Display Seconds on Ubuntu Top Menu Clock
How to Display Seconds on Ubuntu Top Menu Clock

wkhtmltopdf and wkhtmltoimage are command-line tools that turn web pages into PDF files or images on Ubuntu Linux. They use the Qt WebKit rendering engine to display web pages without needing a graphical desktop screen.

You can use these tools to automatically generate reports and documents straight from your web apps. Setup takes just a few minutes on Ubuntu systems.

⚡ Quick Answer

Install wkhtmltopdf and wkhtmltoimage on Ubuntu by first updating apt and installing wget and xfonts-75dpi. Then, download the .deb file from the wkhtmltopdf website and install it using dpkg. Finally, run ‘sudo apt -f install’ if needed and verify with ‘wkhtmltopdf –version’.

Install wkhtmltopdf & wkhtmltoimage

You can install wkhtmltopdf and wkhtmltoimage on Ubuntu by downloading the .deb file from the project's website. This download method often provides version 0.12.6 or newer, which is a more recent version than what's in the regular Ubuntu software list. Getting the latest version of wkhtmltopdf and wkhtmltoimage is best for the tools' functionality.

For the latest version, download the .deb file directly from the project’s website.

The current stable version, as of June 11, 2018, is 0.12.5.

Always check the downloads page for the newest release:

Before installing the tools, make sure your system has the required software packages by running:

🐧Bash / Shell
sudo apt update 
sudo apt install wget xfonts-75dpi

Then run the commands below to download and install.

Command Prompt
cd /tmp
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb

If you encounter any issues during installation, try these commands:

🐧Bash / Shell
sudo apt -f install

After installation, you can check if they're working by running these commands:

💻Code
wkhtmltopdf --version

The output should look similar to this:

💻Code
wkhtmltopdf 0.12.5 (with patched qt)

Next, run this command:

💻Code
wkhtmltoimage --version

This will produce output like this:

💻Code
wkhtmltoimage 0.12.5 (with patched qt)

Use wkhtmltopdf & wkhtmltoimage

After you install wkhtmltopdf and wkhtmltoimage on Ubuntu, you'll use them from the command line to turn web pages into PDF files. To use wkhtmltopdf, you'll provide the web address you want to convert and the desired name for your new PDF file.

The syntax below is how to use wkhtmltopdf.

💻Code
wkhtmltopdf  source_file    destination_file.pdf

For example, to convert the example.com webpage into a PDF, run these commands:

💻Code
wkhtmltopdf https://example.com    example.com.pdf

The web content will be generated into a PDF file.

💡Tip
For more details on using the command, check out this page:

You now have a working installation of wkhtmltopdf and wkhtmltoimage ready to generate PDFs and images on Ubuntu. If you find any error, please report it in the comment form below.

Thanks!

You might also like this post:

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Install ClamAV Antivirus on Ubuntu Linux
Ubuntu Linux How to Install ClamAV Antivirus on Ubuntu Linux
How to Install WildFly on Ubuntu Linux
Ubuntu Linux How to Install WildFly on Ubuntu Linux
How to Install Chatwoot on Ubuntu Linux
Ubuntu Linux How to Install Chatwoot on Ubuntu Linux
Working with Sudo and Su Commands in Ubuntu Linux
Ubuntu Linux Working with Sudo and Su Commands in Ubuntu Linux

0 Comments

Leave a Comment

Your email address will not be published. Required fields are marked *