# Self-host Immich

> Self-hosted photo and video library with a web app, mobile backup, machine-learning search and face recognition. Run your own Immich 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 Immich 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 Immich 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 Pro workspace (Immich 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 Immich on this workspace and give me the link. Follow https://envhaven.com/self-host/immich.md
```

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

## Or keep it private with Tailscale

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

- A Tailscale container runs beside Immich, 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 |
| Runs as | Docker (`ghcr.io/immich-app/immich-server`) |
| Memory | minimum 6 GB, recommended 8 GB; 4 GB systems can run with machine learning disabled; Postgres needs at least 2 GB when Docker resource limits are used ([docs](https://docs.immich.app/install/requirements/)) |
| Plan that fits | Pro or larger |
| Web port | 2283 |
| Documentation | [docs.immich.app/install/docker-compose/](https://docs.immich.app/install/docker-compose/) |

## What your agent takes care of

- **Installing it.** Immich runs from the official image, `ghcr.io/immich-app/immich-server`, with its data in folders under `~/apps/immich`.
- **Putting it on an HTTPS address.** The workspace's preview URL serves it, and your own domain can too.
- **Locking it down first.** What Immich's docs say to set before it faces the internet, below.
- **Telling you what to back up**: UPLOAD_LOCATION (default ./library): library, upload, thumbs, encoded-video, profile and backups folders and DB_DATA_LOCATION (default ./postgres): the Postgres database ([docs](https://docs.immich.app/administration/backup-and-restore/)).

### The settings it needs behind a proxy

- X-Forwarded-Proto: The reverse proxy has to forward all headers and set Host, X-Real-IP, X-Forwarded-Proto and X-Forwarded-For correctly. ([docs](https://docs.immich.app/administration/reverse-proxy/))
- `IMMICH_TRUSTED_PROXIES`: Environment variable for server and api: comma-separated IPs treated as trusted proxies. ([docs](https://docs.immich.app/install/environment-variables/))
- External Domain: Admin setting under Administration > Settings > Server: the domain used in shared links and email notifications, without a trailing slash. ([docs](https://docs.immich.app/administration/system-settings/))
- proxy_set_header Upgrade $http_upgrade;: The docs' nginx example passes websocket upgrades to Immich on port 2283. ([docs](https://docs.immich.app/administration/reverse-proxy/))
- `client_max_body_size`: The docs' nginx example raises the upload limit to 50000M and turns request buffering off; the proxy must allow big uploads. ([docs](https://docs.immich.app/administration/reverse-proxy/))
- /.well-known/immich: Immich well-known endpoint: with the Let's Encrypt http-01 challenge, verify it is routed to Immich, otherwise the mobile app may run into connection issues. ([docs](https://docs.immich.app/administration/reverse-proxy/))

### Before it faces the internet

- The first user to register becomes the admin. ([docs](https://docs.immich.app/install/post-install/))
- The example .env ships DB_PASSWORD=postgres; the docs suggest a custom value using only A-Za-z0-9. Postgres is not exposed publicly. ([docs](https://docs.immich.app/install/docker-compose/))
- The docs warn that the web interface and API may be exposed and that severe vulnerabilities cannot be ruled out. ([docs](https://docs.immich.app/guides/remote-access/))

## 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 Immich to app.example.com." Add the domain on the dashboard's Domains page with a CNAME to `domains.envhaven.app`, and the agent changes Immich's address settings to match.
- "Update Immich 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 Immich on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, ghcr.io/immich-app/immich-server, starting from the docs' compose file: https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- The docs' setup includes: immich-machine-learning (machine learning worker); valkey (Redis-compatible cache, service named redis); database (Postgres with VectorChord, ghcr.io/immich-app/postgres).
- Keep the compose file in ~/apps/immich 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 Immich's port 2283.
- The preview URL terminates HTTPS in front of Immich: 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/immich.md for the preview URL, as Immich's docs describe for running behind a proxy; skip any that apply only when Immich serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/immich.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 Immich 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, Immich'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.
- Behind Cloudflare Tunnel the docs give a 100 MB maximum file size that cannot be changed. ([docs](https://docs.immich.app/FAQ/))
- The docs do not mention chunked uploads or a workaround for the Cloudflare limit: searches of the docs folder of immich-app/immich for chunk, chunked, chunking, chunks and resumable returned no results, and the FAQ, reverse proxy and remote access pages say only what is quoted here. ([docs](https://docs.immich.app/install/docker-compose/))
- A GPU can optionally speed up machine learning; the docs call the feature experimental. ([docs](https://docs.immich.app/features/ml-hardware-acceleration/))
- Transcoding and machine learning can be too heavy for low-memory hosts; machine learning can be hosted elsewhere or turned off. ([docs](https://docs.immich.app/FAQ/))
- Reverse proxy timeouts matter for large uploads: with Traefik's default 60 s, videos stop uploading after one minute. ([docs](https://docs.immich.app/administration/reverse-proxy/))
- The Postgres data directory must not be on a network share and needs a Unix filesystem with ownership and permissions. ([docs](https://docs.immich.app/install/docker-compose/))
- Immich expects its own host rather than a path under one, so it takes the workspace's preview URL or a domain of its own.
- 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.

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

## Sources

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

- [docs.immich.app/install/docker-compose](https://docs.immich.app/install/docker-compose/)
- [docs.immich.app/install/requirements](https://docs.immich.app/install/requirements/)
- [docs.immich.app/administration/reverse-proxy](https://docs.immich.app/administration/reverse-proxy/)
- [docs.immich.app/install/environment-variables](https://docs.immich.app/install/environment-variables/)
- [docs.immich.app/administration/system-settings](https://docs.immich.app/administration/system-settings/)
- [docs.immich.app/FAQ](https://docs.immich.app/FAQ/)
- [docs.immich.app/features/ml-hardware-acceleration](https://docs.immich.app/features/ml-hardware-acceleration/)
- [docs.immich.app/administration/backup-and-restore](https://docs.immich.app/administration/backup-and-restore/)
- [docs.immich.app/install/post-install](https://docs.immich.app/install/post-install/)
- [docs.immich.app/guides/remote-access](https://docs.immich.app/guides/remote-access/)

## 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 PhotoPrism](https://envhaven.com/self-host/photoprism)
- [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/immich
