HeadlinesBriefing favicon HeadlinesBriefing.com

Self-Hosted Ebook Library on Cloudflare R2 or Node

Hacker News •
×

GitHub user murerkinn released bookshelf, a self-hosted ebook library that runs without a database. It serves EPUB and PDF files with dedicated browser readers, search, and download features. The project offers two deployment paths: a Cloudflare Worker over R2 object storage, or a Node server over a local directory. Both are configured via `bookshelf.config.json`.

Getting started requires Node 24+ and a Unix-like system. The quickest route uses Docker: `mkdir books && cp ~/Downloads/*.epub books/` followed by `docker compose run --rm sync --create` and `docker compose up -d`. The shelf becomes available at `http://localhost:3000`. A named volume `library` stores published books, profiles, and reading positions — the only data needing backup. For non-Docker setups, users run `npm run sync -- --create`, `npm run build`, and `npm start -w @bookshelf/app`.

Cloudflare deployment requires an account and `npx wrangler login`. Commands `npm run sync -- --create` and `npm run deploy` create the R2 bucket and upload the Worker. A `npm run demo` command generates nine public-domain titles for testing. Public instances automatically disable writes (profiles, reading positions) while preserving read access. No authentication is built in; the author advises deploying on trusted networks or behind access controls.