Skip to content

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.

  1. Build the server bundle and image.

    Terminal window
    npm run build:server
    docker build -f docker/Dockerfile -t platex .
  2. Run it.

    Terminal window
    docker run -p 3001:3001 platex

    Or with Docker Compose:

    Terminal window
    docker compose -f docker/docker-compose.yml up
  3. Point your app at it.

    Terminal window
    PLATEX_SERVICE_URL=http://localhost:3001

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, and lualatex, selectable per call via the engine option
  • 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.

The container is zero-config — it reads environment variables, so a deployment needs nothing but docker run:

Terminal window
docker run -p 3001:3001 \
-e PLATEX_API_KEY=your-secret-key \
-e PLATEX_MAX_CONCURRENT=8 \
platex

See Server configuration for every setting.