# Self-host Stirling-PDF

> PDF toolkit with a web interface and API for editing, merging, splitting, signing, converting and OCR, run on your own server or as a desktop app. Run your own Stirling-PDF on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.

_Updated November 23, 2026_

Running your own Stirling-PDF usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make Stirling-PDF behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.

## Just ask your agent

Open a Plus workspace (Stirling-PDF runs in Docker, which Plus and Pro include), tap **Launch** to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:

```text
Set up Stirling-PDF on this workspace and give me the link. Follow https://envhaven.com/self-host/stirling-pdf.md
```

Then open the link it sends and create your Stirling-PDF account straight away, before anyone else finds the address. That is the whole request: the address in it is this page's Markdown copy, and the agent follows the instructions for it further down, with every setting Stirling-PDF's docs require.

## Or keep it private with Tailscale

The preview URL puts Stirling-PDF on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives Stirling-PDF an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace's **Vars** pane as `TS_AUTHKEY`, and ask the agent:

```text
Set up Stirling-PDF on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/stirling-pdf.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
```

- A Tailscale container runs beside Stirling-PDF, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
- Anything other services have to reach, such as a webhook, still needs a public address. [Keep self-hosted apps private with Tailscale](https://envhaven.com/guides/self-host-privately-with-tailscale) covers both, and what Tailscale's free plan includes.

| At a glance |  |
| --- | --- |
| What it is | Files, photos and documents |
| License | MIT for most of the repository |
| Runs as | Docker (`docker.stirlingpdf.com/stirlingtools/stirling-pdf`) |
| Memory | 4 GB for 1-10 users, 8-16 GB for 10-50 users, 16 GB or more for 50+; production checklist: at least 4 GB, about 6 GB for the latest-fat image; latest-ultra-lite suggests 2 GB ([docs](https://docs.stirlingpdf.com/Server/Operations/Performance/)) |
| Plan that fits | Plus or larger |
| Web port | 8080 |
| Documentation | [docs.stirlingpdf.com/Server/Install/Docker/](https://docs.stirlingpdf.com/Server/Install/Docker/) |

## What your agent takes care of

- **Installing it.** Stirling-PDF runs from the official image, `docker.stirlingpdf.com/stirlingtools/stirling-pdf`, with its data in folders under `~/apps/stirling-pdf`.
- **Putting it on an HTTPS address.** The workspace's preview URL serves it, and your own domain can too.
- **Locking it down first.** What Stirling-PDF's docs say to set before it faces the internet, below.
- **Telling you what to back up**: configs/ (mounted at /configs in Docker): settings.yml, custom_settings.yml, built-in H2 database and its nightly backups, generated keys, storage/ (mounted at /storage in Docker): files users save on the server and customFiles/ (mounted at /customFiles in Docker): branding and signature files ([docs](https://docs.stirlingpdf.com/Server/Production/)).

### The settings it needs behind a proxy

- X-Forwarded-Proto: The proxy forwards requests to port 8080 and sets X-Forwarded-Proto, X-Forwarded-Host and X-Forwarded-Port. ([docs](https://docs.stirlingpdf.com/Server/Production/))
- `SYSTEM_FRONTENDURL`: Public address of the web app (system.frontendUrl), used in invite emails, share links, mobile QR codes and the redirect after SAML sign-in; it falls back to backendUrl. ([docs](https://docs.stirlingpdf.com/Server/Production/))
- `SYSTEM_BACKENDURL`: Public address of the server (system.backendUrl); required for SAML single sign-on. ([docs](https://docs.stirlingpdf.com/Server/Production/))
- security.oauth2.redirectBaseUrl: Used for single sign-on when the proxy cannot forward the X-Forwarded headers (security.saml2.redirectBaseUrl for SAML). ([docs](https://docs.stirlingpdf.com/Server/Production/))
- `SYSTEM_ROOTURIPATH`: Environment variable only: serves Stirling PDF under a sub-path such as /pdf; the proxy forwards the prefix unchanged. ([docs](https://docs.stirlingpdf.com/Server/Production/))
- `system.fileUploadLimit`: Largest upload per request, a number from 0 to 999 plus KB, MB or GB; the default is 2000 MB, so the proxy has to accept uploads that large. ([docs](https://docs.stirlingpdf.com/Server/Configuration/))
- `proxy_buffering`: The docs' nginx example turns response buffering off and allows 30-minute read timeouts for long AI and Processor runs. ([docs](https://docs.stirlingpdf.com/Server/Production/))
- `client_max_body_size`: The docs' nginx example sets 2000M; nginx's own default is 1 MB. ([docs](https://docs.stirlingpdf.com/Server/Production/))

### Before it faces the internet

- On a new server the first start creates the admin account with password stirling, signs it in and opens a setup wizard that cannot be skipped; finish it, or set the first admin yourself, before exposing the server. ([docs](https://docs.stirlingpdf.com/Server/Security/Sign-in-and-Security/))
- Without login anyone who can reach the server can use it; keep SECURITY_ENABLELOGIN at true, and note that some images such as latest-ultra-lite have no login. ([docs](https://docs.stirlingpdf.com/Server/Security/Sign-in-and-Security/))
- Failed sign-ins lock an account after 5 attempts for 120 minutes. ([docs](https://docs.stirlingpdf.com/Server/Production/))

## Things to ask next

Everything after the install is one more sentence to the agent. Some that come up:

- "Import the files in ~/artifacts, keeping their folders."
- "Check how much disk it uses, and warn me when the workspace passes 80 percent."
- "Move Stirling-PDF to app.example.com." Add the domain on the dashboard's Domains page with a CNAME to `domains.envhaven.app`, and the agent changes Stirling-PDF's address settings to match.
- "Update Stirling-PDF to the latest release." It pulls the new image and recreates the container, data kept.

## Instructions for the agent

The agent reads these from the page's Markdown copy. They also work pasted on their own, if you would rather give them in your own words.

```text
Set up Stirling-PDF on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, docker.stirlingpdf.com/stirlingtools/stirling-pdf, starting from the docs' compose file: https://docs.stirlingpdf.com/Server/Install/Docker/. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- Keep the compose file in ~/apps/stirling-pdf and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to Stirling-PDF's port 8080.
- The preview URL terminates HTTPS in front of Stirling-PDF: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/stirling-pdf.md for the preview URL, as Stirling-PDF's docs describe for running behind a proxy; skip any that apply only when Stirling-PDF serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/stirling-pdf.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set Stirling-PDF up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.
```

## What to know

- In Docker, Stirling-PDF's containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
- The default upload limit is 2000 MB per request (system.fileUploadLimit), and the production checklist says the proxy has to accept uploads that large. ([docs](https://docs.stirlingpdf.com/Server/Production/))
- A reverse proxy that rejects large uploads makes them fail; nginx allows 1 MB by default. ([docs](https://docs.stirlingpdf.com/Server/FAQ/))
- When the server runs out of memory the container stops and all running jobs fail. ([docs](https://docs.stirlingpdf.com/Server/Operations/Performance/))
- The default image includes OCR and Office conversion; the ultra-lite image has no login and no OCR, Office, HTML or ebook conversions. ([docs](https://docs.stirlingpdf.com/Server/Install/Docker/))
- The Free plan allows 5 users. ([docs](https://docs.stirlingpdf.com/Server/Licensing/Plans-and-Licences/))
- Inviting users by email needs email configured; otherwise accounts are created directly. ([docs](https://docs.stirlingpdf.com/Server/Security/Sign-in-and-Security/))
- The mobile scanner QR code sends phones to the Frontend URL, which has to be an address phones can reach. ([docs](https://docs.stirlingpdf.com/Server/Customisation/Mobile-Scanner/))
- A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.

## Without a workspace

The manual route, on a server you run:

1. Rent a Linux VPS, secure SSH, and create a user for the app.
2. Install Docker and write a compose file from the official image.
3. Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
4. Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
5. Keep the firewall closed except for the proxy, and schedule backups and updates.

Stirling-PDF's own [documentation](https://docs.stirlingpdf.com/Server/Install/Docker/) covers each step for its install methods.

## Sources

Facts about Stirling-PDF come from its own documentation, checked on 2026-11-23:

- [docs.stirlingpdf.com/Server/Install/Docker](https://docs.stirlingpdf.com/Server/Install/Docker/)
- [docs.stirlingpdf.com/Server/Operations/Performance](https://docs.stirlingpdf.com/Server/Operations/Performance/)
- [docs.stirlingpdf.com/Server/Production](https://docs.stirlingpdf.com/Server/Production/)
- [docs.stirlingpdf.com/Server/Configuration](https://docs.stirlingpdf.com/Server/Configuration/)
- [docs.stirlingpdf.com/Server/FAQ](https://docs.stirlingpdf.com/Server/FAQ/)
- [docs.stirlingpdf.com/Server/Licensing/Plans-and-Licences](https://docs.stirlingpdf.com/Server/Licensing/Plans-and-Licences/)
- [docs.stirlingpdf.com/Server/Security/Sign-in-and-Security](https://docs.stirlingpdf.com/Server/Security/Sign-in-and-Security/)
- [docs.stirlingpdf.com/Server/Customisation/Mobile-Scanner](https://docs.stirlingpdf.com/Server/Customisation/Mobile-Scanner/)

## Keep reading

- [Self-host any app with your agent](https://envhaven.com/self-host)
- [Self-host Nextcloud](https://envhaven.com/self-host/nextcloud)
- [Self-host Immich](https://envhaven.com/self-host/immich)
- [Self-host PhotoPrism](https://envhaven.com/self-host/photoprism)
- [Self-host Paperless-ngx](https://envhaven.com/self-host/paperless-ngx)
- [AI agent hosting](https://envhaven.com/guides/ai-agent-hosting)

Source: https://envhaven.com/self-host/stirling-pdf
