Self-host Calibre with Kobo Sync

Calibre is an incredibly convenient tool for managing books in various formats. I became addicted to it when I discovered its syncing ability with Kobo. The first release was in 2006 and after seventeen years, it is still the go-to software for many people nowadays.

In this article, I will elaborate on the setup I did. Ultimately, you will have Calibre self-hosted so that you can use it to manage your books and sync with Kobo flawlessly and wirelessly.

Docker has always been my preference for setting up self-hosted services.

Calibre

I utilized the docker image built by Linuxserver. Here is the content of the docker-compose.yml:

version: "2.1"
services:
  calibre:
    image: lscr.io/linuxserver/calibre:latest
    container_name: calibre
    security_opt:
      - seccomp:unconfined #optional
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - PASSWORD= #optional
      - CLI_ARGS= #optional
    volumes:
      - /path/to/data:/config
    ports:
      - 8080:8080
      - 8181:8181
      - 8081:8081
    restart: unless-stopped

Note that /path/to/data should be the absolute path to an existing directory on the host which will be used for storing your library. Upon that, running docker compose up -d should work faultlessly.

Now, Calibre runs at localhost:8080. You can use it to manage your books.

Calibre-web

Calibre-web is a standalone web interface which enhances Calibre with a clean and intuitive browsing experience. It uses a valid Calibre database.

You may also use the docker image from Linuxserver. Here’s the docker-compose.yml:

version: "2.1"
services:
  calibre-web:
    image: lscr.io/linuxserver/calibre-web:latest
    container_name: calibre-web
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - DOCKER_MODS=linuxserver/mods:universal-calibre #optional
      - OAUTHLIB_RELAX_TOKEN_SCOPE=1 #optional
    volumes:
      - /path/to/data:/config
      - /path/to/calibre/library:/books
    ports:
      - 8083:8083
    restart: unless-stopped

Note that /path/to/data should be the absolute path to an existing directory on the host for storing calibre-web’s configuration, and /path/to/calibre/library should be the absolute path where calibre’s metadata.db is stored. You can find it in your calibre directory. For me, it was /mnt/wd14/calibre/Calibre Library.

With this, you have Calibre-web running at localhost:8083 that you can use for reading.

Lastly, follow the Kobo Integration in Calibre-web’s Wiki to accomplish syncing your calibre library with Kobo.

Excitedly, open your Kobo and press the sync button top right to download your books.