Calibre-Web in Docker
Skip the setup and get CalibreWeb "ElfHosted"!
Want to skip the self-assembly, and have CalibreWeb INSTANTLY "Just Workβ’"?
ElfHosted is an open-source app hosting platform (geek-cookbook-as-a-service), crafted with love by @funkypenguin - get your ElfHosted instance of CalibreWeb now!
The AutoPirate recipe includes Lazy Librarian, a tool for tracking, finding, and downloading eBooks. However, after the eBooks are downloaded, Lazy Librarian is not much use for organising, tracking, and actually reading them.
Calibre-Web could be described as "Plex (or Emby) for eBooks" - it's a web-based interface to manage your eBook library, screenshot below:
Of course, you probably already manage your eBooks using the excellent Calibre, but this is primarily a (powerful) desktop application. Calibre-Web is an alternative way to manage / view your existing Calibre database, meaning you can continue to use Calibre on your desktop if you wish.
As a long-time Kindle user, Calibre-Web brings (among others) the following features which appeal to me:
- Filter and search by titles, authors, tags, series and language
- Create custom book collection (shelves) Support for editing eBook metadata and deleting eBooks from Calibre library
- Support for converting eBooks from EPUB to Kindle format (mobi/azw)
- Send eBooks to Kindle devices with the click of a button
- Support for reading eBooks directly in the browser (.txt, .epub, .pdf, .cbr, .cbt, .cbz)
- Upload new books in PDF, epub, fb2 format
Calibre-Web Requirements
Ingredients
Already deployed:
- Docker swarm cluster with persistent shared storage
- Traefik configured per design
- DNS entry for the hostname you intend to use (or a wildcard), pointed to your keepalived IP
Related:
- Traefik Forward Auth or Authelia to secure your Traefik-exposed services with an additional layer of authentication
Preparation
Setup data locations
We'll need a directory to store some config data for Calibre-Web, container, so create /var/data/calibre-web, and ensure the directory is owned by the same use which owns your Calibre data (below)
mkdir /var/data/calibre-web
chown calibre:calibre /var/data/calibre-web # for example
Ensure that your Calibre library is accessible to the swarm (i.e., exists on shared storage), and that the same user who owns the config directory above, also owns the actual calibre library data (including the ebooks managed by Calibre).
Prepare Calibre-Web environment
Create /var/data/config/calibre-web/calibre-web.env
, and populate with the following variables
PUID=
PGID=
Calibre-Web Docker Swarm config
Create a docker swarm config file in docker-compose syntax (v3), something like the example below:
Fast-track with premix! π
"Premix" is a git repository which includes necessary docker-compose and env files for all published recipes. This means that you can launch any recipe with just a git pull
and a docker stack deploy
π.
π Update: Premix now includes an ansible playbook, enabling you to deploy an entire stack + recipes, with a single ansible command! (more here)
version: '3'
services:
app:
image: technosoft2000/calibre-web
env_file : /var/data/config/calibre-web/calibre-web.env
volumes:
- /var/data/calibre-web:/config
- /srv/data/Archive/Ebooks/calibre:/books
networks:
- internal
- traefik_public
deploy:
labels:
# traefik common
- traefik.enable=true
- traefik.docker.network=traefik_public
# traefikv1
- traefik.frontend.rule=Host:calibre.example.com
- traefik.port=8083
# traefikv2
- "traefik.http.routers.calibre.rule=Host(`calibre.example.com`)"
- "traefik.http.services.calibre.loadbalancer.server.port=8083"
- "traefik.enable=true"
# Remove if you wish to access the URL directly
- "traefik.http.routers.calibre.middlewares=forward-auth@file"
networks:
traefik_public:
external: true
internal:
driver: overlay
ipam:
config:
- subnet: 172.16.18.0/24
Note
Setup unique static subnets for every stack you deploy. This avoids IP/gateway conflicts which can otherwise occur when you're creating/removing stacks a lot. See my list here.
Serving
Launch Calibre-Web
Launch the Calibre-Web stack by running docker stack deploy calibre-web -c <path -to-docker-compose.yml>
Log into your new instance at https://**YOUR-FQDN**
. You'll be directed to the initial GUI configuraition. Set the first field (Location of Calibre database) to "/books/", and when complete, login using defaults username of "admin" with password "admin123".
Chef's notes π
-
Yes, Calibre does provide a server component. But it's not as fully-featured as Calibre-Web (i.e., you can't use it to send ebooks directly to your Kindle)Β β©
-
A future enhancement might be integrating this recipe with the filestore for NextCloud, so that the desktop database (Calibre) can be kept synced with Calibre-Web.Β β©
-
If you plan to use calibre-web to send
.mobi
files to your Kindle via@kindle.com
email addresses, be sure to add the sending address to the "Approved Personal Documents Email List"Β β©
Tip your waiter (sponsor) π
Did you receive excellent service? Want to compliment the chef? (..and support development of current and future recipes!) Sponsor me on Github / Ko-Fi / Patreon, or see the contribute page for more (free or paid) ways to say thank you! π
Employ your chef (engage) π€
Is this too much of a geeky PITA? Do you just want results, stat? I do this for a living - I'm a full-time Kubernetes contractor, providing consulting and engineering expertise to businesses needing short-term, short-notice support in the cloud-native space, including AWS/Azure/GKE, Kubernetes, CI/CD and automation.
Learn more about working with me here.
Flirt with waiter (subscribe) π
Want to know now when this recipe gets updated, or when future recipes are added? Subscribe to the RSS feed, or leave your email address below, and we'll keep you updated.