Skip to main content

Komga Docker Compose Example

This example is a small, working docker-compose.yml for Komga, the open-source media server for comics, manga, and eBooks. Copy it, point it at your library folder, and you have Komga running on port 25600 with your data on a persistent volume.

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

The gotson/komga image sets no user, so the container runs as root unless you tell it otherwise. That usually reads fine, but anything Komga writes into your library ends up owned by root. To keep ownership sane, set user: to the UID/GID that owns the library folder on the host:

    user: "1000:1000"   # match `id -u`:`id -g` for the owner of ./library

If you set user: and then hit read errors, the UID you picked does not have access to the bind-mounted folder — check with ls -ln ./library and adjust either the value or the 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

Frequently asked questions

What port does Komga use in Docker?

Komga listens on port 25600 inside the container. In the example above it is published as '127.0.0.1:25600:25600', which keeps it reachable only from the host — remote access goes through the reverse proxy instead of the raw port.

Which volumes does Komga need in Docker Compose?

Two. A '/config' volume holds Komga's database, users, collections, and read progress — back this one up. A '/data' mount points at the folder where your comics, manga, and eBooks actually live, usually a bind mount to an existing library directory on the host.

How do I fix Komga permission errors on the library folder?

The gotson/komga image sets no user, so the container runs as root by default and files it writes into your library are owned by root. Set 'user:' in the Compose file to the UID and GID that own the library folder on the host (for example 'user: "1000:1000"'). If you then get read errors, that UID lacks access to the bind-mounted folder — check 'ls -ln' on the folder and fix either the value or the permissions.

How do I update Komga running in Docker Compose?

Run 'docker compose pull' followed by 'docker compose up -d'. The config volume survives the restart, so libraries, user accounts, and read progress stay intact.

Does Komga handle HTTPS itself?

No. Komga serves plain HTTP, so put a reverse proxy such as Caddy, Traefik, or Nginx in front of it for TLS. A managed host that terminates HTTPS for you removes that step entirely.