# Building a Self-Hosted Photo Library That Survives

Moving a photo collection away from a commercial cloud service is less about replacing a gallery interface and more about taking responsibility for storage, indexing, backups, and upgrades. A practical deployment can run on a small home server using Immich or PhotoPrism, with the application and database hosted in containers. The original image files should live on a dedicated volume rather than inside a container filesystem, so application updates never put the library itself at risk.

## Storage and Deployment

For a modest collection, mirrored hard drives provide useful protection against a single disk failure, while an SSD can hold the database and thumbnail cache. The application should import photos without modifying their originals, preserve EXIF metadata, and support common formats such as JPEG, HEIC, and RAW. A minimal Compose configuration might mount the library read-only during initial testing:

```yaml
services:
  photos:
    image: photoprism/photoprism:latest
    volumes:
      - /srv/photos/originals:/photoprism/originals:ro
      - /srv/photos/storage:/photoprism/storage
```

## Indexing and Search

The first indexing pass is usually the most resource-intensive part of the migration. Thumbnail generation, face detection, and metadata extraction can saturate both CPU and disk bandwidth for hours or days. Scheduling these tasks overnight and keeping generated assets on fast storage makes the system feel much more responsive. It is also worth verifying timestamps carefully, because scanned photographs and files exported from messaging applications often lack reliable capture dates.

## Access and Security

Remote access should not require exposing the photo application directly to the public internet. A private VPN such as WireGuard or Tailscale keeps the deployment simple, while a reverse proxy with HTTPS is appropriate when albums must be shared externally. In either case, use strong administrator credentials, disable unused accounts, and apply updates regularly to the operating system, containers, and database.

## Backups and Recovery

RAID is not a backup: accidental deletion, filesystem corruption, or ransomware can affect every mirrored disk at once. Keep at least one versioned backup on separate hardware and another copy off-site, ideally encrypted. Back up the database and application configuration alongside the originals, then perform a test restore periodically; a backup strategy is only credible when a clean machine can rebuild the library, metadata, and albums without guesswork.