English
Docker Deployment Guide
This guide applies to all Docker-capable environments, including Linux, macOS, Windows, Synology, and QNAP.
Docker Compose is recommended. The image already includes the frontend, default database path, and internal service port. Most users only need to understand two settings:
ports: exposes the container service port on the host and determines which port users visit.volumes: mounts the container data directory to host storage and determines whether data persists.
1. Quick Start
Create docker-compose.yml:
yaml
services:
leelaa-reader:
image: leedaisen/leelaa-reader-server:latest
container_name: leelaa-reader
ports:
- "8686:8686"
volumes:
- ./data:/data
- type: bind
source: /etc/machine-id
target: /etc/machine-id
read_only: true
bind:
create_host_path: false
environment:
TZ: Asia/Shanghai
# Optional: initial admin password. If omitted, one is generated and written to /data/password.txt.
# DEFAULT_ADMIN_PASSWORD: set_a_strong_password
restart: unless-stoppedMount the Docker host's existing /etc/machine-id read-only so licensing can identify the device consistently. This is independent of the IP address, domain, or mapped port used in the browser. The source must be an existing identity file on the Linux host running the Docker daemon. If it is absent, use that host's existing /var/lib/dbus/machine-id; do not create an empty file or directory. For Docker Desktop, check the corresponding path inside its Linux VM.
If an upgraded container shows a backend connection error while /api/v1/health/ready returns 200 and /api/v1/license/status returns 500, check this mount first. Add it to the existing deployment configuration and recreate the service while preserving the original /data mount and all its files. Do not delete the database or device binding. The fixed version identifies this condition explicitly and continues once the license status check recovers.
On Linux / NAS, prepare permissions for the ./data:/data bind mount from the directory containing docker-compose.yml. The current image runs as the non-root user 10001:10001:
bash
mkdir -p ./data
sudo chown 10001:10001 ./data
sudo chmod u+rwx ./dataThese commands are for a new, empty directory dedicated to Reader. For existing data, NAS shared folders, or Permission denied (os error 13) after an upgrade, follow the data permission repair tutorial first. With Rootless Docker or user namespace remapping, do not assume host UID 10001 is correct.
Start:
bash
docker compose up -dOpen:
text
http://SERVER_IP:8686For local use:
text
http://localhost:8686Check the generated initial password:
bash
docker exec leelaa-reader cat /data/password.txtOr check container logs:
bash
docker logs leelaa-reader2. ports
ports maps a host port to the container port:
yaml
ports:
- "8686:8686"Format:
text
HOST_PORT:CONTAINER_PORTThe container service port is 8686. Usually you only change the left side.
For example, if host port 8686 is already in use:
yaml
ports:
- "18868:8686"Then open:
text
http://SERVER_IP:18868For Docker deployments, change the exposed access port through the left side of ports.
3. volumes
volumes configures data persistence:
yaml
volumes:
- ./data:/dataFormat:
text
HOST_PATH:CONTAINER_PATHThe container path /data stores Leelaa Reader runtime data:
- SQLite database
- initial admin password file
password.txt - cover cache
- runtime files
Always mount /data to host storage. Otherwise, deleting the container will lose the database and settings.
Relative path:
yaml
volumes:
- ./data:/dataAbsolute path:
yaml
volumes:
- /volume1/docker/leelaa-reader/data:/dataWindows example:
yaml
volumes:
- D:/docker/leelaa-reader/data:/dataTo let the container read a host audiobook folder, add another mount:
yaml
volumes:
- ./data:/data
- /volume1/audiobooks:/books:roThen use this path in Leelaa Reader when adding a local library:
text
/books:ro means read-only mount and is recommended for audiobook folders.
4. Optional Environment Variables
For normal deployments, only these variables are recommended:
| Variable | Required | Description |
|---|---|---|
TZ | No | Container timezone. Asia/Shanghai is recommended for China-based users. |
DEFAULT_ADMIN_USERNAME | No | Initial admin username. Only takes effect when the database has no users; defaults to admin. |
DEFAULT_ADMIN_PASSWORD | No | Initial admin password. Only takes effect when the database has no users; if omitted, a random password is generated and written to /data/password.txt. |
Example:
yaml
environment:
TZ: Asia/Shanghai
DEFAULT_ADMIN_USERNAME: admin
DEFAULT_ADMIN_PASSWORD: set_a_strong_passwordAfter initial setup is complete, changing DEFAULT_ADMIN_USERNAME or DEFAULT_ADMIN_PASSWORD will not reset existing accounts.
5. Docker Run
If you do not use Compose:
bash
docker run -d \
--name leelaa-reader \
-p 8686:8686 \
-v ./data:/data \
--mount type=bind,source=/etc/machine-id,target=/etc/machine-id,readonly \
-e TZ=Asia/Shanghai \
--restart unless-stopped \
leedaisen/leelaa-reader-server:latestTo set the initial admin password:
bash
docker run -d \
--name leelaa-reader \
-p 8686:8686 \
-v ./data:/data \
--mount type=bind,source=/etc/machine-id,target=/etc/machine-id,readonly \
-e TZ=Asia/Shanghai \
-e DEFAULT_ADMIN_PASSWORD=set_a_strong_password \
--restart unless-stopped \
leedaisen/leelaa-reader-server:latest6. Image Architecture
The Docker image supports:
linux/amd64: common x86_64 servers, Intel/AMD NAS devices, and PCs.linux/arm64: ARM64/aarch64 NAS devices, ARM servers, and Docker on Apple Silicon.
In most cases, use leedaisen/leelaa-reader-server:latest directly and Docker will pull the matching image automatically.
Check Docker server architecture:
bash
docker version --format '{{.Server.Arch}}'If logs show exec format error, the image architecture likely does not match the device architecture. You can set platform explicitly:
yaml
services:
leelaa-reader:
image: leedaisen/leelaa-reader-server:latest
platform: linux/amd64
container_name: leelaa-reader
ports:
- "8686:8686"
volumes:
- ./data:/data
environment:
TZ: Asia/Shanghai
restart: unless-stoppedFor ARM64/aarch64 devices:
yaml
platform: linux/arm647. Maintenance Commands
Check container status:
bash
docker psFollow logs:
bash
docker logs -f leelaa-readerStop service:
bash
docker compose downUpgrade image:
bash
docker compose pull
docker compose up -dBack up the host-side data directory before upgrading.
Older data directories may have been created by root. If an upgrade causes runtime log creation errors, frontend update file errors, or repeated container restarts, follow the data permission repair tutorial.
