Skip to content

Set Up Kavita on a Linux Server – Your Own Reading Server for Comics, Manga, and E-Books

Set up Kavita as a One-Click App or with Docker on your VPS and read your comics, manga, and e-books in your browser and reading apps.

1 December 202611 min read1 Views0 helpful

Introduction

Kavita is a self-hosted reading server for comics, manga, and e-books (open source, GPL-3.0). Store your files on the server, and Kavita sorts them into series, downloads cover art, and reads metadata from the files. Read directly in your browser using the built-in comic, manga, EPUB, and PDF readers. Kavita remembers where each account left off and offers reading lists, collections, and bookmarks. Multiple people can have their own accounts and reading progress.

This guide shows you two ways to get started: the easy way, using the One-Click App, which runs Kavita with your administrator account and HTTPS at your address, and a manual installation with Docker Compose. Afterward, you’ll create your libraries, upload files, and connect reading apps.

When Kavita Is a Good Choice for a VPS

Kavita is a good choice if:

  • You want to read your collection from anywhere. Your comics, manga, and books are all in one place, and you can pick up where you left off in your browser on a computer, tablet, or smartphone.
  • You have a mix of formats. Kavita reads comic archives (CBZ, CBR, CB7, ZIP, RAR, 7Z), EPUB, PDF, and loose images in one interface.
  • Several people will use it. Each account has its own reading progress. You can share libraries individually and set an age rating for each account.
  • You use e-readers or reading apps. Many reading apps can access your collection through OPDS.

Kavita is less suitable if you mainly want to manage audiobooks or podcasts. Audiobookshelf is a better fit for that. For movies, TV shows, and music, use a media server such as Jellyfin. Also note that Kavita is a reading interface, not a file manager. Upload files to the server using SFTP, not through the web interface.

Easy Option: Kavita as a One-Click App

The quickest way to get Kavita running on your VPS is through its One-Click Apps. With a domain, the app is immediately accessible over HTTPS. You don’t need a reverse proxy, certificate, or firewall rules, and the One-Click App creates your administrator account during installation.

Requirements

  • A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Set Up One-Click Apps for instructions.
  • Kavita requires at least 1 vCore and 512 MB of RAM; 2 vCores and 2 GB are recommended. Allow 2 to 10 GB for the database, cover art, and cache, in addition to the space for your collection.

Install

  1. Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
  2. Search for Kavita in the App catalog and click Install app.
  3. Use a custom subdomain or zap.cloud is already selected. Leave it enabled and enter a name, such as books. Without a domain, Kavita would only be available over HTTP, and your password would be transmitted unencrypted.
  4. No other details are needed. Under App configuration, you’ll see that a username and password are generated automatically. Click Queue installation. After two to three minutes, Kavita will show as Online on the app card.

If you open the address during the first few minutes, you may still see an error page (404 page not found). This is normal: Kavita isn’t accessible until your administrator account has been created.

First Login

The One-Click App creates your administrator account when it starts. You’ll also see the Login notice on the app card and in the app settings:

  1. Open the app settings (gear icon), then go to App environment > Automatically generated values. The username is listed under SERVICE_USER_KAVITA; it is zapx. The password is listed under SERVICE_PASSWORD_KAVITA. Click the eye icon to reveal a value or the copy icon to copy it.
  2. Open the app’s Access link.
  3. Sign in with the username zapx and the password shown there, then click Sign in.

The One-Click App doesn’t offer public registration. Visitors will only see the login page. You’ll need to create any additional accounts yourself (see “Invite Additional Users”).

After your first login, change your password under Settings > Account. Click Edit next to Password. Also enter a real email address under Email; it will initially show only your username. Kavita needs an email address to reset a forgotten password later. Kavita won’t update the value under App environment: your new password will remain valid after an app restart or update.

Where Your Files Are Stored

The One-Click App creates two volumes:

  • kavita-media is mounted in the container as the /manga folder. Your comics, manga, and books go here. This is just a folder name—you can also store books and comics in it.
  • kavita-config contains Kavita’s database, settings, cover art, and automatic backups.

For instructions on uploading files to kavita-media and turning them into libraries, see “Create Libraries and Upload Files” below.

Updates and Backups

To check whether a new version is available, open the app settings (gear icon), go to App update, and click Check for updates. Install a new version by clicking Apply update. If the app is up to date, there’s no newer version in the app catalog. Accounts, reading progress, and libraries are preserved during updates. You can’t update Kavita from within its interface in the container.

A backup of your VPS from the Backups tab includes both volumes. Kavita also creates its own daily database backup in the kavita-config volume (Settings > Tasks > Kavita Backup). This protects you from a Kavita error, but not from losing your server.

Manual Installation

The rest of this guide covers the manual installation of Kavita with Docker Compose on your VPS—for example, if you don’t use One-Click Apps on your server or want to manage Kavita yourself alongside other services. This is based on Kavita’s official Docker guide.

