Self-hosting with Docker
If you’re not on Vercel — or you want the highest-fidelity output — run the
service from the Docker image. It’s built on the official
texlive/texlive:latest image and compiles with full TeX Live
(pdflatex / xelatex / lualatex) rather than Tectonic.
Build and run
Section titled “Build and run”-
Build the server bundle and image.
Terminal window npm run build:serverdocker build -f docker/Dockerfile -t platex . -
Run it.
Terminal window docker run -p 3001:3001 platexOr with Docker Compose:
Terminal window docker compose -f docker/docker-compose.yml up -
Point your app at it.
Terminal window PLATEX_SERVICE_URL=http://localhost:3001
Why full TeX Live
Section titled “Why full TeX Live”With system TeX Live available, the library runs the real engines natively:
- Same engine flags as a local build:
-interaction=nonstopmode -halt-on-error -file-line-error - Real multi-pass logic: detects
\citation{}in the.aux, runs bibtex/biber, re-runs LaTeX until cross-references and labels stabilize - All three engines:
pdflatex,xelatex, andlualatex, selectable per call via theengineoption - pdflatex font metrics — the small differences that XeTeX-based Tectonic can introduce are gone
This is the mode to choose when output must match a specific local TeX toolchain exactly. See How output accuracy works.
Configuration
Section titled “Configuration”The container is zero-config — it reads environment variables, so a deployment
needs nothing but docker run:
docker run -p 3001:3001 \ -e PLATEX_API_KEY=your-secret-key \ -e PLATEX_MAX_CONCURRENT=8 \ platexSee Server configuration for every setting.
Where to next
Section titled “Where to next”Server configurationAuth, concurrency, limits, and body-size caps.
Deploy the serviceThe Vercel and bundled-server paths.