Skip to content

Latest commit

 

History

History
103 lines (74 loc) · 2.85 KB

File metadata and controls

103 lines (74 loc) · 2.85 KB

Install — Simple PDF

Self-hosted install for Docker or bare metal (Debian/Ubuntu recommended).

Requirements

  • Docker Engine + Docker Compose or
  • Python 3.12, python3-venv, and system packages:
    • Tesseract OCR (tesseract-ocr, tesseract-ocr-eng, optionally tesseract-ocr-spa)
    • LibreOffice Writer headless (office → PDF): libreoffice-writer-nogui or equivalent

Docker (recommended)

git clone https://github.com/redmanxp/SimplePDF-OSS.git
cd SimplePDF-OSS
cp .env.example .env
# Optional: set PDF_EDITOR_SECRET_KEY in .env for stable multi-worker sessions
docker compose up --build

Stop: docker compose down

Bare metal (venv + gunicorn)

sudo apt update
sudo apt install -y python3.12-venv python3-pip \
  tesseract-ocr tesseract-ocr-eng tesseract-ocr-spa \
  libreoffice-writer-nogui

# Or helpers:
# sudo bash deploy/install-ocr-apt.sh
# sudo bash deploy/install-libreoffice.sh

cd /opt/simple-pdf   # or your clone path
python3.12 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env: HOST, PORT, UPLOADS, SECRET_KEY

gunicorn -w 2 -b 127.0.0.1:8000 --timeout 600 wsgi:app

Open http://127.0.0.1:8000

systemd (example)

Generic unit and env live under deploy/:

sudo mkdir -p /opt/simple-pdf
# copy or clone the project into /opt/simple-pdf
cp deploy/pdf-editor.env.example deploy/pdf-editor.env
# edit paths and PDF_EDITOR_SECRET_KEY
sudo bash deploy/install-systemd.sh

Default example paths assume /opt/simple-pdf. Adjust deploy/pdf-editor.service and the install script if you install elsewhere.

Useful commands:

sudo systemctl status pdf-editor
journalctl -u pdf-editor -f
curl -s http://127.0.0.1:8000/api/health

Optional daily restart (fresh workers + upload cleanup on start):

sudo bash deploy/install-daily-restart.sh

Reverse proxy / TLS

For any network beyond a trusted LAN, put nginx/Caddy/Traefik in front with TLS and keep gunicorn on localhost. Do not commit private keys.

Firewall

If you expose the app port directly, restrict source networks with your firewall. Prefer proxy-on-443 + localhost backend. See deploy/ufw-pdf-editor.sh as a starting point (edit CIDR/port).

Verify

curl -s http://127.0.0.1:8000/api/health
# Expect JSON with ok/status and optional ocr / libreoffice flags

Troubleshooting

Symptom Check
Port in use ss -lntp | grep 8000
Service not listening journalctl -u pdf-editor
OCR fails tesseract --list-langs; install eng/spa packs
Office upload fails soffice --version; install LibreOffice Writer
“No files to combine” with multi-worker set stable PDF_EDITOR_SECRET_KEY or persist .secret_key