Self-Host Calibre-Web with Automated Book Downloader
In this article
This guide walks you through setting up Calibre-Web on your own server and connecting it to an automated book downloader, so new ebooks are fetched and added to your library without manual work. You'll end up with a personal ebook server accessible from any device, with a pipeline that keeps it updated. You'll need a Linux server (or a machine that can run Docker), basic command-line comfort, and a source of book downloads you're legally allowed to use.
What You'll Need
- A server or always-on computer (Raspberry Pi, old PC, VPS) with Docker and Docker Compose installed.
- A domain name or a way to access your server remotely (optional but recommended).
- A book download source that provides direct links or an API (e.g., a private book tracker, a legal ebook store with a download API, or your own collection of files).
- Basic familiarity with terminal commands and editing YAML files.
Step-by-Step
- Install Docker and Docker Compose on your server if not already present. For Ubuntu/Debian, run
sudo apt update && sudo apt install docker.io docker-compose-v2(or follow the official Docker docs for your OS). - Create a project directory for your setup:
mkdir ~/calibre-web && cd ~/calibre-web. - Create a
docker-compose.ymlfile with the following content (adjust paths and ports as needed):services: calibre-web: image: lscr.io/linuxserver/calibre-web:latest container_name: calibre-web environment: - PUID=1000 - PGID=1000 - TZ=Your/Timezone volumes: - ./books:/books - ./appdata:/config ports: - 8083:8083 restart: unless-stopped - Start Calibre-Web with
docker compose up -d. Wait a minute, then openhttp://your-server-ip:8083in a browser. - Set up the Calibre-Web database: On first run, you'll see a setup screen. Point the “Calibre database location” to
/books(the folder where your books will live). If you don't have an existing Calibre library, Calibre-Web will create a default one. Set an admin username and password. - Log in with your admin credentials. You should see an empty library.
- Create a folder for downloads on your server, e.g.,
~/downloads. This will be the staging area where the downloader drops new books. - Choose a book downloader tool. Popular options include:
- lazy-librarian – automates downloading from Usenet and torrents, integrates with Calibre.
- Readarr – a “Lidarr for books” that monitors book requests and grabs them from indexers.
- Custom script – if you have a specific source, you can write a Python or bash script that downloads books to the folder.
- Install Readarr using Docker Compose. Add a second service to your
docker-compose.yml:readarr: image: lscr.io/linuxserver/readarr:develop container_name: readarr environment: - PUID=1000 - PGID=1000 - TZ=Your/Timezone volumes: - ./readarr-config:/config - ./books:/books - ./downloads:/downloads ports: - 8787:8787 restart: unless-stopped - Start Readarr with
docker compose up -dand openhttp://your-server-ip:8787. - Configure Readarr:
- Go to Settings → Media Management and set the root folder to
/books. - Under Download Clients, add your download client (e.g., SABnzbd, qBittorrent) if you use one. If you use a custom script, skip this.
- Under Indexers, add your book indexers (e.g., a private tracker or a public one like Torznab).
- Go to Settings → Media Management and set the root folder to
- Connect Readarr to Calibre-Web: Readarr can send finished downloads directly to Calibre-Web via its “Custom Script” or by using the built-in Calibre integration. In Readarr, go to Settings → Connect and add a “Calibre” connection. Provide the Calibre-Web URL (
http://calibre-web:8083if on same network, or your server IP), username, password, and the library path (/books). Test the connection. - Set up automatic downloading: In Readarr, add authors or specific books to your wanted list. Readarr will monitor the indexers and automatically download new releases, then send them to Calibre-Web.
- If using a custom script, write a script that downloads books to
~/downloads, then use Calibre-Web’s “Import” feature or a cron job to move them into the library. For example, a cron job that runscalibredb add --with-library /books /downloads/*.epub(using Calibre’s CLI) every hour. - Test the pipeline: Add a test book to Readarr (or place a file in the downloads folder) and watch it appear in Calibre-Web after a few minutes.
- Secure your setup: Put Calibre-Web behind a reverse proxy (like Nginx or Caddy) with HTTPS. Use a domain name and Let’s Encrypt for a free SSL certificate. This is essential if you plan to access it from outside your home network.
Common Mistakes
- Wrong file permissions: If Calibre-Web can't read or write to the books folder, you'll get errors. Ensure the PUID/PGID in Docker matches the owner of the folders.
- Incorrect database path: Pointing Calibre-Web to a non-existent folder or a folder without a proper Calibre library will cause setup failure. Double-check the path is exactly
/booksinside the container. - Port conflicts: If port 8083 or 8787 is already in use, change the host port (e.g.,
8084:8083) and update your browser URL. - Downloader and Calibre-Web on different networks: If Readarr can't reach Calibre-Web, they may be on different Docker networks. Ensure they are in the same compose file or use the host IP.
- Not setting up a download client: Readarr won't download anything unless you configure a download client. Even a simple “Blackhole” client that saves to a folder works.
Tips
- Use a dedicated user (not root) for the Docker containers to improve security.
- Back up your
appdataandbooksfolders regularly. Your library is irreplaceable. - Set up automatic backups of the Calibre-Web database (a SQLite file) using a cron job.
- Enable OPDS in Calibre-Web settings to read your books on mobile apps like KyBook or Librera.
- If you have a large library, enable “Use Calibre’s built-in server” in Calibre-Web settings for better performance.
- Keep your Docker images updated with
docker compose pull && docker compose up -dto get security fixes.
Troubleshooting
- Calibre-Web shows “DB is not valid”: This means the path doesn't contain a Calibre library. Either create an empty library using Calibre desktop and copy it, or let Calibre-Web create one by ensuring the folder is empty and writable.
- Books don't appear after download: Check Readarr’s activity log. If the download completed, the connection to Calibre-Web might be failing. Test the connection again and check the Calibre-Web logs (
docker logs calibre-web). - Can't access the web UI from another device: Check your firewall (ufw, iptables) and ensure the ports are open. Also, if you're using a VPS, check the cloud provider's security group.
- Docker containers keep restarting: Run
docker logs <container_name>to see the error. Often it's a permission issue or a missing volume. - Readarr can't connect to indexers: Verify your indexer settings, and if you're behind a VPN, make sure the indexer allows that IP.
Frequently Asked Questions
Do I need a Calibre library already?
No. Calibre-Web can create a default library if you point it to an empty folder. However, if you already have a Calibre library, you can point to it and skip the creation step.
Can I use this on Windows or macOS?
Yes, Docker runs on all major operating systems. The steps are the same, but you'll need to adjust folder paths (e.g., use C:\books instead of /books).
Is it legal to automate book downloads?
It depends on the source. Downloading public domain books or books you own is fine. Downloading copyrighted books without permission is illegal. Always ensure your download source is legitimate.
How do I access my library remotely?
Set up a reverse proxy with a domain name and HTTPS, or use a VPN like Tailscale to securely access your server from anywhere.
Can I use a different downloader than Readarr?
Yes. LazyLibrarian, Calibre-Web's built-in “Import” feature, or a custom script all work. The key is getting files into the Calibre library folder.
What if I want to add books manually?
You can still upload books directly through Calibre-Web's web interface. The automation is just an addition, not a replacement.