← All guides

Stirling PDF in a Proxmox LXC: a private PDF toolbox with OCR and an API

Stirling PDF does what the free online PDF sites do (merge, split, compress, convert, OCR, sign, redact) but on your own server, so contracts, bills and scans never get uploaded to someone else. It also has a REST API, which makes it a handy building block for scripts and automation.

We tested it on 2026-11-28 in a throwaway Proxmox LXC container with Docker (Stirling PDF 3.5.0, Debian 13) and deleted the container afterwards. All timings and memory figures are our own measurements.

Step 1: a container that can run Docker

  1. Stirling PDF ships as a Docker image, so the LXC container needs Docker. In an unprivileged container that means two features: nesting and keyctl.
  2. It is a Java app and much heavier than most tools in our catalog. We used 2 cores, 2 GB of RAM and a 15 GB disk, no swap. The image alone is 2.3 GB.
  3. Put the container on your faster storage. We used our Samsung SSD pool on purpose: a Docker install on our older system disk once coincided with the whole host freezing, and pulling a 2.3 GB image is a burst of writes.

On the Proxmox host

pct create 197 local:vztmpl/debian-13-standard_13.6-1_amd64.tar.zst \
  --hostname stirling --cores 2 --memory 2048 --swap 0 \
  --rootfs Samsung-500-gb:15 --unprivileged 1 --features nesting=1,keyctl=1 \
  --net0 name=eth0,bridge=vmbr0,ip=dhcp --onboot 1
pct start 197
# use your own storage name instead of Samsung-500-gb

Step 2: install Docker and write the compose file

  1. Debian 13's own docker.io and docker-compose packages were enough (Docker 26.1, Compose 2.26). Install curl too: the Debian template does not have it, and you want it for the health check and the API.
  2. The compose file below is the one we ran. It uses the ready-made image from the project's own registry. The official example in the repository builds the image from source, which you do not need.
  3. mem_limit keeps a runaway job inside Docker instead of letting it push the whole container out of memory. Our peak was 1.34 GB under a 1.5 GB limit, with no out-of-memory kill.
  4. DISABLE_ADDITIONAL_FEATURES and SECURITY_ENABLELOGIN=false give you the plain tools with no login screen. That is fine on a LAN; see the security notes before you expose it anywhere.

Inside the container

apt-get update && apt-get install -y docker.io docker-compose curl
mkdir -p /opt/stirling && cd /opt/stirling

cat > compose.yml <<'EOF'
services:
  stirling-pdf:
    image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest
    container_name: stirling-pdf
    restart: unless-stopped
    mem_limit: 1536m
    ports:
      - "8080:8080"
    volumes:
      - ./data:/usr/share/tessdata
      - ./config:/configs
      - ./logs:/logs
    environment:
      DISABLE_ADDITIONAL_FEATURES: "true"
      SECURITY_ENABLELOGIN: "false"
      SYSTEM_DEFAULTLOCALE: en-US
      SYSTEM_MAXFILESIZE: "100"
EOF

docker compose pull        # 66 s for us, 2.3 GB
docker compose up -d

Step 3: first start

  1. The first start took 48 seconds before the app answered. The log line to wait for is Started SPDFApplication.
  2. Check the status endpoint, then open http://<container-ip>:8080 in a browser. Version 3 has a new interface: a PDF library on the left, the file area in the middle and the tool list on the right.
  3. Right after start the container used about 811 MB of RAM.

Check that it is up

docker logs stirling-pdf 2>&1 | grep 'Started SPDF'
# Started SPDFApplication in 47.772 seconds

curl -s localhost:8080/api/v1/info/status
# {"version":"3.5.0","status":"UP"}

Step 4: use the API

  1. Every tool in the interface has an API endpoint. You send files as multipart form fields called fileInput and get the result back as the response body.
  2. We merged two PDFs, turned a JPEG scan into a PDF, ran OCR on it and compressed it. All four calls returned 200. The OCR text came back word for word: Electricity bill, the customer name and the amount.
  3. This is what makes Stirling PDF useful in a homelab beyond the web page: an n8n workflow or a cron script can merge every invoice of the month, or OCR scans before they go into Paperless-ngx.

The four calls we ran (with our timings)

B=localhost:8080/api/v1

curl -F fileInput=@invoice-a.pdf -F fileInput=@invoice-b.pdf \
  $B/general/merge-pdfs -o merged.pdf                       # 3.8 s, 2 pages

curl -F fileInput=@scan.jpg $B/convert/img/pdf -o scan.pdf   # 0.5 s

curl -F fileInput=@scan.pdf -F languages=eng -F ocrType=force-ocr \
  $B/misc/ocr-pdf -o ocr.pdf                                # 5.3 s

curl -F fileInput=@scan.pdf -F optimizeLevel=5 \
  $B/misc/compress-pdf -o small.pdf                         # 0.9 s, 90.9 KB -> 30.6 KB

What it cost (measured 2026-11-28, Stirling PDF 3.5.0)

  • RAM: 811 MB right after start, 1.34 GB after the OCR job, back to about 870 MB a minute later. Java keeps memory it has used for a while.
  • Startup: 48 seconds on two cores of an old AMD Athlon.
  • Disk: image 2.3 GB; the whole container 3.6 GB with Docker and the image.
  • Speed: merge 3.8 s (the first call after start is slowest), image to PDF 0.5 s, one-page OCR 5.3 s, compress 0.9 s.
  • Image pull: 66 seconds on our connection.

Security and limits

  • With login off, anyone who reaches port 8080 can use every tool. Keep it on your LAN, reach it from outside through a VPN such as Tailscale, or turn on login (SECURITY_ENABLELOGIN=true).
  • Licence: open-core. The core is MIT; some folders in the repository (enterprise and SaaS features) are proprietary. The tools we used need no licence key.
  • OCR: English worked out of the box with the empty ./data folder mounted. We did not test other languages; the project adds them as Tesseract language files in that folder.
  • The interface tagged our uploaded test files as Invoice and Financial by itself. Everything still ran on our server, but it is worth knowing the library sorts files for you.
  • 2 GB is the honest minimum for the container. On a 1 GB container it will not be comfortable.

Apps in this guide

More guides

Get new guides by email

One short email when we publish a new guide or add apps. No spam, unsubscribe any time.

Browse all apps →Read the weekly notes →