Install the wkhtmltopdf Ubuntu package:
sudo apt update
sudo apt install wkhtmltopdf
wkhtmltoimage --version
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Ubuntu ships the wkhtmltoimage executable inside the wkhtmltopdf package; there is usually no separate package named wkhtmltoimage. The commands above are the simplest supported path on Ubuntu 22.04 (Jammy) and 24.04 (Noble).
What gets installed
wkhtmltoimage is the HTML-to-image command-line converter from the wkhtmltopdf project. Its basic syntax is:
wkhtmltoimage [OPTIONS]... <input file or URL> <output file>
The Ubuntu archive calls the package wkhtmltopdf because it contains both wkhtmltopdf and wkhtmltoimage. Jammy lists package version 0.12.6-2; Noble lists 0.12.6-2build2 (Ubuntu package listings accessed September 29, 2026). The upstream project identifies 0.12.6, released June 11, 2020, as its stable series.
Before you install
Identify Ubuntu and CPU architecture
Check the release and architecture before choosing an archive or manually downloaded package:
#1 Best Overall
lsb_release -a
dpkg --print-architecture
uname -m
The archive route is preferable when your release is represented in Ubuntu’s repositories. Package versions and dependencies can differ on interim releases, architectures, or later archive updates, so inspect your own metadata rather than copying a package filename from another machine.
Choose a display environment for servers
Ubuntu’s Noble package depends on Qt, WebKit, font, and related system libraries. Ubuntu also recommends an X server or xvfb (a virtual framebuffer) for headless use. A desktop installation normally already has a display session; a minimal cloud image may need a virtual display and a complete font configuration.
Install from Ubuntu’s repository
- Refresh package metadata.
sudo apt update - Install the package that provides both converters.
sudo apt install wkhtmltopdfReview the dependency list and confirm the prompt. Apt resolves the libraries appropriate to your Ubuntu release.
- Verify the executable and version.
command -v wkhtmltoimage wkhtmltoimage --versioncommand -vshould print the executable path, and the version command should report the installed wkhtmltoimage build.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.
Inspect the package without installing it
To see which version your configured repositories offer and which files the package contains:
apt-cache policy wkhtmltopdf
apt-file list wkhtmltopdf 2>/dev/null | grep -E '/wkhtmlto(image|pdf)$'
apt-file is optional and may not be installed. If it is unavailable, use:
Rank #2
dpkg -L wkhtmltopdf | grep -E '/wkhtmlto(image|pdf)$'
Confirm that conversion works
Render a local HTML file
Create a small document with an absolute output path so that a working directory mistake cannot hide the result:
cat > /tmp/sample.html <<'EOF'
<!doctype html>
<html>
<head><meta charset="utf-8"><title>wkhtmltoimage test</title></head>
<body><h1>Ubuntu render test</h1><p>Generated by wkhtmltoimage.</p></body>
</html>
EOF
wkhtmltoimage /tmp/sample.html /tmp/sample.png
file /tmp/sample.png
ls -lh /tmp/sample.png
No executed test result is provided, so treat the commands as a verification procedure rather than a claimed test result.
Render a web URL
wkhtmltoimage https://example.com /tmp/example.png
Network access, TLS validation, robots or application behavior can affect remote pages. For repeatable jobs, save the input locally or control the page’s network dependencies.
Useful wkhtmltoimage options
Run wkhtmltoimage --extended-help on the installed version for the complete option list. The options most often used in automation fall into these groups:
- Output dimensions: set a viewport width or fixed height when a responsive page must be rendered at a particular breakpoint; use cropping options when only part of a page is needed.
- Image output: choose PNG, JPEG or WebP when supported by the installed build, and set JPEG quality where applicable. PNG preserves sharp text and transparency better; JPEG is smaller for photographic content.
- Page timing: enable or disable JavaScript, add a JavaScript delay, or wait for a page that performs client-side rendering. A delay is a fixed compromise; it does not guarantee that every asynchronous request has completed.
- Resources and headers: provide cookies or custom headers for authenticated pages, and configure loading behavior when a page references external assets.
- Layout and visibility: set a user-agent string, zoom, print-style behavior, background rendering, or custom CSS when the screen version is not the desired output.
- Diagnostics: increase verbosity while troubleshooting, preserve stderr in your job logs, and use explicit input and output paths.
Option names and behavior can vary between distribution builds. Confirm syntax with the local man page and --extended-help instead of assuming that an option from a different wkhtmltoimage build is available.
Ubuntu package versus an upstream .deb
| Path | What it provides | When it makes sense | Important qualification |
|---|---|---|---|
| Ubuntu archive via apt | Release-integrated wkhtmltopdf package containing wkhtmltoimage |
Most Ubuntu users who want the simplest install and dependency handling | Version follows the configured Ubuntu archive; verify your release and architecture |
| Upstream distribution-specific .deb | An upstream 0.12.6 build selected for a supported Ubuntu release and architecture | A project requires a particular upstream build or archive version | The upstream download table lists Ubuntu builds through Jammy, not an official Noble build; host libraries and fonts are still required |
The upstream project hosts downloads through GitHub releases and recommends distribution-specific packages. Its Ubuntu table lists builds for 22.04 (Jammy), 20.04 (Focal), 18.04 (Bionic) and 16.04 (Xenial), with architectures specified per release. It does not list an upstream Ubuntu 24.04 build on that page. Do not label a Jammy .deb as an official Noble build.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Rank #3
Installing a matching local .deb
If you deliberately choose an upstream package, download the file that exactly matches your Ubuntu release and architecture, then let apt resolve dependencies:
sudo apt install ./wkhtmltox_<matching-version>_<architecture>.deb
wkhtmltoimage --version
The ./ prefix tells apt that the argument is a local file. If you instead use dpkg -i and it reports missing dependencies, finish with:
sudo apt -f install
Never mix a package built for another Ubuntu release merely because its filename looks similar. The upstream project explains that shared-library, OpenSSL, libc and font differences can break generic Linux builds. Its “static” builds still rely on system packages and runtime font configuration.
Troubleshooting installation and rendering
“Command not found” after installation
- Check whether apt completed:
dpkg -s wkhtmltopdf. - Locate the binary:
command -v wkhtmltoimage. - Inspect package files:
dpkg -L wkhtmltopdf | grep wkhtmltoimage. - If you installed a local .deb, verify its architecture with
dpkg-deb -f file.deb Architectureand compare it withdpkg --print-architecture.
Missing shared library or Qt/WebKit error
This usually indicates an incompatible .deb, incomplete dependencies, or a minimal system. Prefer the Ubuntu archive package for your release, run sudo apt -f install after a local package installation, and inspect unresolved libraries with:
ldd "$(command -v wkhtmltoimage)" | grep 'not found'
Do not copy a library list from another Ubuntu release; dependency names and versions are release-specific.
Fails on a headless server
Install and run under a virtual framebuffer when the program requires an X display. Ubuntu specifically identifies xvfb as the virtual-display option. Also verify that fonts are installed and discoverable; missing fonts can change line wrapping, page height and image appearance even when the command exits successfully.
Rank #4
Blank, incomplete or old-looking output
- Confirm the URL is reachable from the server with the same DNS, proxy and firewall settings.
- For JavaScript applications, allow a deliberate rendering delay and inspect stderr for resource failures.
- Use an explicit user agent, cookies or authorization headers only when you are authorized to access the page.
- Check that the source page’s CSS and image URLs are absolute or otherwise resolvable from the rendering process.
Fonts or layout differ from a desktop browser
wkhtmltoimage uses its bundled WebKit-era rendering stack and the fonts available on the host. Install the required font families, keep font configuration consistent between machines, and avoid assuming that a modern browser’s CSS support will match this older engine.
Permission and output-file errors
Write to a directory owned by the service account, avoid blindly running the renderer as root, and check disk space and path permissions. A successful process needs permission to read local assets and create the destination file.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteSecurity when rendering HTML
The upstream project gives a direct warning: “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!” Treat user-supplied HTML, JavaScript, URLs, cookies and headers as hostile. Sanitize input, isolate the renderer, restrict outbound network access where possible, use a low-privilege account, limit execution time and output size, and never pass arbitrary command-line text through a shell without strict argument handling.
Operational, performance and cost considerations
- Performance: rendering time depends on page size, JavaScript, remote resources, fonts and the virtual-display setup. The available official material does not establish a universal benchmark, so measure representative pages in your own environment.
- Reliability: pin the Ubuntu release or package version in reproducible builds, record the output of
wkhtmltoimage --version, and retain stderr logs. A package update can change rendering behavior. - Maintenance: the upstream stable series is 0.12.6 from June 11, 2020. That date identifies the release; it does not prove ongoing upstream maintenance.
- Cost: wkhtmltoimage is free software distributed through Ubuntu and upstream packages. Your infrastructure still incurs ordinary compute, storage and network costs.
Or skip the browser setup
If your goal is simply to obtain a clean website image rather than operate a local WebKit renderer, ScreenshotNeo provides a website screenshot API and MCP server. A single request returns PNG, JPEG, WebP or PDF:
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 API documentation for all parameters. Equivalent Python and Node.js calls are:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Before capture, ScreenshotNeo accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and whether it was billed. Its MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.
Every feature is included on every plan. Pricing is Free for 1,000 shots per month with no card, Starter $5 for 3,000, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000 and Business $249 for 1,000,000; yearly billing gives two months free.
Best Value
Create a free ScreenshotNeo account to start with 1,000 screenshots a month and no card.
Which installation path should you choose?
Use sudo apt install wkhtmltopdf when you want Ubuntu-managed dependencies on Jammy, Noble or another release represented in your configured archive. Choose an upstream .deb only when you have a concrete version requirement and can match the Ubuntu release, architecture, libraries and fonts. For untrusted input, do not treat either route as a safe sandbox; sanitize and isolate the workload first.
Frequently Asked Questions
Is there a separate Ubuntu package called wkhtmltoimage?
Usually no. Ubuntu provides the executable through the wkhtmltopdf package, which installs both command-line programs.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallDoes Ubuntu 24.04 have an official upstream wkhtmltoimage build?
The upstream download table cited here lists Ubuntu builds through 22.04 (Jammy), not an upstream Noble build. Ubuntu’s own Noble archive package is a separate installation path.
How can I see all options supported by my installed version?
Run wkhtmltoimage --extended-help and consult the local man page; option availability can differ between distribution builds.
Quick Recap
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.