Requirements

  • A Linux VPS running Debian or Ubuntu, with SSH access. See First SSH Connection.
  • Docker and Docker Compose. See Install Docker. Check the installation with docker --version and docker compose version.
  • For HTTPS: a domain or subdomain whose A record points to your VPS IP address (e.g., books.example.com).

Kavita runs in a single container and includes its own database (SQLite). You’ll mainly need more resources when scanning large libraries and generating cover art:

MinimumRecommended
CPU1 vCore2 vCores
RAM512 MB2 GB
Storage (excluding collection)2 GB10 GB

Prepare the Firewall

Kavita listens on port 5000 inside the container. Don’t open this port; Kavita should only be accessible through a reverse proxy with HTTPS. With ufw, allow only SSH and the ports required by the reverse proxy:

Code
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status

In the Compose file below, port 5000 is bound only to 127.0.0.1. This means only the reverse proxy on the same server can access it, even if Docker sets its own firewall rules.

Warning: Create an account before making Kavita publicly accessible

On a fresh manual installation, Kavita displays the “Register” page, and the first account created there becomes the administrator. Create your account through an SSH tunnel before setting up the reverse proxy (see “First Access and Administrator Account”). The registration page will then be closed. The One-Click App creates the account automatically, so this step isn’t necessary there.

Install with Docker Compose

Create a folder for Kavita, with subfolders for your collection:

Code
mkdir -p ~/kavita/{config,comics,manga,books}
cd ~/kavita

Then create a compose.yaml file in the ~/kavita folder, for example, by running nano compose.yaml:

Code
services:
  kavita:
    image: jvmilazz0/kavita:0.9.1
    container_name: kavita
    restart: unless-stopped
    ports:
      - "127.0.0.1:5000:5000"
    environment:
      - TZ=Europe/Berlin
    volumes:
      - ./config:/kavita/config
      - ./comics:/comics
      - ./manga:/manga
      - ./books:/books

Important lines:

  • image uses the official image with a fixed version number. Find the latest version in Kavita releases. Don’t use nightly; those are test versions.
  • ports binds Kavita to 127.0.0.1 only. The port won’t be accessible from outside.
  • TZ sets the time zone so daily tasks, such as scans and backups, run at the right time. Without this line, Kavita uses UTC.
  • ./config contains the database, settings, cover art, logs, and automatic backups.
  • ./comics, ./manga, and ./books are your media folders. In Kavita, they appear as /comics, /manga, and /books. You can choose different names or mount additional folders.

Start Kavita:

Code
docker compose up -d
docker compose logs -f

On the first start, Kavita creates its database. After a few seconds, you’ll see Now listening on: http://[::]:5000. Press Ctrl+C to exit the log view; the container will keep running.

First Access and Administrator Account

Create your account before setting up the reverse proxy. To do this, open an SSH tunnel. Run this command on your own computer:

Code
ssh -L 5000:127.0.0.1:5000 root@SERVER_IP
  1. Open http://localhost:5000 in your browser. Kavita displays the Register page (“Complete the form to register an admin account”).
  2. Enter a Username, an optional Email, and a Password with at least 6 characters, then click Register. This account will be the administrator.
  3. Sign in. The registration page will now be closed, and you’ll need to create any additional accounts yourself (see “Invite Additional Users”).

The email address doesn’t have to be real, but you’ll need it to reset a forgotten password later.

Access over HTTPS Through a Reverse Proxy

Set up nginx as a reverse proxy as described in Set Up a Reverse Proxy with nginx, then obtain a certificate as explained in SSL Certificate with Let's Encrypt. The server block for Kavita looks like this:

Code
server {
    listen 80;
    server_name books.example.com;

    location / {
        proxy_pass         http://127.0.0.1:5000;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection "upgrade";
        proxy_set_header   Host $host;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }
}
  • Upgrade and Connection forward WebSockets. Kavita uses them to report scan progress and new content to the interface in real time.
  • Kavita runs at the root of the domain here. To use a subpath such as /kavita, you’ll also need to set the Base Url in Kavita under Settings > General. Using a separate subdomain is easier.

Then run sudo nginx -t and sudo systemctl reload nginx, and obtain the certificate with sudo certbot --nginx -d books.example.com. Kavita will now be available at https://books.example.com.

Back Up Your Data

The most important folder is ~/kavita/config, which contains the database, reading progress, and settings. Briefly stop the container to create a clean backup:

Code
cd ~/kavita
docker compose stop
tar czf ~/kavita-config-$(date +%F).tar.gz config compose.yaml
docker compose start

Back up your media folders separately, for example, with rsync to another storage location. They rarely change and are often large. Kavita also creates its own daily backup in the config/backups folder. To restore, stop Kavita with docker compose down, extract the archive in the ~/kavita folder, and start Kavita again with docker compose up -d.

