Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For most Ubuntu 24.04 systems, install wkhtmltopdf from Ubuntu’s Universe repository: run sudo apt update, then sudo apt install wkhtmltopdf. Verify the executable with wkhtmltopdf --version and command -v wkhtmltopdf. Ubuntu Noble provides version 0.12.6-2build2 for amd64.

Install the Ubuntu 24.04 package

Ubuntu 24.04, also called Noble, includes wkhtmltopdf in the Universe component. The repository package is the safest starting point because APT resolves the required libraries and keeps the installation integrated with Ubuntu’s package system.

  1. Refresh package metadata

    Open a terminal and run:

    sudo apt update

    Enter your account password when prompted. This updates the local index; it does not upgrade every package.

  2. Install wkhtmltopdf

    sudo apt install wkhtmltopdf

    Confirm the prompt with Y. On a standard amd64 Noble installation, APT selects version 0.12.6-2build2 and installs its dependencies, including Qt 5 components, WebKit, SVG, print-support, widgets and the standard C++ runtime.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Verify the executable and version

    wkhtmltopdf --version
    command -v wkhtmltopdf

    The first command should print the installed release. The second should return a path such as /usr/bin/wkhtmltopdf. If both commands work, the program is available on your shell’s PATH.

Run a controlled conversion test

A version check proves that the binary is installed, but not that it can render a page in your environment. Use a controlled, publicly reachable page rather than user-supplied HTML:

wkhtmltopdf https://example.com /tmp/example.pdf
ls -lh /tmp/example.pdf

Open /tmp/example.pdf with your normal PDF viewer. This confirms basic invocation and output creation. It does not prove that every JavaScript framework, font, image, authentication flow or CSS feature will render correctly.

Convert a local HTML file

printf '%sn' '<!doctype html><html><body><h1>Test</h1></body></html>' > /tmp/test.html
wkhtmltopdf /tmp/test.html /tmp/test.pdf

For scripts that generate reports, use an absolute output path and check the process exit status:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
if wkhtmltopdf /path/to/report.html /path/to/report.pdf; then
echo "PDF created"
else
echo "Conversion failed" >&2
exit 1
fi

What Ubuntu’s build means for rendering

The Noble package is built with unpatched Qt. That distinction matters because upstream’s patched-Qt builds provide behavior and options that distribution builds may not, including some header, footer and rendering features. Read the installed manpage for the exact options available in your package:

man wkhtmltopdf

You can also list command-line help with:

wkhtmltopdf --extended-help

Do not assume that an option documented for an upstream patched build behaves identically in Ubuntu’s package. Test the specific header, footer, pagination or JavaScript requirement in the same Noble environment where the application will run.

Ubuntu package or upstream release?

Choice When it makes sense Important limitation
Ubuntu Noble package Recommended for ordinary server, workstation and CI installations; it is packaged for Ubuntu 24.04 and its dependencies are handled by APT. Uses unpatched Qt, so some upstream-only rendering features are unavailable.
Upstream release package Consider only when a required feature depends on patched Qt and you have tested the exact build. Upstream’s download matrix lists Jammy (22.04), not Noble. A Jammy package is an older-distribution build, not a guarantee of compatibility on every Noble host.

The upstream stable series is 0.12.6, released June 11, 2020. If you investigate an upstream package, obtain it from the project’s own download page, validate library dependencies, and test in a disposable or tightly controlled environment. Do not present an unofficial script or third-party package as an official Ubuntu installation method. Avoid replacing the working Noble package merely because another build reports a different compile-time label.

Why apt is preferable to dpkg

dpkg can install a local .deb, but it does not automatically retrieve missing dependencies. APT is designed to resolve and configure the dependency chain. If you deliberately install a local package, you may need a follow-up command such as sudo apt -f install, and the resulting binary may still be unsuitable for Noble if it was built for another Ubuntu release.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Security limitations you should take seriously

wkhtmltopdf uses an old Qt/WebKit rendering stack. The project explicitly warns not to process untrusted HTML and says that unsanitized user-supplied HTML or JavaScript can lead to complete server takeover. Treat every conversion as execution of potentially dangerous content.

Safer operating practices

  • Render only controlled templates and trusted URLs.
  • Sanitize any data inserted into HTML, including attributes, URLs and inline scripts.
  • Run the converter as a dedicated unprivileged user, never as root.
  • Use a container, VM or other isolation boundary for workloads that may contain attacker-controlled content.
  • Restrict outbound network access when the document does not need remote resources.
  • Apply filesystem permissions so the process can write only to its intended temporary and output directories.
  • Set execution timeouts and terminate stuck conversions from the calling application.

