How to Self-Host Your Own PDF Tools: A Developer's Guide
"Self-hosted" gets used as a selling point often enough that it's worth explaining plainly what it actually involves — not as an abstract principle, but as real infrastructure someone has to run. This is the honest version, from actually having built and operated one.
What "self-hosted" actually requires
At minimum: a server you control (a basic cloud VM is enough — nothing exotic), a reverse proxy handling HTTPS (Nginx with a free Let's Encrypt certificate is the standard choice), a process manager keeping the application alive across crashes and reboots (PM2 is common for Node.js apps), and — specifically for PDF tooling — a couple of system-level dependencies for the harder conversions.
The dependencies that actually do the work
- pdf-lib (or equivalent) handles the pure-JavaScript operations — merging, splitting, rotating, watermarking — with no system dependencies at all.
- LibreOffice, run in headless mode, handles Office format conversions (Word, Excel, PowerPoint to and from PDF). This is a genuinely heavy dependency — expect it to need real memory, not a token amount.
- poppler-utils handles PDF-to-image conversion.
- qpdf handles password protection and encryption.
None of these are exotic, but LibreOffice specifically is worth budgeting for — it is not a lightweight process, and underpowered servers (1GB of RAM or less) can struggle with it under concurrent load.
The parts that aren't obvious until you hit them
- File cleanup: uploaded and processed files need to actually be deleted afterward, both immediately after each request and via a periodic sweep as a safety net for abandoned uploads.
- Rate limiting: a public-facing tool without request limits is an open invitation to be used as free infrastructure by someone else's script.
- A specific, unglamorous bug category: PDF-parsing libraries sometimes default to importing a PDF as an image rather than as text, silently breaking every downstream conversion — the kind of failure that looks like "it just doesn't work" with no obvious error, until you dig into exactly which import filter is being used.
Is it worth it, honestly?
If the goal is genuine control over where files go — for a business, a team, or personal principle — yes, and it's more achievable than it sounds; a small cloud VM costs a few dollars a month. If the goal is convenience alone, a hosted third-party tool will always be less setup. Self-hosting is a trade of a few hours of setup and ongoing maintenance in exchange for actually knowing, rather than trusting, what happens to a file.
See the actual implementation
PDF Chroma's full source — backend and frontend — is open source and available to read, fork, or self-host directly, including everything described above already wired together.