English
Get started

← All templates · Media

Deploy Kavita in one click

A reading server for manga, comics and books, with readers in the browser for every device

A self-hosted alternative to Kindle and Comixology.

What is Kavita?

Kavita is an open-source reading server for manga, webtoons, comics and books. It reads the files where they are, CBZ, CBR, ZIP, RAR and 7-Zip archives and folders of images for comics, EPUB and PDF for books, groups them into series with their covers and metadata, and serves them to readers in the browser that work on a phone, a tablet and a desktop. The readers have a webtoon mode, a continuous mode that goes on to the next chapter, and highlights and annotations in EPUB books.

People run Kavita to read their own collection anywhere and to share it with family and friends: each user has their own progress, and roles limit what they see and do, ages included. Collections, reading lists, Want to Read and smart filters organise a large library, and themes change its look. Kavita+, a paid subscription, adds metadata, reviews and recommendations from the internet; everything else is free.

This template runs Kavita's official image, version 0.9.1, with its database and settings in one volume and your books in another. The admin is registered from the username, email and password you give before Kavita answers anyone.

Hosting Kavita on Pethost

  1. You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
  2. New project opens at Kavita. You fill in what it asks for and click Create project: Username, Email, Admin password.
  3. In a minute or two Kavita is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
  4. It is a project like any other: you or your agent can change it, roll it back or restore it.

Questions about Kavita

Is Kavita free?

Yes. Kavita is open source under the GPL-3.0 and free to run, with every reader and every user feature. Kavita+ is an optional paid subscription for metadata, reviews, recommendations and scrobbling to AniList and other services.

Which formats does Kavita read?

Comics and manga as CBZ, CBR, ZIP, RAR, RAR5 and 7-Zip archives or folders of images, and books as EPUB and PDF. Kavita reads the files as they are, without converting them.

How do I add books to Kavita?

Put the files into the library's folder, each series or book in a folder of its own, then add the folder as a library under Settings → Libraries. Kavita scans it then, and again when files change.

Kavita vs Komga: which should I pick?

Both serve comics, manga and books, EPUB and PDF included, to readers in the browser and to OPDS apps. Kavita's own readers add a webtoon mode, continuous reading into the next chapter, and highlights and annotations in EPUB books; Kavita+ sells metadata from the internet, while Komga has no paid tier.

Can I share my Kavita library with others?

Yes. The admin invites users under Settings → Users and picks the libraries each one sees and their roles, such as download or age limits. Each user keeps their own reading progress.

How much memory and disk does Kavita need?

Kavita is light: about 250 MB of memory while you read, more while it scans a library; your books take what their files take. On Pethost the Starter plan is enough for it, with room for other apps beside it.

Kavita Docker Compose file

The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.

Containers: kavita (jvmilazz0/kavita:0.9.1).

Volumes, in the nightly backup: config, books.

services:
  kavita:
    image: jvmilazz0/kavita:0.9.1
    restart: unless-stopped
    environment:
      ADMIN_USERNAME: ${ADMIN_USERNAME}
      ADMIN_EMAIL: ${ADMIN_EMAIL}
      ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      TZ: Etc/UTC
    # A new Kavita lets whoever opens it first register as its admin. So until the admin exists,
    # Kavita runs on 127.0.0.1:5001, which nobody reaches, where the admin is registered from the
    # fields; only then does it start as the image starts it, answering on 5000. Kavita reads the
    # port and address of its appsettings.json only when it does not know it is in a container.
    # A refusal stops the start with Kavita's reason in the log.
    entrypoint:
      - /bin/bash
      - -c
      - |
        set -e
        cd /kavita
        if [ ! -f config/admin-registered ]; then
          if [ ! -f config/appsettings.json ]; then
            cp /tmp/config/appsettings.json config/appsettings.json
          fi
          sed -i -e 's/"Port": *[0-9]*/"Port": 5001/' -e 's/"IpAddresses": *"[^"]*"/"IpAddresses": "127.0.0.1"/' config/appsettings.json
          env -u DOTNET_RUNNING_IN_CONTAINER ./Kavita &
          kavita=$$!
          until curl -sf -o /dev/null http://127.0.0.1:5001/api/health; do
            kill -0 $$kavita
            sleep 1
          done
          json() {
            local s=$${1//\\/\\\\}
            s=$${s//\"/\\\"}
            printf '"%s"' "$$s"
          }
          body="{\"username\":$$(json "$$ADMIN_USERNAME"),\"email\":$$(json "$$ADMIN_EMAIL"),\"password\":$$(json "$$ADMIN_PASSWORD")}"
          status=$$(curl -s -o /tmp/register -w '%{http_code}' -H 'Content-Type: application/json' -d "$$body" http://127.0.0.1:5001/api/Account/register)
          kill $$kavita
          wait $$kavita || true
          sed -i -e 's/"Port": *[0-9]*/"Port": 5000/' -e 's/"IpAddresses": *"[^"]*"/"IpAddresses": ""/' config/appsettings.json
          # 400 "denied": an admin exists already, registered by an earlier start.
          if [ "$$status" != 200 ] && ! grep -qi denied /tmp/register; then
            echo "Kavita refused the admin ($$status): $$(cat /tmp/register)"
            exit 1
          fi
          touch config/admin-registered
        fi
        exec /entrypoint.sh
    volumes:
      - config:/kavita/config
      # Writable, so that books can be uploaded or copied in over SFTP.
      - books:/books
volumes:
  config:
  books:

More in Media