Skip to main content

Komga

This example shows a small, practical Docker Compose setup for Komga, the open-source media server for comics, manga, and eBooks.

The stack includes:

  • A single Komga container
  • Persistent volumes for the config and the media library
  • Local-only port binding for safety
  • Simple reverse-proxy instructions (Caddy example)

1. docker-compose.yml

Create a folder and add:

services:
komga:
image: gotson/komga:latest
restart: unless-stopped
ports:
- "127.0.0.1:25600:25600"
volumes:
- komga-config:/config
- ./library:/data # where your comics and manga live
environment:
- TZ=Europe/Berlin

volumes:
komga-config:

Key points:

  • 127.0.0.1:25600:25600 binds the port only to localhost. Remote access goes through the reverse proxy, not this port.
  • ./library is a bind mount to a folder on the host where your actual media files sit. Point it at wherever you already keep comics and books.
  • komga-config is a named Docker volume for Komga's database and settings. Back this up — it holds read progress, collections, and user accounts.

2. Start the stack

docker compose up -d
docker compose logs -f komga

Watch the logs until you see Komga finish scanning the library. First scans can take a while on large collections.

Visit http://localhost:25600 to create the first admin account.

3. Add a reverse proxy

Komga does not handle TLS itself. Put Caddy in front for HTTPS:

komga.example.com {
reverse_proxy 127.0.0.1:25600
}

Caddy fetches a Let's Encrypt certificate automatically the first time komga.example.com resolves to your server.

4. Pointing Komga at your library

Inside Komga's web UI, create a library and point it at /data. That matches the bind mount in the compose file. Komga scans the folder, reads series/volume structure, and extracts metadata from .cbz, .cbr, .pdf, and .epub files.

A clean folder layout that Komga likes:

library/
Series Name/
Series Name - v01.cbz
Series Name - v02.cbz
Another Series/
Vol 01.cbz

5. Updating Komga

Komga releases often. To update:

docker compose pull
docker compose up -d

The komga-config volume survives the restart, so libraries, users, and read progress stay intact.

Common issues

Komga does not see new files

Komga scans on startup and on a schedule, not on every file change. Either wait for the next scan or trigger one from Settings → Server management.

Permissions errors on /data

Komga runs as UID 1000 by default. If your host files are owned by a different user, set user: "1000:1000" in the compose file (matching the UID that owns the library folder), or adjust folder permissions.

Memory usage keeps climbing

Komga uses a JVM. Cap the heap via JAVA_TOOL_OPTIONS if needed:

    environment:
- JAVA_TOOL_OPTIONS=-Xmx1g

One-click deploy on Hostim

If you would rather skip the Compose file and the reverse proxy setup, Hostim has a one-click Komga template with HTTPS and a persistent volume preconfigured.

Deploy Komga on Hostim