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

If your shell prints wkhtmltopdf: command not found (or an application reports that wkhtmltopdf is not installed), the failure happens before HTML rendering starts: the process cannot resolve an executable named wkhtmltopdf. Check command discovery in the exact environment that failed, install the program there if it is absent, or configure your application with the executable’s real path. The same method covers a local terminal, a service, a job runner and a container.

What the error actually means

wkhtmltopdf is a headless command-line utility that renders HTML to PDF. The upstream project describes it, together with wkhtmltoimage, as open-source LGPLv3 software using the Qt WebKit rendering engine. A “command not found” message is a command-resolution error, not a PDF-layout error.

Your operating system searches directories listed in the failing process’s PATH. The error has one of two direct causes:

  • The executable is not installed in that environment.
  • The executable exists, but its directory is not in that process’s PATH, and the calling application has not been given an explicit path.

A successful lookup in your interactive terminal does not prove that a systemd service, web worker, CI job or Docker container can see the same file. Those processes can use a different user, environment, filesystem and architecture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Diagnose the failing execution context first

Run a lookup as the failing user

Open the same shell, container or job environment used by the application. Then run:

command -v wkhtmltopdf
which wkhtmltopdf

command -v is generally preferable in scripts because it is a shell builtin on many systems. If either command prints a path, save it for application configuration. If both print nothing (or return a nonzero status), the process cannot currently resolve the command.

For a service, execute the check as that service account and inspect its environment rather than your own login session. For a container, open a shell inside the container that performs PDF generation:

docker exec -it YOUR_CONTAINER sh
command -v wkhtmltopdf
printf '%sn' "$PATH"

Replace sh with bash only when that shell is actually present. Checking the host while the application runs in a container produces a misleading result.

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 file and architecture when a path is returned

On Linux or macOS, verify that the returned file is executable:

ls -l "$(command -v wkhtmltopdf)"
file "$(command -v wkhtmltopdf)"

A path can exist while its permissions, CPU architecture or runtime libraries are incompatible with the process. Those problems normally appear after lookup succeeds, with a different execution error.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Confirm execution after installation

wkhtmltopdf --version

Run this command in the same context as the application. A version response proves that the shell found and started the binary; it does not by itself prove that every page can be rendered.

Install wkhtmltopdf in the environment that runs it

Use the package manager appropriate for the target operating system and distribution. The commands below are examples documented by a community integration; package names, supported releases and available architectures can differ, so verify them for your image or OS before deploying.

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

Ubuntu or Debian

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

If the failing application is not on the host, run the equivalent installation while building its image or on the machine where the worker executes. Installing only on a developer laptop does not change a production runtime.

CentOS, RHEL or Fedora

sudo yum install wkhtmltopdf
# or, on systems using DNF:
sudo dnf install wkhtmltopdf
command -v wkhtmltopdf
wkhtmltopdf --version

Some releases do not provide the same package in their enabled repositories. Do not assume that a command successful on one distribution is portable to another; check the package’s architecture and dependencies.

macOS

brew install wkhtmltopdf
command -v wkhtmltopdf
wkhtmltopdf --version

Homebrew’s installation prefix can vary between Intel and Apple-silicon systems. Always use the path printed by command -v instead of hard-coding a prefix.

Windows

Install a build appropriate for your Windows architecture from the project’s downloads page, then open a new terminal and run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
where wkhtmltopdf
wkhtmltopdf.exe --version

If where finds nothing, add the directory containing wkhtmltopdf.exe to the account or service PATH, or configure the application with the full executable path. A commonly checked integration default is C:Program Fileswkhtmltopdfbinwkhtmltopdf.exe, but your installation may use another location.

Fix PATH and application configuration

Use the actual path, not an assumed one

Integration software often checks paths such as Linux /usr/bin/wkhtmltopdf, macOS /usr/local/bin/wkhtmltopdf and Windows C:Program Fileswkhtmltopdfbinwkhtmltopdf.exe. These are integration defaults, not universal locations. Set the executable option to the result of your lookup.

For example, if the lookup returns /opt/wkhtmltopdf/bin/wkhtmltopdf, configure that exact value rather than relying on a login-shell profile. A service may not read ~/.bashrc, ~/.zshrc or a Windows interactive user’s profile.

Make a service environment explicit

For a process manager or service, define the path in its environment or application setting, restart the process, and test from that process’s account. Changing your terminal’s PATH does not retroactively alter an already running worker.

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

Check permissions