A successful PDF is a functionality check, not a security assurance. Do not send arbitrary customer HTML, uploaded files or public URLs through this legacy renderer without an isolation and sanitization design.

Common installation and conversion problems

“Unable to locate package wkhtmltopdf”

The Universe component may be disabled, or the package lists may be stale. First refresh metadata:

sudo apt update
apt-cache policy wkhtmltopdf

If no candidate appears, confirm that the Ubuntu 24.04 repositories configured for the machine include Universe, then run sudo apt update again. Avoid downloading an unrelated distribution package until the repository configuration is understood.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

APT reports held or broken dependencies

Finish interrupted package configuration and let APT repair dependency state:

sudo dpkg --configure -a
sudo apt --fix-broken install
sudo apt install wkhtmltopdf

Review proposed removals before accepting them, particularly on production systems.

The command is installed but not found

Check the package and executable paths:

dpkg -L wkhtmltopdf | grep '/wkhtmltopdf$'
command -v wkhtmltopdf
echo "$PATH"

Invoke the returned absolute path temporarily, then correct the service account’s PATH if the binary is outside it. A shell PATH and a systemd service PATH are not necessarily the same.

“Unknown long argument” or missing header/footer behavior

You may be using documentation for an upstream patched-Qt build while running Ubuntu’s unpatched package. Compare wkhtmltopdf --extended-help with the command you are using and remove unsupported switches. If the feature is mandatory, evaluate an upstream build only after compatibility testing on Noble.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Blank pages, missing images or incomplete JavaScript

These symptoms can result from the old WebKit engine, blocked network access, authentication requirements, slow resources or JavaScript that depends on a modern browser API. Test the same URL with a controlled page, inspect the converter’s stderr output, and add only the documented wait or JavaScript-related options that your installed build supports. A modern browser automation tool may be more appropriate for heavily dynamic sites.

Fonts or non-Latin text render incorrectly

Install the fonts required by the document, rebuild any font caches used by the host, and test under the same user account as the service. Missing fonts are an environment problem; changing to an untested binary may introduce different dependency failures.

The process hangs

Remote resources, scripts or network connections can prevent completion. Enforce a timeout in the caller, limit network access, and capture stderr. Do not solve a hang by running the converter with elevated privileges.

When wkhtmltopdf is the wrong tool

The project’s status guidance notes that wkhtmltopdf depends on old Qt/WebKit technology. For controlled HTML reports, investigate a maintained renderer such as WeasyPrint or Prince; for sites that require dynamic JavaScript, investigate Puppeteer. Those are alternatives to evaluate for your requirements, not guarantees that every document will match wkhtmltopdf’s output. Compare pagination, CSS support, fonts, licensing, isolation and operational maintenance before migrating.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is simply to obtain a clean screenshot or PDF from a URL, ScreenshotNeo provides a hosted screenshot API and MCP server instead of requiring you to install and maintain a browser-rendering stack.

One GET request returns an image or PDF. The following cURL example captures Stripe as a WebP file:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for all parameters and response headers. The same request in Python is:

import requests

r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

In Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the page verdict and billing result in X-Page-Verdict and X-Billed headers. Its MCP server exposes take_screenshot, get_page_info and capture_pdf tools to Claude, Cursor and other MCP clients.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Every plan includes features such as full-page capture with lazy-image loading, CSS-selector element capture, dark mode, device presets, retina scale, PDF page ranges and margins, custom CSS and JavaScript, click-before-capture actions, selector hiding, waits, request blocking, custom headers and cookies, timezone and geolocation, transparent backgrounds, resizing, configurable caching, signed image links, asynchronous webhooks, bulk capture for up to 100 URLs per call, usage reporting and an OpenAPI specification.

The Free plan includes 1,000 screenshots each month with no card. Paid plans start at $5 for 3,000 shots; annual billing provides two months free. Create a free ScreenshotNeo account to try it without a card.

Frequently Asked Questions

Which wkhtmltopdf version does Ubuntu 24.04 provide?

Ubuntu Noble’s amd64 Universe package is version 0.12.6-2build2.

Can I install the Jammy package on Ubuntu 24.04?

It may be possible in some environments, but upstream lists Jammy rather than Noble and does not guarantee compatibility. Use the Noble package first and validate any older-distribution build in isolation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does installing wkhtmltopdf make arbitrary HTML safe to render?

No. The project warns that unsanitized untrusted HTML or JavaScript can compromise the server. Use trusted input, sanitization and process isolation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.