Is a whole server worth it for a book collection?
It is when you want the library reachable from everywhere without it living on your laptop. Calibre-Web sits on top of a normal Calibre library (the folder with metadata.db in it) and serves it to browsers, reading apps and Kobo devices, with separate accounts for each person in your household or club.
A small machine is enough for most collections, and the project's README names no memory or core figure; it simply suggests adding resources if things feel slow. Our way of choosing: let the size of the collection pick the disk, and give it more processor only if you plan to convert lots of books on the server. Start from one of the small one-job servers on the dedicated server page, or a larger one with several drives when the collection is big.
- Leave out the ARM X-Gene cartridge: Ubuntu 16.04 or 18.04 are the only systems it runs, and this guide is written for 24.04. If you later choose Docker, note the README says the add-on bringing Calibre's converter into that image works on x64 only.
- A ready server reaches you within 30 minutes after the payment is approved, and the install below starts as soon as you can log in.
- The port is unmetered: friends downloading books never turn into a bandwidth bill.
- Rack servers and blades, plus two cartridge models (m510, m710x), give you a console you open yourself, handy when a bad firewall change cuts off SSH. Elsewhere you get power control alone.
Getting it installed
The README's recommended route is the calibreweb package from pip, installed inside its own virtual environment so it cannot clash with the system's Python (3.7 or newer is required). Here is how that looks on Ubuntu 24.04, with Calibre-Web running as its own unprivileged account and starting at boot through systemd, as the wiki shows. The firewall comes first, so nothing is exposed while you work.
- Paste the block below over SSH. It switches ufw on with SSH allowed (for IPv6 too), installs Python's venv module and ImageMagick (needed for covers from EPUB files), creates the account and installs the app.
- Notice the
-i 127.0.0.1at the end of the start command. That option, documented in the wiki's command-line page, makes the app answer only on the server itself, on its default port 8083. - Check it started with
systemctl status calibre-web.
sudo sed -i 's/^IPV6=.*/IPV6=yes/' /etc/default/ufw
sudo ufw allow OpenSSH
sudo ufw --force enable
sudo apt update && sudo apt install -y python3-venv imagemagick
sudo useradd --system --create-home --home-dir /opt/calibre-web --shell /usr/sbin/nologin calibre
sudo install -d -o calibre -g calibre -m 750 /srv/library
sudo -u calibre bash -c 'cd /opt/calibre-web && python3 -m venv env && env/bin/pip install calibreweb'
sudo tee /etc/systemd/system/calibre-web.service > /dev/null <<'EOF'
[Unit]
Description=Calibre-Web
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=calibre
Group=calibre
ExecStart=/opt/calibre-web/env/bin/cps -i 127.0.0.1
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now calibre-web
Swap the default password while only you can see it
Every fresh install accepts admin with the password admin123, as the README states, so that login must never meet the open internet. Because the app only listens on the server itself, you reach it by forwarding a port through your personal SSH account: run ssh -L 8083:127.0.0.1:8083 yourname@your.server.ip on your computer, browse to http://localhost:8083, sign in and give the admin account a strong new password.
While you are there, open the database settings on the admin page and fill in Location of Calibre database with /srv/library. Type the folder, not the file: the wiki says the name metadata.db must not be part of the path. To fill the folder, send your current library up with rsync or scp, place it in /srv/library and hand it to the app with sudo chown -R calibre:calibre /srv/library. Starting from nothing? There is a sample metadata.db linked from the README to begin with.
Keep Calibre on your desktop away from the copy on the server. The wiki's FAQ explains that whichever program opens metadata.db first can block the other, and that edits from both at the same moment give unpredictable results.
Let your readers in from anywhere, safely
For a server on the internet, the wiki's own advice is to never let Calibre-Web listen on 0.0.0.0 and to always use TLS, ideally with nginx in front holding a certificate from Let's Encrypt. The block below sets that up. nginx is an ordinary program on the server, so ufw must admit ports 80 and 443 to it. The header lines mirror the wiki's nginx sample; the bigger buffer sizes are what its proxy page suggests when Kobo devices sync; the 200M upload size is our pick, set to the app's own limit.
sudo apt install -y nginx certbot python3-certbot-nginx
sudo ufw allow 80,443/tcp
sudo tee /etc/nginx/sites-available/books > /dev/null <<'EOF'
server {
listen 80;
listen [::]:80;
server_name library.example.com;
client_max_body_size 200M;
location / {
proxy_pass http://127.0.0.1:8083;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
}
EOF
sudo ln -s /etc/nginx/sites-available/books /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d library.example.com
The wiki gets the certificate first and adds the proxy location afterwards; putting the location in before certbot, as here, is our shortcut. Whichever order you use, wait for certbot to finish before you sign in through your domain, because until then the site is plain HTTP. If you would rather have a point-and-click proxy, our Nginx Proxy Manager guide covers that route.
Reading on phones, e-readers and Kobos
Reading apps connect through OPDS, a catalogue address at /opds on your domain. The wiki's FAQ lists apps the maintainer has tried, such as KOReader, Librera Reader and FBReader, and mentions that a few only fetch covers or files when anonymous browsing is turned on. We would leave anonymous browsing off on a public site and choose an app that asks for your login, rather than the documented trick of putting your password inside the catalogue link, which lands it in your server logs.
Kobo owners can sync too. Prepare two pieces: the kobo extra, named among the optional pip features in the wiki (sudo -u calibre bash -c "cd /opt/calibre-web && env/bin/pip install 'calibreweb[kobo]'"), and kepubify, which the README calls necessary for Kobo devices and places at /opt/kepubify; enter that location in the kepubify path setting. After that, the wiki's Kobo page has you switch on Enable Kobo sync, allow downloads for the user, create a sync link on your profile page and paste it as the api_endpoint line in the Kobo eReader.conf file on the device. Read its warnings first: the feature is fairly new with limited testing, big libraries may time out, PDFs are skipped, and the device sends a permanent id pair that HTTPS keeps private.
Adding books and converting formats
Uploads stay hidden until an admin ticks Enable Uploading in Basic Configuration. Then you can drag files onto the page; the accepted list in the wiki runs from EPUB, MOBI and PDF to comic archives and audio such as M4B. The FAQ gives the app's built-in server a 200 MB ceiling per upload, and a proxy that allows less will refuse larger files with a 413 error.
Turning an EPUB into another format is Calibre's job, through its ebook-convert program. Install Calibre on the server following Calibre's own instructions and enter its folder under Path to Calibre Binaries; the wiki puts it at /opt/calibre on Linux in most cases. One caution from the FAQ: the in-browser reader runs the HTML and scripts inside an EPUB, so only give upload rights to people you trust.
Keeping your library safe
You manage the server; we keep the hardware and the network running, so backups are yours to set up. Save three things: the library folder, the app.db settings file (for a pip install it lives in the .calibre-web folder of the account running the app, per the wiki), and, if you store books on Google Drive, gdrive.db, settings.yaml and gdrive_credentials, which the FAQ adds to the list. This script makes safe copies of both databases every night and keeps a week of them (our choice):
sudo apt install -y sqlite3
sudo tee /usr/local/sbin/books-backup.sh > /dev/null <<'EOF'
set -eu
umask 077
mkdir -p -m 700 /var/backups/books
OUT="/var/backups/books/$(date +%F)"
mkdir -p "$OUT"
CONF=/opt/calibre-web/.calibre-web
sqlite3 /srv/library/metadata.db ".backup '$OUT/metadata.db'"
sqlite3 "$CONF/app.db" ".backup '$OUT/app.db'"
for f in gdrive.db settings.yaml gdrive_credentials; do
if [ -e "$CONF/$f" ]; then cp -p "$CONF/$f" "$OUT/"; fi
done
tar -C /srv --exclude=library/metadata.db -czf "$OUT/library.tar.gz" library
find /var/backups/books -mindepth 1 -maxdepth 1 -type d -mtime +7 -exec rm -rf {} +
EOF
printf '%s\n' '40 2 * * * root umask 077; bash /usr/local/sbin/books-backup.sh >> /var/log/books-backup.log 2>&1' | sudo tee /etc/cron.d/books-backup
A copy on the same disks will not survive a lost disk, so fetch the dated folders to another computer on a schedule. Restoring starts with stopping the service and checking: the dated folder must contain library.tar.gz, metadata.db and app.db, and sqlite3 metadata.db 'PRAGMA integrity_check' (then the same for app.db) must answer ok. Only then rename /srv/library out of the way, unpack the archive into /srv, put the two databases back, give everything to the calibre user and start the service.
For updates, the admin page has a built-in updater with a stable channel (the default) and a nightly one. Since you installed with pip, we suggest updating the same way: stop the service, run the backup, then sudo -u calibre bash -c 'cd /opt/calibre-web && env/bin/pip install --upgrade calibreweb' and start it again.
Docker and the licence, in short
Searching for a Calibre-Web Docker image leads to LinuxServer.io's, which is the one the README mentions; it is maintained by that community, not by the Calibre-Web project. If you go that way, map it to 127.0.0.1:8083:8083. Without an address Docker opens it on every address the host has (0.0.0.0 and [::]); IPv4 traffic to it bypasses ufw, and IPv6 traffic does the same if the Docker daemon manages IPv6 itself (otherwise docker-proxy answers on [::], and ufw filters that). From Docker Engine 28 on, the 127.0.0.1 binding is truly local.
Calibre-Web's licence is the GNU GPL v3, according to the LICENSE file in the repository. As a general reading and not legal advice: hosting it for yourself and your readers is not distributing it, while giving copies to others, changed or unchanged, means passing the source along under the same licence.
If what you collect is audiobooks rather than ebooks, Audiobookshelf is built for that, and scanned paperwork belongs in Paperless-ngx.
Questions people ask
- What are the username and password on a new install?
- admin and admin123, according to the README. Change them through an SSH tunnel while the app only listens on 127.0.0.1, before any domain points at it.
- Which port should I open for Calibre-Web?
- None for the app itself. It listens on 8083 by default, and in this setup only nginx talks to it; the firewall opens 80 and 443 for nginx and nothing else besides SSH.
- I forgot the admin password. Can I get back in?
- Yes. Another admin can set a new one, and otherwise the wiki FAQ says to stop the app and start it once with -s followed by user:newpassword, which changes the password and exits. Run it as the calibre account so it edits the right settings file. Any password given on the command line can be read by anyone listing processes, and stays in your shell history, so set a fresh one in the web page afterwards.
- Can my family each have their own account?
- Yes. Admins create users with their own permissions, and the wiki shows how to hide books from some users by tag or custom column. On a shared site, don't link the read/unread flag to a Calibre column; the wiki says that only works for a single user.
- Will my Kindle work with it?
- Calibre-Web can email a book to a Kindle, Pocketbook or other device address once you fill in the mail server settings in its admin section; the wiki has a page on that setup. To browse the catalogue from a device instead, use an OPDS reading app, or Kobo sync on a Kobo.