The service user must be able to traverse every parent directory and execute the binary. If lookup succeeds but execution is denied, inspect ownership and mode bits, then grant the minimum required access. Avoid making the entire filesystem or binary world-writable.

Container-specific fixes

Most application containers do not include wkhtmltopdf by default. A host installation is invisible inside the container unless you deliberately share a compatible binary and all of its runtime dependencies. Installing a package interactively into a running container is also lost when that container is replaced.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Install during image construction

Add the distribution-specific installation to the image build, rebuild it, and deploy the new image. Then verify from the final image:

docker build -t my-pdf-worker .
docker run --rm my-pdf-worker wkhtmltopdf --version

The exact Dockerfile depends on the base image. An Alpine-based hardened image does not provide apt-get; use its supported package tooling or choose a compatible base image. Ensure the selected wkhtmltopdf build, shared libraries and fonts match the image’s libc, CPU architecture and security constraints.

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

Verify the runtime, not just the build stage

Multi-stage builds can accidentally leave the executable behind in an earlier stage. Run command -v and --version in the final runtime image, under the same user that handles requests. If the binary is present but libraries are missing, the error will occur after discovery and must be diagnosed as a dependency or rendering failure.

Separate command lookup from later rendering failures

Once command -v wkhtmltopdf and wkhtmltopdf --version succeed, stop treating the original message as a PATH problem. Run a minimal conversion:

printf '%sn' '<html><body>OK</body></html>' > /tmp/test.html
wkhtmltopdf /tmp/test.html /tmp/test.pdf
ls -lh /tmp/test.pdf

If this fails, record the new message and exit status. An integration README associates exit codes 127 or 139 and blank output with possible missing libraries or fonts, not necessarily with command discovery. Investigate those dependencies separately.

Common symptoms and targeted fixes

Symptom Likely cause Action
bash: wkhtmltopdf: command not found No executable is installed in that shell, or its directory is absent from PATH. Run command -v in the failing context; install there or set the real path.
Works in a terminal, fails in the web app The service uses another user or a restricted environment. Check lookup and PATH as the service account; configure an absolute path and restart.
Works on the host, fails in Docker The container has a separate filesystem and environment. Install it in the image and include compatible libraries and fonts.
Windows application says not installed The executable directory is not in the service’s PATH, or the integration checks a different location. Use where wkhtmltopdf and set the full .exe path.
Lookup succeeds, then exit 127 or 139 Runtime libraries, fonts or architecture may be missing or incompatible. Inspect the new error, verify dependencies and test a minimal document.
PDF is blank or conversion times out The command is starting, but page loading or rendering is failing. Debug URL access, assets, fonts, timeouts and renderer behavior separately from PATH.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Security, reliability and maintenance considerations

Do not expose an unrestricted converter

Rendering user-controlled HTML or URLs can provide a path to internal services or consume excessive CPU and memory. Restrict who can invoke the binary, validate allowed destinations, apply process timeouts and run it with least privilege. Keep temporary files isolated and remove them after conversion.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Make failures observable

Log the resolved executable path, effective user, container or host identity, command exit status and stderr. Do not log secrets embedded in headers, cookies or URLs. A startup health check that runs wkhtmltopdf --version can detect a bad image before production traffic reaches it.

Account for upstream status

The upstream GitHub repository has been archived and read-only since January 2, 2023. That does not prevent fixing a missing command, but it matters when selecting a renderer for a new long-lived system: validate compatibility with your current OS, browser features and security requirements rather than assuming future upstream fixes.

Or skip the browser setup

If your goal is a clean screenshot or PDF rather than maintaining a wkhtmltopdf installation, ScreenshotNeo provides a website screenshot API and MCP server. One request can capture a URL as PNG, JPEG, WebP or PDF without installing a browser on your worker.

For a screenshot, see the parameter details in the ScreenshotNeo documentation and run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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('node:fs').writeFileSync('shot.webp', data);

ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create an account at ScreenshotNeo’s free sign-up page.

Frequently Asked Questions

Why does which wkhtmltopdf return a path but my application still says it is missing?

The application may run as another user, inside another container, or with a different PATH. Perform the lookup from that exact process context and configure the returned absolute path.

Can I copy the wkhtmltopdf folder from another machine?

Only when the binary’s operating system, CPU architecture and runtime dependencies are compatible. A copied file can still fail because required libraries or fonts are absent; installing a package in the target environment is safer.

Does installing wkhtmltopdf fix blank PDFs?

No. Installation resolves command discovery. Blank output after the executable starts requires separate investigation of page access, assets, fonts, timing and renderer dependencies.

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.