Self-hosted eBook library with Komga
After weeks of using Audiobookshelf to listen to audiobooks daily, it dawned on me that the PDF reader was probably not the best I could be using.
Then is also dawned on me that Audible is not my only source of eBooks; I have a few from HumbleBundle deals and a few indipendent authors who sell PDF files directly, as well as a small collection of appliance manuals and electronics datasheets. All these files have been scattered all over the place, never having a common home where they could all be conveniently navigated and read.
Until now. Enter... Komga.
Komga is described as a media server for your comics, mangas, BDs, magazines and eBooks. Most importantly, for me, is that it handles individual books, file names and metadata better than a few others.
Installation
To deploy Komga in Kubernetes, the setup is essentially a fork of Audiobookshelf deployment.
A single phisical volume to store the application's databases is
needed, while the books are read from /home/depot/books/:
Once the directories and files a ready, we run Komga as the same
non-privileged user as Audiobookshelf, based on
Komga's docker-compose:
Kubernetes deployment: komga.yaml
| komga.yaml | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
$ kubectl apply -f komga.yaml
namespace/komga created
persistentvolume/komga-pv-config created
persistentvolume/komga-pv-books created
persistentvolumeclaim/komga-pvc-config created
persistentvolumeclaim/komga-pvc-books created
deployment.apps/komga created
service/komga-svc created
ingress.networking.k8s.io/komga-ingress created
$ kubectl -n komga get all
NAME READY STATUS RESTARTS AGE
pod/komga-5c865d6587-tvlt2 1/1 Running 0 28s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/komga-svc NodePort 10.103.226.126 <none> 25600:30600/TCP 8s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/komga 1/1 1 1 29s
NAME DESIRED CURRENT READY AGE
replicaset.apps/komga-5c865d6587 1 1 1 28s
Configuration
Once the application is running for the first time, register an
account (which will be the administrator) and start creating
libraries based on the files available under /data.
When creating libraries in Komga, an important step if there are individual books, is to put then under one (or more) directories that will be recognized as One-Shots.
My libray is rather small and exclusively made ouf of one-shots, although I found it useful to store a few files as a kind of series:
- Art and LEGO: eBooks from HumbleBundle deals.
- Audible: visual aids (PDF files) from Audible.
- Cosplay: books from Kamui Cosplay and Punished Props
- Including a couple of sets of templates, which make sense to store as kind of small series.
- Terry Pratchett: a small collection of Discworld Fanfics, mirrored at home just for convenience.
These are organized under the /data volume as follows:
/data/Art/books/
/data/Audible/books/
/data/Cosplay/books/
/data/Cosplay/templates/Jade Rabbit/
/data/Cosplay/templates/Ripper Axe/
/data/LEGO/books/
/data/Terry.Pratchett/books/
All individual books are stored under a books subdirectory under
each library directory, and then this name is set as the
One-Shots directory for every library:
Alternatives
Komga is not the only Free Software application available for this purpose, so it is worth mentioning why it was chosen over the alternatives.
Priot to setting up Komga, I spent some time trying the same with kavitareader.com. The Kubernetes deployment was essentially the same, based on linuxserver.io/images/docker-kavita. The main drawback that kept me from using this one long-term was that it really is built for series and really not for individual books.
Admitedly, that was the only one I tried among other alternatives mentioned here. Others include:
- Calibre Web, available as janeczku/calibre-web or linuxserver/calibre-web. It only supports a single library and requires using the Calibre desktop application. While this wouldn't be a problem for myself, it would prevent kids from reading the books because they only have school laptops where Calibre cannot be installed.
- Librum could be a good option, were it not for a similar requirement to install and run a client application. This is not a web app.

