DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
Command Line

How to Install wkhtmltopdf on Ubuntu 24.04 (Noble)

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.

The simplest supported path on Ubuntu 24.04 is Ubuntu’s own Universe package. Enable the repository if necessary, refresh APT, install wkhtmltopdf, and verify the executable:

sudo apt update
sudo apt install wkhtmltopdf
wkhtmltopdf --version
command -v wkhtmltopdf

On a current amd64 Noble system, Ubuntu lists version 0.12.6-2build2. The package is built for Noble and lets APT resolve its Qt, WebKit, printing, SVG, widget and C++ runtime dependencies.

Before you install

  • Use Ubuntu 24.04 (Noble) with an account allowed to run sudo.
  • Have network access to your configured Ubuntu repositories.
  • Expect the Ubuntu build to use unpatched Qt. Some features associated with wkhtmltopdf’s patched-Qt builds, such as particular header/footer or rendering behavior, may not be available.
  • Remember that wkhtmltopdf 0.12.6 is an old Qt/WebKit-based renderer. Installation success does not make it suitable for untrusted HTML.

Install the Ubuntu package

1. Confirm that Universe is enabled

The Noble package is in Ubuntu’s universe component. Most desktop installations already have it enabled. Check your repository configuration and enable Universe if APT cannot find the package:

sudo add-apt-repository universe

If the command reports that Universe is already enabled, continue. On a minimal installation, your administrator may instead need to add the component to the appropriate Noble entries in /etc/apt/sources.list.d/ubuntu.sources, then run sudo apt update.

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.

2. Refresh package metadata

sudo apt update

This downloads the current package indexes. If it completes with repository errors, fix those errors before installing; an old or incomplete index can produce misleading “unable to locate package” messages.

3. Install wkhtmltopdf with APT

sudo apt install wkhtmltopdf

Accept the confirmation prompt. APT is preferable to installing a standalone .deb with dpkg because APT obtains the package’s dependencies automatically. Noble’s package pulls the Qt 5 core, GUI, network, print-support, SVG, WebKit and widgets libraries, plus the standard C++ runtime required by the executable.

Verify the installation

Check the version

wkhtmltopdf --version

A repository installation on amd64 Noble should report wkhtmltopdf 0.12.6 (the Ubuntu package revision is 0.12.6-2build2). The exact output can include build details; the important checks are that the command runs and that it is the expected Ubuntu package.

Check which executable is being used

command -v wkhtmltopdf
ls -l "$(command -v wkhtmltopdf)"
dpkg -S "$(command -v wkhtmltopdf)"

command -v shows the path selected through PATH. dpkg -S should associate that path with the wkhtmltopdf package. If a different copy in /usr/local/bin appears first, you may be running an older manually installed build instead of the Noble package.

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

Run a controlled smoke test

Use a page you control or a simple public test page:

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

The command should exit successfully and create a readable PDF. This confirms basic invocation only; it does not test every CSS feature, JavaScript workflow, authentication flow or security property of your production pages.

Understand Ubuntu’s build

Ubuntu’s Noble package uses unpatched Qt. Upstream wkhtmltopdf release packages use a patched Qt build to provide behavior that distribution maintainers may omit. Therefore, a command that works with an upstream binary can render differently with Ubuntu’s package, especially when it relies on patched-Qt options. Consult the Noble package documentation and the upstream documentation for the exact option you need rather than assuming that every upstream switch has identical behavior.

For most Ubuntu 24.04 systems, start with the Noble package because it is built and dependency-matched for that release. Upstream’s download matrix lists Jammy (22.04), not Noble. Upstream suggests trying an older LTS when a release is absent, but that is not a compatibility guarantee for every Noble host. If you choose an older-distribution upstream build, validate its libraries and PDF output in a disposable or otherwise controlled environment before deploying it.

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

Using wkhtmltopdf in scripts

Basic conversion

wkhtmltopdf https://example.com report.pdf

Useful operational patterns

  • Use an absolute output path when a service runs from an unpredictable working directory.
  • Check the process exit status in automation: a nonzero status means the conversion should be treated as failed.
  • Capture stderr in logs; network, TLS, missing-resource and JavaScript warnings are commonly reported there.
  • Set an explicit timeout in the supervising service. wkhtmltopdf itself can wait on slow pages, and a hung conversion can otherwise consume a worker indefinitely.
  • Run the converter under a dedicated, least-privileged account with a restricted filesystem and network policy.

Security: do not render untrusted HTML

The wkhtmltopdf project warns: “Do not use wkhtmltopdf with any untrusted HTML – be sure to sanitize any user-supplied HTML/JS, otherwise it can lead to complete takeover of the server it is running on!” A successful PDF is a functionality result, not a security assurance.

