Self-host Paperless-ngx

Document management system that ingests scanned and digital documents, runs OCR on them and keeps them in a searchable, tagged archive. Run your own Paperless-ngx 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 Paperless-ngx 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 Paperless-ngx 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 (Paperless-ngx runs in Docker, which Plus and Pro include), tap Launch to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:

Set up Paperless-ngx on this workspace and give me the link. Follow https://envhaven.com/self-host/paperless-ngx.md

Then open the link it sends and create your Paperless-ngx 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 Paperless-ngx’s docs require.

Or keep it private with Tailscale

The preview URL puts Paperless-ngx 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 Paperless-ngx 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:

Set up Paperless-ngx on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/paperless-ngx.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
  • A Tailscale container runs beside Paperless-ngx, 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 covers both, and what Tailscale’s free plan includes.
At a glance
What it isFiles, photos and documents
LicenseGPL-3.0
Runs asDocker (ghcr.io/paperless-ngx/paperless-ngx)
MemoryNot documented
Plan that fitsPlus or larger
Web port8000
Documentationdocs.paperless-ngx.com/setup/

What your agent takes care of

  • Installing it. Paperless-ngx runs from the official image, ghcr.io/paperless-ngx/paperless-ngx, with its data in folders under ~/apps/paperless-ngx.
  • Putting it on an HTTPS address. The workspace’s preview URL serves it, and your own domain can too.
  • Locking it down first. What Paperless-ngx’s docs say to set before it faces the internet, below.
  • Telling you what to back up: data volume (/usr/src/paperless/data): search index, SQLite database if used, classification model, media volume (/usr/src/paperless/media): documents and thumbnails, pgdata volume: the PostgreSQL database and export and consume folders (docs).

The settings it needs behind a proxy

  • PAPERLESS_URL: Public URL of the instance, without a trailing slash and without a path; it feeds ALLOWED_HOSTS, CORS_ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS. (docs)
  • PAPERLESS_CSRF_TRUSTED_ORIGINS: Comma-separated trusted origins for unsafe requests such as POST; needed for the Django admin; can also be derived from PAPERLESS_URL. (docs)
  • PAPERLESS_ALLOWED_HOSTS: Comma-separated host names Paperless accepts, added to localhost and the host from PAPERLESS_URL; with neither setting Paperless accepts any host. (docs)
  • PAPERLESS_CORS_ALLOWED_HOSTS: Hosts allowed to make CORS calls; set to the public domain name; can also be derived from PAPERLESS_URL. (docs)
  • PAPERLESS_USE_X_FORWARD_HOST: Sets Django’s USE_X_FORWARDED_HOST (default False); may be needed behind a proxy. (docs)
  • PAPERLESS_USE_X_FORWARD_PORT: Sets Django’s USE_X_FORWARDED_PORT (default False); may be needed behind a proxy. (docs)
  • PAPERLESS_PROXY_SSL_HEADER: Sets Django’s SECURE_PROXY_SSL_HEADER as a JSON list of header and value, for example HTTP_X_FORWARDED_PROTO and https (default none). (docs)
  • PAPERLESS_TRUSTED_PROXIES: IP addresses of trusted proxies, to prevent IP address spoofing in logs used by tools such as fail2ban. (docs)
  • Upgrade: The proxy has to pass WebSocket upgrade headers; the wiki’s nginx example sets Upgrade and Connection. (docs)
  • PAPERLESS_FORCE_SCRIPT_NAME: Path prefix when hosting under a sub-path, for example /paperless, with no trailing slash. (docs)
  • PAPERLESS_STATIC_URL: Static files path (default /static/); only needs changing when hosting off a path such as /paperless/, and it needs a trailing slash. (docs)

Before it faces the internet

  • On first access the web interface prompts for a superuser account; PAPERLESS_ADMIN_USER with PAPERLESS_ADMIN_PASSWORD creates one at startup instead. (docs)
  • PAPERLESS_SECRET_KEY is required and Paperless refuses to start without it; a weak or missing key allows forged authentication credentials. (docs)
  • The docs say to put Paperless behind a reverse proxy with SSL before exposing it to the internet. (docs)
  • The example Postgres compose file ships the database password paperless. (docs)

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 Paperless-ngx to app.example.com.” Add the domain on the dashboard’s Domains page with a CNAME to domains.envhaven.app, and the agent changes Paperless-ngx’s address settings to match.
  • “Update Paperless-ngx 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.

Set up Paperless-ngx on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, ghcr.io/paperless-ngx/paperless-ngx, starting from the docs' compose file: https://github.com/paperless-ngx/paperless-ngx/blob/v3.5.1/docker/compose/docker-compose.postgres.yml. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- The docs' setup includes: broker (Redis-compatible, valkey/valkey:9-alpine in the compose files); db (PostgreSQL 18 in the Postgres compose file; MariaDB and SQLite files also exist).
- Keep the compose file in ~/apps/paperless-ngx 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 Paperless-ngx's port 8000.
- The preview URL terminates HTTPS in front of Paperless-ngx: 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/paperless-ngx.md for the preview URL, as Paperless-ngx's docs describe for running behind a proxy; skip any that apply only when Paperless-ngx serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/paperless-ngx.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 Paperless-ngx 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, Paperless-ngx’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.
  • On low-powered hardware parts of Paperless, such as OCR, run very slowly. (docs)
  • The wiki’s nginx example sets the request body limit to 10M. (docs)
  • Nginx Proxy Manager’s default 90 s timeout cuts the WebSocket connection when there are no updates for 90 s. (docs)
  • Outgoing email uses SMTP settings; the default host is localhost and the default port is 25. (docs)
  • File systems without inotify support, such as NFS shares, need polling for the consume folder. (docs)
  • The docs do not mention a Cloudflare or other request-size limit for uploads; the only size figure is the proxy example above. (docs)
  • 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.

Paperless-ngx’s own documentation covers each step for its install methods.

Sources

Facts about Paperless-ngx come from its own documentation, checked on 2026-11-23: