Deploying Audiobookshelf and Calibre-Web in Docker Backed by a Central NAS Share
This guide builds a self-hosted library for e-books and audiobooks. Calibre-Web serves your Calibre collection, Audiobookshelf serves audiobooks and podcasts, and both run in Docker while the files stay on a central NAS. Keeping storage and compute separate means you can rebuild or move the containers without touching a single book. For the story behind this setup, read Building an Offline-First Multilingual ePub & Audio Reader on Local Infrastructure on Frizzle Tech Blog.
Prerequisites
You need a Linux host that will run the containers, a NAS that exports your media over NFS, and a way to give the services friendly names on your network. A fixed IP address for both machines keeps the mounts predictable.
- An Ubuntu Linux host with Docker Engine and the Docker Compose plugin installed.
- A NAS with an NFSv4 export holding a Calibre library and an audiobook folder.
- Static IP addresses for the host and the NAS.
- A local DNS server such as Pi-hole, and an HAProxy instance for HTTPS.
- A Calibre library that contains a
metadata.dbfile.
Step 1: Mount the NAS with Resilient NFS Flags
The most important detail is the mount options. If a Linux NFS client loses its server while using default hard mounts, processes enter uninterruptible sleep (D-state), and containers refuse to stop. Using soft with a short timeout lets requests fail cleanly instead. Create the mount points and add these lines to /etc/fstab, replacing the address with your NAS:
nas.example.com:/books /mnt/nas/books nfs nfsvers=4.2,soft,timeo=50,retrans=3,intr,rsize=1048576,wsize=1048576 0 0
nas.example.com:/audiobooks /mnt/nas/audiobooks nfs nfsvers=4.2,soft,timeo=50,retrans=3,intr,rsize=1048576,wsize=1048576 0 0
Mount everything with sudo mkdir -p /mnt/nas/books /mnt/nas/audiobooks && sudo mount -a. Then confirm the user that runs the containers can read the files by checking that ls -ln /mnt/nas/books shows ownership matching your PUID and PGID (1000 in this guide). If the NAS export squashes users, map them to that same ID on the NAS side (for example all_squash with anonuid=1000,anongid=1000), or SQLite writes will fail.
Step 2: Write the Docker Compose Stack
Create a project folder and save this as docker-compose.yml. The configuration folders live on local disk, while the media comes from the NAS:
services:
calibre-web:
image: lscr.io/linuxserver/calibre-web:latest
container_name: calibre-web
environment:
- PUID=1000
- PGID=1000
- TZ=America/Los_Angeles
volumes:
- /path/to/calibre-web/config:/config
- /mnt/nas/books:/books
ports:
- "8083:8083"
restart: unless-stopped
audiobookshelf:
image: ghcr.io/advplyr/audiobookshelf:latest
container_name: audiobookshelf
environment:
- TZ=America/Los_Angeles
volumes:
- /mnt/nas/audiobooks:/audiobooks
- /path/to/audiobookshelf/config:/config
- /path/to/audiobookshelf/metadata:/metadata
ports:
- "13378:80"
restart: unless-stopped
Start it with docker compose up -d, then check both services with docker compose ps.
Step 3: Initialize Calibre-Web
Open http://your-host:8083 and sign in with the default admin account, then change that password right away. When the setup page asks for the Calibre database location, enter /books/Calibre/Books, which is where metadata.db lives inside the container. In the admin settings, enable uploading and downloading if you want them, and turn on the OPDS feed so mobile readers can browse your catalog.
Step 4: Configure Audiobookshelf
Open http://your-host:13378 and create the root user. Add a library named Audiobooks that points at /audiobooks, and a second library named Podcasts if you keep podcasts on the same share. Run a scan, and Audiobookshelf will match covers and descriptions using its online metadata providers. Then create separate users for family members and limit what each one can access.
Step 5: Add HAProxy and SSL
Add one frontend rule per site so a single HTTPS port serves both apps. This sample assumes your certificates are already issued, for example with Let's Encrypt:
frontend https_in
bind *:443 ssl crt /path/to/certs/
use_backend calibre_backend if { ssl_fc_sni -i calibre.example.com }
use_backend audiobookshelf_backend if { ssl_fc_sni -i audiobookshelf.example.com }
backend calibre_backend
server calibre your-host:8083 check
backend audiobookshelf_backend
server abs your-host:13378 check
Point both hostnames at HAProxy in your local DNS, reload HAProxy, and confirm each name loads over HTTPS.
Step 6: Connect Your Phone
Install the Audiobookshelf app on iOS or Android and sign in with your new domain. Download a few audiobooks for offline listening before you travel. For e-books, add your Calibre-Web OPDS address to any reader app that supports OPDS.
Hardware & Gear Used in This Guide
- A Proxmox VE virtual machine running Ubuntu as the Docker host.
- A network-attached storage server with an NFS export.
- A gigabit wired network.
- An iPhone and an Android phone for client testing.
What You Can Do Next
Add automated book ingestion, back up the two config folders on a schedule, or pair the library with a custom ePub reader that speaks with on-device voices.
Later,
SteveO
