# Building a Self-Hosted Photo Library That Survives Real Life

Moving a photo collection off a commercial cloud service sounds simple: copy the files to a server, install a gallery application, and point a phone at it. In practice, a useful photo library needs fast browsing, reliable mobile uploads, metadata preservation, and a backup strategy that does not mistake disk redundancy for data safety. My setup runs on a small home server with mirrored storage, Docker Compose, and Immich providing the web interface, search, albums, and automatic uploads.

## Storage and Deployment

The library keeps original files on a dedicated filesystem mounted at `/srv/photos`, while thumbnails, transcoded videos, and database data live on faster SSD storage. Separating replaceable cache data from irreplaceable originals makes capacity planning easier and keeps background indexing from competing with large file transfers. The application stack is pinned to explicit image versions so an unattended update cannot introduce a database migration before I have tested it.

```yaml
services:
  immich-server:
    image: ghcr.io/immich-app/immich-server:v1.132.3
    volumes:
      - /srv/photos:/usr/src/app/upload
    restart: unless-stopped
```

## Imports Without Metadata Loss

Before importing older archives, I normalize directory permissions and scan for duplicate hashes, but I do not rename files or rewrite EXIF data. Capture timestamps, GPS coordinates, camera serial numbers, and sidecar files are valuable inputs for timeline ordering and search. For edited images, I keep both the exported JPEG and the original RAW file; linking them logically is preferable to discarding either version.

## Uploads and Remote Access

Phones upload over Wi-Fi and cellular data through a reverse proxy protected with TLS. The photo service is not exposed directly from the Docker network, and administrative access remains behind a VPN. Mobile uploads land in a staging area first, which makes partial transfers and accidental deletions easier to detect before files are incorporated into the main archive.

## Backups and Recovery

The server uses snapshots for quick recovery, but snapshots are only the first layer. Encrypted backups are copied nightly to a second machine and weekly to an off-site object store with retention enabled. Every few months, I restore a random album and the database into a temporary environment; a successful backup job is reassuring, but a successful restore is evidence.

## Maintenance

The ongoing workload is modest: review failed uploads, monitor free space, apply tested updates, and verify backups. Machine-learning features such as face recognition and semantic search consume substantial CPU during the initial scan, then settle into short jobs as new photos arrive. The result feels much like a hosted photo service, with the important difference that the originals remain accessible as ordinary files even if the gallery software is eventually replaced.