# Self-host PhotoPrism

> Self-hosted app for browsing, organizing and sharing photos and videos, with search, tagging and face recognition. Run your own PhotoPrism 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 PhotoPrism 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 PhotoPrism 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 (PhotoPrism 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 PhotoPrism on this workspace and give me the link. Follow https://envhaven.com/self-host/photoprism.md
```

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

## Or keep it private with Tailscale

The preview URL puts PhotoPrism 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 PhotoPrism 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 PhotoPrism on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/photoprism.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
```

- A Tailscale container runs beside PhotoPrism, 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 | AGPL-3.0 with additional terms for the PhotoPrism trademark and brand assets |
| Runs as | Docker (`photoprism/photoprism`) |
| Memory | at least 3 GB of physical memory and at least 4 GB of swap; the docs say no hard memory limit should be set; RAM should match the CPU core count beyond the minimum ([docs](https://docs.photoprism.app/getting-started/)) |
| Plan that fits | Plus or larger |
| Web port | 2342 |
| Documentation | [docs.photoprism.app/getting-started/docker-compose/](https://docs.photoprism.app/getting-started/docker-compose/) |

## What your agent takes care of

- **Installing it.** PhotoPrism runs from the official image, `photoprism/photoprism`, with its data in folders under `~/apps/photoprism`.
- **Putting it on an HTTPS address.** The workspace's preview URL serves it, and your own domain can too.
- **Locking it down first.** What PhotoPrism's docs say to set before it faces the internet, below.
- **Telling you what to back up**: originals folder (/photoprism/originals): the photo and video files, storage folder (/photoprism/storage): cache, sidecar files, config and, with SQLite, the index database and MariaDB database (./database:/var/lib/mysql in the example) ([docs](https://docs.photoprism.app/getting-started/advanced/backups/)).

### The settings it needs behind a proxy

- `PHOTOPRISM_SITE_URL`: Canonical site URL used in generated links and to decide on HTTPS/TLS; set it to the external https:// address. ([docs](https://docs.photoprism.app/getting-started/config-options/))
- `PHOTOPRISM_DISABLE_TLS`: Turns off PhotoPrism's own HTTPS even when the site URL starts with https://; the proxy docs say to keep it disabled so the proxy manages certificates. ([docs](https://docs.photoprism.app/getting-started/config-options/))
- `PHOTOPRISM_TRUSTED_PROXY`: Comma-separated CIDR ranges or addresses from which reverse proxy headers are trusted (default 172.16.0.0/12, 127.0.0.0/8, ::1). Keep a value set when a proxy is in front. ([docs](https://docs.photoprism.app/getting-started/config-options/))
- `PHOTOPRISM_PROXY_CLIENT_HEADER`: Name of the header that carries the client IP (default X-Forwarded-For); the docs list CF-Connecting-IP as another example. ([docs](https://docs.photoprism.app/getting-started/config-options/))
- `PHOTOPRISM_PROXY_PROTO_HEADER`: Name of the header that carries the forwarded protocol (default X-Forwarded-Proto); PHOTOPRISM_PROXY_PROTO_HTTPS holds the value that means https (default https). ([docs](https://docs.photoprism.app/getting-started/config-options/))
- Upgrade: The proxy has to forward the Upgrade and Connection headers: PhotoPrism uses a WebSocket for live updates, and without it the UI stops reflecting server activity until reload. ([docs](https://docs.photoprism.app/getting-started/proxies/))
- `client_max_body_size`: The docs' nginx example raises the body limit to 512M and turns proxy buffering off so large uploads stream through; the general advice is to raise body-size and read-timeout limits. ([docs](https://docs.photoprism.app/getting-started/proxies/nginx/))

### Before it faces the internet

- The example sets the initial admin password to insecure (8-72 characters allowed) and the database password to insecure; change both before exposing the server. ([docs](https://dl.photoprism.app/docker/compose.yaml))
- Without HTTPS, files and passwords travel in clear text and can be intercepted. ([docs](https://dl.photoprism.app/docker/compose.yaml))
- PHOTOPRISM_AUTH_MODE accepts password or public; the example uses password. ([docs](https://dl.photoprism.app/docker/compose.yaml))

## 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 PhotoPrism to app.example.com." Add the domain on the dashboard's Domains page with a CNAME to `domains.envhaven.app`, and the agent changes PhotoPrism's address settings to match.
- "Update PhotoPrism 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 PhotoPrism on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, photoprism/photoprism, starting from the docs' compose file: https://dl.photoprism.app/docker/compose.yaml. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- The docs' setup includes: mariadb (MariaDB 12.3 in the example file).
- Keep the compose file in ~/apps/photoprism 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 PhotoPrism's port 2342.
- The preview URL terminates HTTPS in front of PhotoPrism: 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/photoprism.md for the preview URL, as PhotoPrism's docs describe for running behind a proxy; skip any that apply only when PhotoPrism serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/photoprism.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 PhotoPrism 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, PhotoPrism'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.
- Web uploads are capped at 5000 MB in total by default (single media files also 5000 MB); -1 disables the limit. ([docs](https://docs.photoprism.app/getting-started/config-options/))
- The docs say proxies cap request bodies and response times below what a photo library needs, so both limits must be raised. ([docs](https://docs.photoprism.app/getting-started/proxies/))
- Traefik's default read timeout cuts off uploads that take longer than a minute. ([docs](https://docs.photoprism.app/getting-started/proxies/traefik/))
- Less than 4 GB of swap or a memory or swap limit can cause unexpected restarts while indexing. ([docs](https://dl.photoprism.app/docker/compose.yaml))
- RAW conversion and face recognition are disabled on systems with 1 GB of memory or less. ([docs](https://docs.photoprism.app/getting-started/))
- The Compose example runs PhotoPrism and MariaDB with seccomp and AppArmor unconfined. ([docs](https://dl.photoprism.app/docker/compose.yaml))
- Machine learning features depend on TensorFlow and can be switched off. ([docs](https://dl.photoprism.app/docker/compose.yaml))
- The docs say a public server must sit behind a secure HTTPS reverse proxy. ([docs](https://docs.photoprism.app/getting-started/))
- 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.

PhotoPrism's own [documentation](https://docs.photoprism.app/getting-started/docker-compose/) covers each step for its install methods.

## Sources

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

- [docs.photoprism.app/getting-started/docker-compose](https://docs.photoprism.app/getting-started/docker-compose/)
- [docs.photoprism.app/getting-started](https://docs.photoprism.app/getting-started/)
- [docs.photoprism.app/getting-started/config-options](https://docs.photoprism.app/getting-started/config-options/)
- [docs.photoprism.app/getting-started/proxies](https://docs.photoprism.app/getting-started/proxies/)
- [docs.photoprism.app/getting-started/proxies/nginx](https://docs.photoprism.app/getting-started/proxies/nginx/)
- [docs.photoprism.app/getting-started/proxies/traefik](https://docs.photoprism.app/getting-started/proxies/traefik/)
- [dl.photoprism.app/docker/compose.yaml](https://dl.photoprism.app/docker/compose.yaml)
- [docs.photoprism.app/getting-started/advanced/backups](https://docs.photoprism.app/getting-started/advanced/backups/)

## 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 Paperless-ngx](https://envhaven.com/self-host/paperless-ngx)
- [Self-host Stirling-PDF](https://envhaven.com/self-host/stirling-pdf)
- [AI agent hosting](https://envhaven.com/guides/ai-agent-hosting)

Source: https://envhaven.com/self-host/photoprism