Update Kavita

Create a backup first and read the release notes. Then enter the new version number for image in compose.yaml and run:

Code
cd ~/kavita
docker compose pull
docker compose up -d
docker image prune -f

When it starts, Kavita automatically updates the database to the new version. The Running Migrations messages in the log are normal.

Create Libraries and Upload Files

Kavita’s interface is in English, so this guide uses the English labels. Open settings using the gear icon in the top-right (Settings).

Upload Files

Kavita doesn’t have an upload feature in the web interface. Upload your files to the server using SFTP. See Connect over SFTP for instructions.

  • One-Click App: The media folder is the Docker volume whose name ends with _kavita-media. Find the exact name with docker volume ls | grep kavita. As root, upload files to the _data subfolder of this volume, that is, to /var/lib/docker/volumes/<Name of the volume>/_data. This folder is called /manga in Kavita.
  • Manual installation: Upload files to the folders under ~/kavita, for example, ~/kavita/comics.

Kavita expects each series to have its own folder. If files are loose in the library folder, Kavita often won’t recognize the series correctly. Here’s an example of a working structure:

Code
/manga
├── Comics
│   └── Mein Comic
│       ├── Mein Comic 001.cbz
│       └── Mein Comic 002.cbz
└── Books
    └── Autor - Buchtitel
        └── Buchtitel.epub

Create separate subfolders for comics, manga, and books, because each library has its own type. For exact file-naming rules, see the Kavita documentation.

Create a Library

  1. Open Settings > Libraries and click Add Library.
  2. Under General, enter a Name and choose a Type: Comic or Comic (Flexible) for Western comics, Manga for manga with volumes, Book for EPUB books, Light Novel, or Image for loose images. The type determines how Kavita interprets file names.
  3. Click Next, then Browse for Media Folders. Select your library folder—for example, in the One-Click App, choose /manga > Books—and confirm with Share.
  4. Under Advanced, use File Types to choose which files Kavita reads (Archive, Epub, Pdf, Image).
  5. Click Save. Kavita scans the library immediately, and after a short time, the series appear on the home page.

Kavita automatically finds new files during its daily scan. To start a scan right away, click the three dots next to the library in the sidebar.

Invite Additional Users

Go to Settings > Users and click Invite. Enter an email address, select the libraries to share and the permissions (such as Download or Change Password), and, if needed, set an Age Rating Restriction. If email isn’t configured, Kavita will show you an invitation link that you can share yourself. The invited person can use the link to create an account with their own password.

If you want Kavita to send emails—for invitations, password reset links, or Send To Device to a Kindle, for example—enter an SMTP server under Settings > Email, and enter your Kavita server’s address under Host Name.

Connect Reading Apps and E-Readers

On a smartphone or tablet, simply open Kavita in your browser. You can add the page to your home screen from the browser menu so that it launches like an app.

For reading apps that support OPDS, find the OPDS URL under Settings > Auth Keys / OPDS. Add it to your app as a catalog. The address contains a personal key and should be treated like a password: don’t share it. Click Rotate to generate a new key; existing connections will then stop working. The Kavita documentation lists compatible apps.

Kavita’s Limitations

  • No uploads or file management in the browser. You’ll need to use SFTP to transfer files to the server, rename them, and move them.
  • No DRM-protected books. Kavita can’t open purchased e-books with copy protection.
  • Internet metadata such as descriptions and ratings is only available with Kavita+, a paid add-on from the Kavita developers. Without Kavita+, Kavita uses metadata in the files (such as ComicInfo.xml or EPUB details) and your folder names.

Conclusion

With Kavita, you can keep your comics, manga, and e-books on your own server and read them in a browser or reading apps, with separate reading progress for each account. The quickest way to get started is with the One-Click App: queue the installation, sign in with zapx and the generated password, upload files using SFTP, and create your first library. If you want to manage Kavita yourself, the manual Docker Compose installation gives you full control.

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

The One-Click App is the quickest option: it sets up your domain, HTTPS, and administrator account during installation, and you can install updates from the dashboard using App Update. Manual installation with Docker Compose is a good choice if you don’t use One-Click Apps, want to run Kavita alongside other services behind your own reverse proxy, or want to choose your media folders on the server.
Kavita doesn’t have an upload feature in the web interface. Upload files to the server using SFTP. With the One-Click App, the media folder is in the Docker volume whose name ends with _kavita-media, at /var/lib/docker/volumes/<Name of the volume>/_data. Create a separate folder for each series, then scan the library or wait for the daily scan.
Kavita reads comic and manga archives (CBZ, CBR, CB7, CBT, as well as ZIP, RAR, and 7Z), EPUB, PDF, and loose image files. Choose which formats a library reads under Advanced > File Types when you create it. Kavita can’t open DRM-protected books.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.