Stirling PDF: Self-Hosted PDF Toolkit Setup
Deploy Stirling-PDF on Docker to merge, split, compress, convert, and edit PDFs without uploading files to third-party websites.
At some point you need to do something to a PDF: merge two documents, split out specific pages, compress a scanned file that’s 40MB for no reason, convert a Word doc, add a signature. The usual solution is uploading the file to a website that offers to do this for free. The question you don’t ask is where that file goes after.
Stirling-PDF is a self-hosted web application that does all of that. 50+ PDF operations in a single Docker container, running locally, with nothing leaving your network.
What It Does
The feature list is long. The ones I use:
- Merge PDFs: combine multiple files into one
- Split PDF: extract specific pages or split at a page number
- Compress: reduce file size by downsampling images and removing metadata
- PDF to Word/Excel/Image: convert to editable formats
- Word/Image to PDF: convert to PDF
- Rotate, reorder pages: fix orientation issues from scanners
- Add watermark: useful for documents you’re distributing
- OCR: make scanned PDFs text-searchable (optional, requires extra setup)
- Sign PDF: add a digital signature
There’s also a pipeline feature for chaining operations (compress then merge, for example), but I rarely use it for one-off tasks.
Installation
mkdir -p /opt/stirling-pdf
Create /opt/stirling-pdf/docker-compose.yml:
services:
stirling-pdf:
image: frooodle/s-pdf:latest
container_name: stirling-pdf
ports:
- "8090:8080"
volumes:
- /opt/stirling-pdf/trainingData:/usr/share/tesseract-ocr/5/tessdata
- /opt/stirling-pdf/extraConfigs:/configs
- /opt/stirling-pdf/logs:/logs
environment:
- DOCKER_ENABLE_SECURITY=false
- INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false
- LANGS=en_GB
restart: unless-stopped
DOCKER_ENABLE_SECURITY=false: Disables the login system. Fine for a homelab where access is controlled at the network level. If you want login-based access control, set this to true and configure user accounts.
INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false: Skips some heavier optional features (Calibre integration for ebook conversion). Set to true if you want those.
LANGS=en_GB: The language pack for OCR. en_US or en_GB for English. You can add more language packs if you’re processing documents in other languages.
Start It
cd /opt/stirling-pdf
docker compose up -d
Access the web interface at http://YOUR_SERVER_IP:8090. It’s available immediately with no setup wizard or account creation required (when security is disabled).
Basic Operations
The interface is a grid of operation tiles. Click the one you need, upload files, configure options, download the result.
Merging PDFs:
Click Merge PDFs > upload two or more files > drag to reorder if needed > Merge. The download starts automatically.
Compressing:
Click Compress PDF > upload the file > choose compression level (low/medium/high; “medium” is usually the right balance) > Compress.
For a typical scanned document, medium compression reduces a 15MB file to 2-3MB without visible quality loss on screen. High compression for documents where file size matters more than image quality.
Splitting:
Split by Pages: enter page ranges (e.g., 1-5,6-10) to extract those ranges as separate PDFs.
Split by Chapter: splits at each bookmark/chapter marker (useful for ebooks converted to PDF).
Split Every X Pages: for when you need to split a large document into equal chunks.
OCR (Making Scanned PDFs Searchable):
Click PDF OCR > upload the scanned PDF > select your language > run. This adds a hidden text layer to the PDF so you can search the content and copy text. The original scan remains visible; OCR adds the searchable layer underneath.
Note: OCR is CPU-intensive. A 20-page scanned document might take 30-60 seconds on a mini PC. That’s fine for occasional use.
Adding Authentication
If you want to put Stirling-PDF behind a login (useful if you’re exposing it via a reverse proxy):
environment:
- DOCKER_ENABLE_SECURITY=true
- SECURITY_ENABLE_LOGIN=true
- SECURITY_INITIALLOGIN_USERNAME=admin
- SECURITY_INITIALLOGIN_PASSWORD=changeme
After first login, change the password in the admin panel.
Behind a Reverse Proxy
Stirling-PDF works fine behind Nginx Proxy Manager. Add a proxy host pointing to port 8090. Enable SSL. No special configuration needed.
If you have authentication enabled in Stirling-PDF, you don’t need additional auth at the proxy level. The built-in login handles it.
Privacy Considerations
With DOCKER_ENABLE_SECURITY=false and no reverse proxy auth, anyone who can reach port 8090 on your network can use Stirling-PDF. On a home network where you trust all connected devices, that’s fine.
If you’re exposing it externally (via a subdomain), add authentication: either Stirling-PDF’s built-in login or Nginx Proxy Manager’s basic auth.
Keeping It Updated
cd /opt/stirling-pdf
docker compose pull
docker compose up -d
Stirling-PDF is under active development and releases frequently. The update is safe. Your uploaded files aren’t stored between sessions (each operation is stateless), so there’s no migration concern.
The Alternative
The alternative to Stirling-PDF is googling “merge PDF free” and uploading your documents to whatever site appears. Some of those sites are fine. Some of them are not. Stirling-PDF is faster for the operations you run regularly (once it’s bookmarked) and the files stay local. For documents that contain anything you’d be uncomfortable having a stranger read (financial documents, medical records, contracts), that matters.