Self-Hosted Photo Library on a Budget VPS: Storage and CPU Math

Sizing a self-hosted media library on a cheap VPS: how much disk originals and derivatives really take, why the CPU cost sits in the first import, RAM floors for Immich, PhotoPrism and Paperless, and when to split originals to object storage.

A 10,000-object photo library, a folder of 4,000 product images, and a scanned-document archive all fail the same way on a budget VPS: not because the disk is too small, but because the CPU is too slow and the storage is the wrong shape. On a $6–$10/month instance the difference between a library that serves thumbnails in 40 ms and one that takes 2 seconds is almost entirely thumbnail generation strategy, not server size.

This is the sizing arithmetic for self-hosted media libraries on small VPS plans — what images actually cost in storage and CPU, where the bottlenecks appear, and how to keep the working set small enough that an entry-tier box stays comfortable.

Storage math: originals vs derivatives

A photo library is two datasets with very different characteristics. Originals are written once, read rarely, and are incompressible. Derivatives — thumbnails, previews, transcoded versions — are written once, read constantly, and multiply the file count by 3–6×.

LibraryOriginalsDerivativesTotal on disk
2,000 phone photos (4 MB avg)8 GB0.6 GB~9 GB
10,000 phone photos40 GB3 GB~43 GB
10,000 RAW files (25 MB avg)250 GB2 GB~252 GB
4,000 product images (300 KB avg)1.2 GB0.9 GB~2 GB
20,000 scanned PDFs (500 KB avg)10 GB1 GB (OCR text + previews)~11 GB

Two conclusions follow immediately. First, most “photo library” projects are 10–50 GB, which fits comfortably on a 40–80 GB plan. Second, RAW workflows do not fit on budget VPS disk at all — 250 GB of block storage costs more than the server every month, which is the point at which you either keep originals on a NAS and use the VPS as an index, or use object storage for originals.

The CPU cost is in the first import, not steady state

Serving an existing thumbnail is cheap — it is a static file through nginx and costs almost nothing. Generating one is expensive: decode a 12-megapixel JPEG, resample, re-encode. On a single shared vCPU that is roughly 0.15–0.4 seconds per image, and a 10,000-image import therefore represents 25–65 minutes of solid CPU time before you add a second derivative size.

That matters for plan choice because it is a burst, not a baseline. The steady-state load of a library serving 20 users is a few percent of a core. The import is one hour at 100%. A burst-tolerant plan handles it; a strictly capped 100%-of-one-core plan means the import runs overnight and everything else queues behind it.

  • Generate one thumbnail size at import (typically 256–400 px) and defer the rest.
  • Run the import in batches with nice -n 10 so web requests keep priority.
  • Skip re-decoding on every request: cache derivative paths in the database rather than recomputing them.
  • Cap concurrent workers at the core count; more workers on a 1–2 vCPU box just adds context switching.

What RAM each popular library actually needs

Image decoding is memory-hungry in a way that surprises people, because a compressed 4 MB JPEG expands to 36 MB in a raw pixel buffer at 12 MP. Processing several at once multiplies that.

LibraryIdle RAMPer concurrent jobPractical floor
Immich (app + ML optional)~600 MB–1 GB300–500 MB per thumbnail job4 GB (2 GB only without ML)
PhotoPrism~400–700 MB200–400 MB4 GB
PiGallery2 (static-friendly)~100 MB150 MB1 GB
Paperless-ngx (documents)~500 MB–1 GB400 MB per OCR job2–4 GB
Plain Nginx + pregenerated thumbs~50 MBn/a512 MB

The bottom row is the important one. If you can pre-generate derivatives on your laptop or in a build step and serve only static files, the server requirement collapses to half a gigabyte. That is the cheapest option available and it is underused — most people install a full application for what is really a folder of JPEGs.

Split the storage before you split the compute

The usual failure is running out of disk while the CPU sits idle. Cheapest fix, in order:

  • Move originals to object storage and keep derivatives on the VPS. Originals are cold; derivatives are hot. Object storage costs a fraction per GB and the app fetches originals only for downloads or regeneration.
  • Put the database and the library on the same volume only if the volume is fast. A small SQLite or PostgreSQL database for 20,000 rows is a few MB; the images are the sprawl.
  • Prune aggressively. Duplicate detection and “delete originals after confirming sync” typically reclaim 15–25% of a messy library.
  • Do not keep backups of derivatives. They are regenerable. Back up originals and the database only — that can cut backup storage by 80%.

If splitting storage pushes you toward a bigger plan, the object vs block storage cost comparison is worth running before you pay for another 100 GB of block disk.

Three plan shapes that work

Matching the library patterns above to actual tiers:

ScenarioPlan shapeMonthly cost band
Static gallery, pre-generated thumbs1 vCPU / 1 GB / 25 GB$3–$5
Immich or PhotoPrism, 10k images, no ML2 vCPU / 4 GB / 80 GB$8–$14
Immich with face/object ML enabled2–4 vCPU / 8 GB / 160 GB$16–$28
Paperless-ngx document archive2 vCPU / 4 GB / 80 GB$8–$14

The ML rows are where budgets break. Face detection and CLIP embeddings add a persistent process and 1–2 GB of model weights; on a 4 GB box they compete with the database cache and the box swaps continuously. Either budget the RAM or leave ML off — there is no middle setting that works well.

A checklist before you commit

Before choosing a plan, measure your own library rather than estimating:

  • du -sh the originals folder, then multiply by 1.1 for derivatives plus database.
  • Count files. Per-file overhead on ext4 is small but real; 100,000 tiny files in one directory will slow listings regardless of disk speed.
  • Time a bulk import of 100 images on the trial plan and extrapolate — that is your real import window.
  • Decide whether originals live on the VPS or in object storage before you buy disk you cannot shrink.
  • Check that the provider’s snapshot or backup allowance covers the library size; a 43 GB library is not covered by a 10 GB backup add-on.

Run those five steps and the plan choice is arithmetic rather than guesswork — which is the whole point of buying at the budget tier. Current tiers and included disk are listed on our budget VPS pricing page.

Affordable-Vps-Server-Author
Affordable-Vps-Server-Author
Articles: 434

Leave a Reply