koreader-sync-server

koreader-sync-server

Docker app from edvin's Repository

Overview

KOReader Sync Server is a self-hosted sync service for KOReader devices. The official image serves HTTPS on container port 7200 with a self-signed certificate and stores its state in Redis, so persistent Redis storage is required. Keep the exposed port on a trusted network, or place the container behind a reverse proxy that terminates TLS.

AGPL Licence Koreader Sync Server

Koreader sync server is built on top of the Gin JSON-API framework which runs on OpenResty and is entirely written in Lua.

Users of koreader devices can register their devices to the synchronization server and use the sync service to keep all reading progress synchronized between devices.

This project is licenced under Affero GPL v3, see the COPYING file.

Setup your own server

Using docker, you can spin up your own server in two commands:

# for quick test
docker run -d -p 7200:7200 --name=kosync koreader/kosync:latest

# for production, we mount redis data volume to persist state
mkdir -p ./logs/{redis,app} ./data/redis
docker run -d -p 7200:7200 \
    -v `pwd`/logs/app:/app/koreader-sync-server/logs \
    -v `pwd`/logs/redis:/var/log/redis \
    -v `pwd`/data/redis:/var/lib/redis \
    --name=kosync koreader/kosync:latest

The above command will spin up a sync server in a docker container.

To build your own docker image from scratch:

docker build --rm=true --tag=koreader/kosync .

Alternatively, if you'd rather use docker compose:

docker compose up -d --build

To setup the server manually, please refer to the commands used in the Dockerfile.

You can use the following command to verify that the sync server is ready to serve traffic:

curl -k -v -H "Accept: application/vnd.koreader.v1+json" https://localhost:7200/healthcheck
# should return {"state":"OK"}

As you can see, the server responds over HTTPS using a self-signed certificate. If you'd like to run the server behind a reverse proxy and let the proxy handle TLS termination, run the server on port 17200 instead of 7200. As an example, your Traefik V3 configuration could look like this:

  kosync:
    # ...
    labels:
      - traefik.enable=true
      - 'traefik.http.routers.kosync.rule=Host(`kosync.example.com`)'
      - 'traefik.http.services.kosync.loadbalancer.server.port=17200'

Privacy and security

Koreader sync server does not store file name or file content in the database. For each user it uses a unique string of 32 digits (MD5 hash) to identify the same document from multiple koreader devices and keeps a record of the furthest reading progress for that document. Sample progress data entries stored in the sync server are like these:

"user:chrox:document:0b229176d4e8db7f6d2b5a4952368d7a:percentage"  --> "0.31879884821061"
"user:chrox:document:0b229176d4e8db7f6d2b5a4952368d7a:progress"    --> "/body/DocFragment[20]/body/p[22]/img.0"
"user:chrox:document:0b229176d4e8db7f6d2b5a4952368d7a:device"      --> "PocketBook"

And the account authentication information is stored like this:

"user:chrox:key"  --> "1c56000eef209217ec0b50354558ab1a"

the password is MD5 hashed at client when authorizing with the sync server.

In addition, all data transferred between koreader devices and the sync server are secured by HTTPS (Hypertext Transfer Protocol Secure) connections.

Install koreader-sync-server on Unraid in a few clicks.

Find koreader-sync-server in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for koreader-sync-server Review the template variables and paths Click Install

Download Statistics

717,088
Total Downloads

Related apps

Explore more like this

Explore all

Details

Repository
koreader/kosync:latest
Last Updated2026-05-16
First Seen2026-08-03

Runtime arguments

Web UI
https://[IP]:[PORT:7200]/healthcheck
Network
bridge
Shell
sh
Privileged
false

Template configuration

HTTPS PortPorttcp

Host port mapped to the container HTTPS listener

Target
7200
Default
7200
Value
7200
Application LogsPathrw

Optional persistent application log directory

Target
/app/kosync/logs
Default
/mnt/user/appdata/kosync/logs/app
Value
/mnt/user/appdata/kosync/logs/app
Redis LogsPathrw

Optional persistent Redis log directory

Target
/var/log/redis
Default
/mnt/user/appdata/kosync/logs/redis
Value
/mnt/user/appdata/kosync/logs/redis
Redis DataPathrw

Required persistent Redis data directory

Target
/var/lib/redis
Default
/mnt/user/appdata/kosync/data/redis
Value
/mnt/user/appdata/kosync/data/redis
Enable User RegistrationVariable

Set to false to require pre-created accounts only

Target
ENABLE_USER_REGISTRATION
Default
true
Value
true