Deploy Grimmory — Self-Hosted Digital Library on Railway
Self-host Grimmory: ebooks, comics & audiobooks with Kobo sync. Free.
Deploy Grimmory
Just deployed
/booklore-data
Mariadb
Just deployed
Deploy and Host Grimmory Digital Library on Railway
Grimmory is the open-source successor to BookLore — a self-hosted digital library for people who take their reading seriously. Smart rule-based shelves, automatic metadata lookup from Google Books and Open Library, a built-in in-browser reader with annotations and highlights, Kobo and KOReader sync, OPDS support, BookDrop automated ingestion, and multi-user accounts with OIDC authentication. Supports EPUB, MOBI, AZW3, PDF, CBZ/CBR comics, and audiobooks (M4B, MP3) from a single library.
This template deploys Grimmory v2.3.0 with a private MariaDB sidecar — pinned to a stable release tag, pre-wired on Railway's private networking, with persistent volumes for app data and database storage.
What This Template Deploys
| Service | Purpose |
|---|---|
| Grimmory v2.3.0 | The digital library application — web UI, built-in reader, metadata engine, device sync endpoints, and OPDS catalog server on port 6060 |
| MariaDB 11.4 | Private database sidecar — stores library metadata, user accounts, reading progress, annotations, and shelf configurations with persistent volume at /var/lib/mysql |
App Volume (/app/data) | Persistent storage for Grimmory runtime data, cover images, and library state — survives every redeploy |
MariaDB runs as a private sidecar accessible only over Railway's internal network — the database port is never exposed publicly. Only the Grimmory web UI is accessible from your Railway public domain.
About Hosting Grimmory
Running Grimmory in production requires coordinating the application server and a MariaDB database with private networking, persistent volumes for both services, and a public HTTPS endpoint for browser access, device sync, and OPDS catalog requests. Without a managed host, you're configuring Docker Compose, inter-service networking, SSL, and volume mounts manually.
This template pins Grimmory to v2.3.0 rather than a floating latest tag, keeps
database traffic on private networking, and pre-configures both volumes at deploy time.
Library metadata, reading progress, annotations, and user accounts survive every redeploy.
Typical cost: ~$5–10/month on Railway's Hobby plan. Kindle Unlimited costs $9.99/month with no ownership of the books. Grimmory is free — your library is yours permanently.
Deploy in Under 5 Minutes
- Click Deploy on Railway — Grimmory and MariaDB build and wire automatically (~3–5 min)
- Set
DB_PASSWORDandMYSQL_ROOT_PASSWORDto strong random strings in the Variables tab - Open your Railway-assigned URL — the Grimmory setup wizard loads immediately on port
6060 - Create your admin account and connect your library by uploading books or configuring BookDrop to watch an upload folder
- Connect your Kobo, configure OPDS in your reader app, or open books directly in the browser
No SSH. No Docker Compose. No manual database configuration.
Common Use Cases
- Self-hosted alternative to Kindle Unlimited — own your library permanently; read EPUB, MOBI, AZW3, PDF, and comics in the browser without a subscription or Amazon account
- BookLore migration to Grimmory — Grimmory is the direct successor to BookLore and auto-migrates existing MariaDB data on first start; same database format, no data loss
- Self-hosted alternative to Kavita — get the same self-hosted reading experience with the addition of Kobo sync, audiobook support, OIDC authentication, and BookDrop ingestion
- Kobo and KOReader library server — Grimmory exposes a Kobo-compatible sync endpoint and OPDS catalog; connect your e-reader once and your entire library is available offline
- Family or team shared library — multi-user accounts with separate shelves, reading progress, and preferences per user; local authentication or OIDC SSO for organisation use
- Automated book ingestion pipeline — drop EPUB, PDF, or CBZ files into the BookDrop watched folder; Grimmory detects the file, fetches metadata from Google Books and Open Library, and queues it for your review automatically
Configuration
| Variable | Required | Description |
|---|---|---|
DB_PASSWORD | ✅ Required | MariaDB password for the Grimmory app user — set a strong random string |
MYSQL_ROOT_PASSWORD | ✅ Required | MariaDB root password — set a strong random string, used only for database bootstrap |
DATABASE_URL | ✅ Auto-configured | MariaDB JDBC connection string — pre-wired to the Railway internal MariaDB service |
DB_USER | Pre-set | grimmory — the MariaDB application user |
APP_USER_ID | Optional | UID for the Grimmory process — defaults to 1000 |
APP_GROUP_ID | Optional | GID for the Grimmory process — defaults to 1000 |
TZ | Optional | Timezone — e.g. Europe/London, Asia/Kolkata. Defaults to Etc/UTC |
DISK_TYPE | Optional | LOCAL (default) or NETWORK for NFS/SMB mounts — disables destructive file ops on network shares |
API_DOCS_ENABLED | Optional | Set to true to enable Swagger API docs at /swagger-ui.html |
OIDC_ISSUER_URI | Optional | OIDC provider issuer URL for SSO — Google, Auth0, Keycloak |
OIDC_CLIENT_ID | Optional | OIDC client ID — required if using SSO |
OIDC_CLIENT_SECRET | Optional | OIDC client secret — required if using SSO |
Grimmory vs. Alternatives
| Grimmory | Kavita | Calibre-Web | Jellyfin (books) | |
|---|---|---|---|---|
| EPUB, PDF, Comics | ✅ Yes | ✅ Yes | ✅ Yes | ⚠️ Limited |
| Audiobook support | ✅ M4B, MP3, OPUS | ❌ No | ❌ No | ✅ Yes |
| Kobo sync | ✅ Native | ✅ Yes | ⚠️ Plugin | ❌ No |
| KOReader sync | ✅ Yes | ❌ No | ❌ No | ❌ No |
| OPDS catalog | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
| Automated metadata | ✅ Google Books + Open Library + Amazon | ⚠️ Manual | ✅ Calibre | ❌ No |
| BookDrop auto-ingestion | ✅ Watched folder | ❌ No | ❌ No | ❌ No |
| Smart rule-based shelves | ✅ Yes | ⚠️ Collections only | ❌ No | ❌ No |
| OIDC/SSO | ✅ Yes | ✅ Yes | ⚠️ Plugin | ✅ Yes |
| BookLore migration | ✅ Auto-migrates | ❌ No | ❌ No | ❌ No |
Dependencies for Grimmory Hosting
- Railway account — Hobby plan (~$5–10/month) covers both services and volumes
- Your book files — EPUB, MOBI, AZW3, PDF, CBZ/CBR comics, or M4B/MP3 audiobooks
- Optional: Kobo e-reader, KOReader device, or any OPDS-compatible reader app
Deployment Dependencies
- Grimmory GitHub Repository — source and releases
- Grimmory Documentation — full configuration reference
- Grimmory Quick Start — setup and OIDC guide
- Railway Volumes Documentation — persistent storage setup
Implementation Details
This template deploys grimmory/grimmory:v2.3.0 alongside mariadb:11.4 as a private
sidecar — database port never exposed publicly. App data is on the /app/data volume;
MariaDB data on /var/lib/mysql. Both persist independently of their containers. The
healthcheck polls GET /api/v1/healthcheck before Railway routes traffic. BookLore users:
Grimmory auto-migrates existing MariaDB schema on first start, no manual steps required.
Frequently Asked Questions
Is Grimmory the same as BookLore? Grimmory is the direct community successor to BookLore. BookLore was removed from GitHub without notice, and the community forked it as Grimmory to continue development. Grimmory auto-migrates existing BookLore MariaDB data on first start — no manual migration steps needed. The two share the same database format.
What file formats does Grimmory support? EPUB, MOBI, AZW, AZW3, FB2, PDF, CBZ, CBR, CB7 (comics), M4B, M4A, MP3, and OPUS (audiobooks). It is one of the broadest format lists of any self-hosted library manager, covering ebooks, comics, and audiobooks in a single application.
How much does it cost to run Grimmory on Railway? Approximately $5–10/month on Railway's Hobby plan for the Grimmory app and MariaDB sidecar. Grimmory is free and open-source — you pay only Railway compute. Kindle Unlimited costs $9.99/month with no ownership of the books. Your Grimmory library is yours permanently.
Do I lose my library data and reading progress if Railway redeploys?
No. Library metadata, user accounts, reading progress, and annotations are stored in the
MariaDB volume at /var/lib/mysql. App data and cover images are stored on the /app/data
volume. Both persist independently of their containers — redeploys and version updates do
not affect your data.
How do I connect my Kobo or use OPDS? In Grimmory settings, find the device sync section and copy your personal Kobo sync URL. Enter it in your Kobo's library settings. For OPDS, use your Railway public URL as the OPDS catalog endpoint in any compatible reader app (Kybook, Moon+ Reader, Chunky, Marvin, etc.).
Can I use Grimmory with OIDC for single sign-on?
Yes. Set OIDC_ISSUER_URI, OIDC_CLIENT_ID, and OIDC_CLIENT_SECRET in Railway Variables.
Grimmory supports any OIDC-compatible provider — Google Workspace, Auth0, Keycloak, and
Authentik are all documented in the Grimmory self-hosting guide.
Why Deploy Grimmory on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Grimmory on Railway, you get a production-ready self-hosted digital library — private MariaDB on internal networking, persistent volumes for data and database, a pinned stable release, and automatic HTTPS — at ~$5–10/month with full ownership of your books, annotations, and reading history.
Template Content
Deploy Grimmory
sahilrupani/grimmoryMariadb
mariadb:latest