Set up a local Calibre library
Install Calibre
At the time of writing (March 2022), this works better on Raspbian Buster, than the latest release Bullseye, which is still in testing mode. Make sure you choose Buster for stable results.
After flashing an SD card with your Raspbian Buster OS, we should update and then install Calibre.
sudo apt update
sudo apt install calibre
create library and add a book
The location of the directory will be in my home folder, which is /home/simoon.
mkdir calibre-library
wget http://www.gutenberg.org/ebooks/46.kindle.noimages -O christmascarol.mobi
Then, we use calibredb to add the book to our library
calibredb add *.mobi --with-library calibre-library/
You should get a message saying "1 book added".
Next, we're going to use calibre-server to start the service.
calibre-server calibre-library