// HACKER NEWS — CYBERSECURITY
Bookshelf – Self-hosted eBook library that runs on object storage
A self-hosted library for the ebooks you already own. One server-rendered page
lists them, filters them with a search box, serves downloads, and reads them in
the browser — EPUB and PDF, each with its own reader — as a Cloudflare Worker
over R2, or as a Node server over a directory on disk.
Everything above is npm run demo — a generated shelf of public-domain titles,
so the screenshots can be reproduced without finding books first.
Node 24 or newer, and a Unix-like system: the sync tool finds its image tools
with which, so Windows is not supported. Covers come out better with cwebp
and pdftoppm installed — see publishing, or use
Docker, which ships both.
Put some books — EPUB or PDF — in books/, then choose where the library
should live.
The shortest path, and the image brings its own cwebp and pdftoppm so
covers come out right without installing anything on the host.
The shelf is then on http://localhost:3000. Flags pass through, so
docker compose run --rm sync --force and --dry-run behave as they do
locally.
One named volume, library, holds the published books and everything the app
writes to them — profiles and reading positions — so it is the only thing to
back up.
The image is built for the filesystem provider: it is a Node server, and
Cloudflare needs no container. It runs as a non-root user, and creates /data
owned by that user so a named volume inherits an ownership the app can write
to. If you would rather bind-mount a host directory, chown it first:
No account anywhere. Point bookshelf.config.json at a directory, publish into
it, and run the app:
library/ is the tree the sync tool builds; directory is where it publishes
to, and it holds the books being served. Keep it out of the repository —
shelf-data/ already is.