A quick guide to create and host your own encrypted ebook library.
- Download the prebuilt
librarybinary for your platform from Releases - Or, clone the repository to build from source (see Building from Source)
git clone https://github.com/Auchrio/OpenLibrary
cd OpenLibrary- Create a folder with your ebook files — supported formats: EPUB, MOBI, AZW3, PDF
- The CLI will automatically:
- Extract title, author, and series info from EPUB/MOBI/AZW3 metadata
- Use PDF Info metadata (title, author) for standalone PDFs, falling back to the filename
- Render the first page of a standalone PDF as a cover image (requires
pdftoppm,mutool, orconvert— see PDF cover generation) - Detect multi-format variants of the same book (e.g. an EPUB and PDF with the same filename)
- Assign unique encryption keys per book
Tip: For the best results, always include an EPUB version where available — EPUB metadata and cover extraction is the most reliable.
~/my-books/
├── book1.epub ← full metadata + cover from EPUB
├── book2.epub
├── book2.pdf ← attached as a second format alongside the EPUB
├── standalone.pdf ← PDF-only: title from metadata/filename, cover from first page
└── book3.mobi ← only included if a matching book3.epub exists
Run the library binary to generate encrypted library files:
./library <input-folder> <output-folder> [encryption-key]Or on Windows:
library.exe <input-folder> <output-folder> [encryption-key]Public library (no password):
./library ~/my-books ~/my-library-outputPassword-protected library:
./library ~/my-books ~/my-library-output "my-secret-password"This produces:
lib.json— encrypted index + metadata<uuid>.enc— encrypted book files<uuid>-cover.enc— encrypted cover images
If you wish to contribute your library to the public index, please ensure that it is not password protected, and you select yes when asked if you wish to include the netowork index in your library.
- Create a public GitHub repository (e.g.,
my-library) - Copy all files from your output folder to the repository root
- Commit and push to
main - Your library URL:
github:<Username>/my-library
Any host works (Cloudflare R2, nginx, Caddy, etc.) as long as:
- The URL resolves to the folder containing
lib.json - The host sends CORS headers:
Access-Control-Allow-Origin: *
- Open index.html in your browser
- Click 📚 Sources (top-right)
- Click + Add New Source
- Paste your library URL
- Click Preview → Import
Done! Your books are now accessible through OpenLibrary.
Share your library publicly:
- Open a GitHub issue titled:
[Library] Your Library Name - Include:
- Library name
- Full URL
- Brief description
- Formats included (epub, mobi, pdf)
- Encryption type (0 = public, 1 = password)
See INDEX.md for details and existing libraries.
For standalone PDF files, the CLI attempts to render the first page as a cover image using one of the following tools. Install whichever is most convenient for your system:
| Tool | Install (Linux) | Install (Windows) |
|---|---|---|
| pdftoppm (Poppler) | sudo apt install poppler-utils |
Poppler for Windows |
| mutool (MuPDF) | sudo apt install mupdf-tools |
MuPDF Downloads |
| convert (ImageMagick) | sudo apt install imagemagick |
ImageMagick Download |
If none of these tools are installed, the PDF will still be indexed and downloadable — it just won't have a cover image.
- "CORS error" — Your host must send
Access-Control-Allow-Origin: *headers - "Failed to decrypt" — Ensure the correct password (if any) is entered when adding the source
- Missing covers on PDFs — Install
pdftoppm,mutool, orconvert(see PDF cover generation) - PDF shows "Unknown" author — The PDF's Info dictionary doesn't contain author metadata; rename the file or edit the PDF metadata
For more details, see TECHNICALS.md.
If you prefer to build the library binary yourself instead of downloading a prebuilt release:
- Go 1.21 or later — Download
- This repository cloned locally
# For your current OS/architecture
go build -o library library.goThen use ./library (or library.exe on Windows) as above.