VPSFolio

2026-12-05 · calibre-web · docker · ebooks · self-hosting

Self-Host Calibre-Web with Docker: A Production Guide

Deploy Calibre-Web in Docker to serve your Calibre eBook library with a clean web UI, OPDS feeds, and Kobo sync behind HTTPS.

Bench run · 2026-12-05 Verified
janeczku/calibre-web
Total RAM
148.9 MB
Startup
87.3 s
Port
8083
HTTP
302
lscr.io/linuxserver/calibre-web:latest · 1 container · janeczku/calibre-web

What Calibre-Web does and what it needs

Calibre-Web is a Flask app that puts a clean, responsive web interface in front of an existing Calibre library. It reads the metadata.db SQLite file that Calibre writes, then serves browsing, search, in-browser reading, OPDS feeds for e-reader apps, Kobo sync, and per-user permissions. It does not manage your library files itself — Calibre (or a Calibre-compatible tool) owns the directory, and Calibre-Web reads from it.

The upstream project does not publish a minimum RAM figure. Practical memory use scales with concurrent readers, cover thumbnail generation, and whether you enable the optional Calibre layer for on-the-fly conversion. A small personal library idles in the low hundreds of MB; heavy conversion jobs and large OPDS crawls push it higher.

You need:

  • A Calibre library directory containing metadata.db and the author/book folders, mounted read-write so Calibre-Web can update metadata and uploads.
  • A persistent config volume for the app database, settings, and logs.
  • Imagemagick for EPUB cover extraction (bundled in the LinuxServer image).
  • Optional: the Calibre ebook-convert binary via the linuxserver/mods:universal-calibre Docker mod (x64 only).

Prerequisites, ports, and volume constraints

  • Docker Engine 24+ and the Compose v2 plugin.
  • A host directory holding your Calibre library. If you do not have one yet, create a minimal library with Calibre desktop, or download the sample metadata.db from the repo and place it in an empty directory. Do not put the library inside the Calibre-Web config volume — updates and backups treat them differently.
  • Port 8083 is the documented HTTP port. In this guide it binds to 127.0.0.1:8083 so only a local reverse proxy can reach it.
  • Two volumes: one for /config (app state) and one bind mount for the Calibre library at /books. The library path must be writable by UID/GID 911 (the LinuxServer abc user) or you must set PUID/PGID to match your host user.
  • No database or cache container is required — Calibre-Web uses SQLite internally.

Production Docker Compose setup

Create the project directory and the .env file first. Generate a strong admin password and a Flask secret; do not reuse the upstream admin/admin123 defaults.

mkdir -p /opt/calibre-web && cd /opt/calibre-web
cat <<'EOF' > .env
TZ=UTC
PUID=1000
PGID=1000
CALIBRE_LIBRARY=/srv/calibre-library
ADMIN_PASSWORD=__ADMIN_PASSWORD__
FLASK_SECRET=__FLASK_SECRET__
DOCKER_MODS=linuxserver/mods:universal-calibre
EOF
sed -i "s|__ADMIN_PASSWORD__|$(openssl rand -hex 16)|" .env
sed -i "s|__FLASK_SECRET__|$(openssl rand -hex 32)|" .env
cat .env

Point CALIBRE_LIBRARY at the host directory that contains metadata.db. The DOCKER_MODS line pulls the Calibre layer; drop it if you want the lightweight image and do not need ebook-convert.

Now write compose.yml:

cat <<'EOF' > compose.yml
services:
  calibre-web:
    image: lscr.io/linuxserver/calibre-web:latest
    container_name: calibre-web
    restart: unless-stopped
    environment:
      - TZ=${TZ:-UTC}
      - PUID=${PUID:-1000}
      - PGID=${PGID:-1000}
      - DOCKER_MODS=${DOCKER_MODS:-}
    ports:
      - "8083:8083"
    volumes:
      - calibre-web-config:/config
      - calibre-library:/books
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8083/"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
volumes:
  calibre-web-config:
  calibre-library:
EOF
docker compose up -d
docker compose logs -f calibre-web

Wait for the log line indicating the app is listening on 0.0.0.0:8083. Then open http://127.0.0.1:8083 through an SSH tunnel (ssh -L 8083:127.0.0.1:8083 user@vps) and complete the first-run wizard:

  1. Log in with admin / admin123.
  2. Change the admin password immediately to the value in ADMIN_PASSWORD.
  3. Set Location of Calibre database to /books and save.
  4. Under Basic Configuration, set Server Port to 8083 and Enable Reverse Proxy Authentication only if you actually front it with an auth proxy.
  5. If you enabled the Calibre mod, set Path to Calibre Binaries to /usr/bin and Path to Unrar to /usr/bin/unrar.

Reverse proxy, HTTPS, and first-run hardening

Calibre-Web serves plain HTTP and expects a proxy to terminate TLS. It reads X-Forwarded-Proto and X-Forwarded-For, so set both. It also streams downloads and OPDS responses, so disable proxy buffering for large files and raise the body size limit for uploads.

Caddy example (/etc/caddy/Caddyfile):

books.example.com {
  encode gzip
  reverse_proxy 127.0.0.1:8083 {
    header_up X-Forwarded-Proto {scheme}
    header_up X-Forwarded-For {remote_host}
    flush_interval -1
  }
  request_body {
    max_size 2GB
  }
}

Nginx equivalent:

server {
  listen 443 ssl http2;
  server_name books.example.com;
  client_max_body_size 2G;
  location / {
    proxy_pass http://127.0.0.1:8083;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_buffering off;
    proxy_read_timeout 300s;
  }
}

Hardening steps after the wizard:

  • Disable public registration under Admin → Basic Configuration → Allow Anonymous Browsing / Public Registration unless you explicitly want it.
  • Restrict uploads to admins until you trust the library directory permissions.
  • If you use Kobo sync, keep the /kobo/<token> URL secret; it is a bearer credential.
  • Keep the app bound to 127.0.0.1 — never publish 8083 on 0.0.0.0 without TLS in front.

Updating, backups, and common pitfalls

Update the image and restart:

docker compose pull
docker compose up -d
docker compose logs --tail=50 calibre-web

Back up both the config volume and the library. The library is your data; the config volume holds users, settings, and the app SQLite database.

docker run --rm -v calibre-web-config:/data -v $(pwd):/backup alpine \
  tar czf /backup/calibre-web-config-$(date +%F).tar.gz -C /data .
tar czf calibre-library-$(date +%F).tar.gz -C "$CALIBRE_LIBRARY" .

Restore by stopping the stack, extracting the tarballs into the volume and library path, then docker compose up -d.

Two pitfalls worth knowing:

  1. calibredb lock contention. If another Calibre process (desktop, another container) holds the library lock, metadata export and conversion retry up to four times with exponential backoff and jitter (7.5–9.5 seconds total). If the lock persists, the original Calibre error surfaces. Run only one writer against the library at a time.
  2. Library path inside the container. The wizard asks for the container path (/books), not the host path. Setting it to the host path produces an empty library and no error. Verify with docker compose exec calibre-web ls /books/metadata.db.

Also note: uploads only appear in the UI after you enable them under Basic Settings, and the sample metadata.db from the repo must live outside the Calibre-Web source tree so updates do not overwrite it.


Measured in our sandbox run: total memory 148.9 MB (sum of per-container peaks over a 30s idle window after startup) across 1 container; largest container 148.9 MB; published port(s) 8083; HTTP probe returned 302. The run took 87.3s including the image download.


Verification: we ran this docker-compose stack in a disposable Docker environment and recorded the measurements above. They describe that run, not a guarantee for your host.