I have been sticking to my broken, dusty old Adobe Acrobat 2020 software simply because Adobe went full retard subscription model…
Well, now I can dump that (legally) also!
If you typically only need Adobe Acrobat to do minor edits of, redact and/or sign PDFs, then Stirling PDF will fit you just fine!
Here’s how I set up Stirling PDF to ensure nothing leaks.
Assuming you already have Docker installed and working and you are running this on Ubuntu…
Prep Work
- create a directory (e.g.
.../stirling-pdf) then create the required sub-directories under./data:mkdir -p data/{tessdata,configs,logs,customFiles,pipeline,storage}
- create the
docker-compose.yaml:services: stirling-pdf: image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest container_name: stirling-pdf volumes: - ./data/configs:/configs - ./data/logs:/logs - ./data/customFiles:/customFiles - ./data/pipeline:/pipeline - ./data/storage:/storage - ./data/tessdata:/usr/share/tessdata:ro environment: - SYSTEM_DEFAULTLOCALE=en-US - SYSTEM_ENABLEANALYTICS=false - SYSTEM_ENABLEPOSTHOG=false - SYSTEM_ENABLESCARF=false - SYSTEM_ENABLEFEEDBACK=false - INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false - SECURITY_ENABLELOGIN=false mem_limit: 4g restart: unless-stopped networks: - stirling-pdf-airgapped # Reverse proxy to bridge localhost/LAN access while blocking browser phone-home stirling-proxy: image: nginx:alpine container_name: stirling-proxy restart: unless-stopped ports: - "8080:80" networks: - stirling-pdf-airgapped - stirling-pdf-proxy volumes: - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro depends_on: - stirling-pdf networks: stirling-pdf-airgapped: name: stirling-pdf-airgapped driver: bridge internal: true stirling-pdf-proxy: name: stirling-pdf-proxy driver: bridge
- create the
nginx.conf:server { listen 80; client_max_body_size 2000M; location / { proxy_pass http://stirling-pdf:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; # Block browser from making any external connections (e.g. PostHog/CDNs) proxy_hide_header Content-Security-Policy; # Disable DNS prefetching to prevent data leaks via DNS lookups add_header X-DNS-Prefetch-Control "off" always; # Strict Content Security Policy (CSP) add_header Content-Security-Policy "default-src 'self'; connect-src 'self' blob: data:; script-src 'self' 'wasm-unsafe-eval' 'unsafe-inline' blob:; worker-src 'self' blob:; child-src 'self' blob:; frame-src 'self' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; object-src 'self' blob:; base-uri 'self'; form-action 'self'; frame-ancestors 'self';" always; } }
Downloading OCR Files
- create a temporary directory (e.g.
/tmp/ocr-data)
- inside that directory,
git clonethetessdata_fastrepository (~800++MB):git clone --depth 1 https://github.com/tesseract-ocr/tessdata_fast.git
- copy only the
*.traineddata(includingosd.traineddata) to.../stirling-pdf/data/tessdata(WARNING: the following is not a valid command – edit to suit!):mv tessdata_fast/*.traineddata .../stirling-pdf/data/tessdata
- clean up the temporary directory (e.g.
rm -fr /tmp/ocr-data)
Profit!
docker compose up -d
- point your browser at the hosts’ IP or resolvable hostname e.g.
http://host:8080