Do not pass customer-supplied HTML, arbitrary URLs or unsanitized JavaScript directly to this legacy renderer. If your application accepts templates, sanitize and constrain them, isolate the conversion process, restrict outbound requests, remove credentials from its environment, and give the worker only the filesystem permissions it needs. Treat redirects, embedded resources and JavaScript as attack surface.

The project’s status guidance also points out that wkhtmltopdf depends on old Qt/WebKit technology. For controlled HTML reports, it suggests considering WeasyPrint or Prince; for pages that depend on modern dynamic JavaScript, it suggests Puppeteer. Those are upstream suggestions, not a claim that one alternative will reproduce your existing output without migration work.

Troubleshooting

“Unable to locate package wkhtmltopdf”

  • Run sudo apt update and inspect any errors.
  • Confirm that the system is Ubuntu 24.04 with cat /etc/os-release.
  • Enable Universe with sudo add-apt-repository universe, then update again.
  • Check that your configured repositories point to Noble rather than an end-of-life or mixed release.

APT reports broken or unmet dependencies

Do not force-install a random .deb. Finish pending package configuration and ask APT to repair the dependency state:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo dpkg --configure -a
sudo apt --fix-broken install
sudo apt update
sudo apt install wkhtmltopdf

If the host has mixed Ubuntu releases or third-party Qt packages, correct the repository mismatch first.

The command is not found after installation

Locate the package’s files and refresh the shell’s command lookup:

dpkg -L wkhtmltopdf | grep '/wkhtmltopdf$'
hash -r
command -v wkhtmltopdf

Open a new shell if your environment has an unusual PATH.

The PDF is blank, incomplete or missing images

  • Test the same URL in a controlled browser and inspect whether it requires modern JavaScript that the old WebKit engine cannot execute.
  • Try a local, self-contained HTML file to separate renderer limitations from network or TLS problems.
  • Check stderr for blocked resources, redirects, certificate errors and timeouts.
  • Do not assume that installing an upstream binary will fix the issue; compare the required feature with the patched-Qt distinction and validate any alternate build on Noble.

Headers, footers or other options behave differently

This is consistent with the Ubuntu build’s unpatched Qt. Read the installed Noble manpage with man wkhtmltopdf and verify the option against upstream documentation. If a patched-Qt-only behavior is mandatory, isolate and test a compatible alternative rather than replacing the system package blindly.

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

Conversion hangs

Look for a page waiting on JavaScript, an unreachable resource, authentication, a redirect loop or a never-ending network request. Add monitoring around the child process, enforce a supervisor timeout, and test with a minimal controlled page. A timeout should terminate the worker and record the URL without retrying indefinitely.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When an API is a better fit than a local renderer

If your requirement is simply to obtain a clean screenshot or PDF of a URL, a hosted service avoids installing Qt/WebKit and maintaining a conversion worker. ScreenshotNeo is the first option to try: it removes consent banners, newsletter popups and chat widgets before capture, bills only clean shots, and has the lowest paid plan listed here.

Or skip the browser setup:

One GET request returns an image or PDF. The following cURL example targets a controlled page; replace the URL and set your key:

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

Python:

import requests

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

Node.js:

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

See the ScreenshotNeo documentation for request parameters and response details. Its response headers identify the page verdict and whether it was billed: bot checks or CAPTCHAs, blank pages, failed loads, timeouts and cache hits cost nothing. It also provides an MCP server with take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients. Every plan includes features such as full-page capture, CSS-selector element capture, device and retina settings, PDF controls, custom CSS/JavaScript, cookies and headers, blocking rules, caching, signed links, asynchronous jobs, bulk capture and a usage API.

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

The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; yearly billing gives two months free. Sign up for the free ScreenshotNeo plan to try it without a card.

Choosing the right path

Need Recommended path Reason
Standard PDF conversion on Ubuntu 24.04 Ubuntu Universe package Native Noble packaging and dependency resolution through APT.
A feature that specifically requires patched Qt Controlled evaluation of an upstream build Ubuntu’s package uses unpatched Qt; upstream does not list a Noble build.
Modern JavaScript-heavy pages Evaluate a current browser-based tool wkhtmltopdf uses legacy Qt/WebKit technology.
Clean screenshots or PDFs without local browser setup ScreenshotNeo Hosted capture, cleanup of common overlays, verdict headers and an MCP server.

Frequently Asked Questions

What version does Ubuntu 24.04 provide?

Ubuntu Noble’s amd64 Universe package is version 0.12.6-2build2, corresponding to the wkhtmltopdf 0.12.6 release line.

Can I install a Jammy wkhtmltopdf package on Noble?

It may be possible, but upstream lists Jammy rather than Noble and does not guarantee compatibility. Test library dependencies and output in a disposable or controlled environment before production use.

Does installing wkhtmltopdf make arbitrary HTML safe?

No. The project explicitly warns against using it with untrusted HTML or JavaScript. Sanitize input and isolate the conversion worker.

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

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.

Leave a Reply

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

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

Read next

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.