DEV Community

sumeshi_kun
sumeshi_kun

Posted on

Komga PDF Viewer on QNAP NAS

Overview

I bought a QNAP NAS, and it seems Docker is supported on it.
ChatGPT recommended a PDF viewer that can be set up on-premises like Apple's Books, called Komga.

komga-books
Here's how it looks in the end. It's a web application, so you can access it from a smartphone.

https://komga.org/

Environment

NAS Model Used Application
QNAP TS-133 Container Station

It's one of the cheapest entry-level models. If you have a newer QNAP product that runs Container Station, it should work similarly.

Setup Procedure

Confirm UID, GID

Since SSH is disabled by default, you need to enable it using tools like Qfinder Pro. Select the NAS, then choose Connect via SSH.

qfinder-ui

Once enabled, you can SSH using tools like WSL or Putty.

$ ssh {{USER_NAME}}@{{NAS_IP_ADDRESS}}
Enter fullscreen mode Exit fullscreen mode

Once SSHed in, execute the following command to check UID and GID. Typically, if you're the first user, UID=1000, GID=100 should be fine.

$ id {{USER_NAME}}
uid=1000({{USER_NAME}}) gid=100(everyone)
Enter fullscreen mode Exit fullscreen mode

Reference: https://www.forum-nas.fr/threads/tuto-se-connecter-%C3%A0-son-nas-qnap-par-ssh.19604/

Create config, data Directories

When you install Container Station, a /Container directory should be created. Under /Container, create a komga directory, and under /Container/komga, create config and data directories.

qnap-directories

Run Komga Application

qnap-container-station

From Container Station > Applications > Create, input the following Docker-Compose configuration to create the container. Adjust each item as necessary.

version: '3.8'

services:
  komga:
    image: gotson/komga
    container_name: komga
    volumes:
      - '/share/CE_CACHEDEV1_DATA/Container/komga/config:/config'
      - '/share/CE_CACHEDEV1_DATA/Container/komga/data:/data'
    ports:
      - 8282:25600
    user: "1000:100"
    restart: unless-stopped
Enter fullscreen mode Exit fullscreen mode

Volumes

/share/CE_CACHEDEV1_DATA/Container/komga/config:/config

Specify Host Directory:Container Directory.

CE_CACHEDEV1_DATA may vary depending on your environment. Check the volume mount point if it fails.

qnap-container-station-mountpoints

Ports

8282:25600

Specify Host Port:Container Port.

25600 is Komga's default, so you can leave it unchanged. Use 8282 or any port you prefer for accessing.

User

"1000:100"

Specify the previously mentioned UID:GID.

Execution Result

komga-ui
After waiting a bit, access via http://{{NAS_IP_ADDRESS}}:8282 should be available.

On first access, create an account and proceed.

When adding PDFs, place them in /Container/komga/data and reference them from the web application.

Reference: https://www.forum-nas.fr/threads/tuto-installation-de-komga-en-docker-sur-un-nas-qnap-container-station.19616/


This post has been translated by GPT-4.
Original Post(Japanese): https://zenn.dev/sum3sh1/articles/2e905fa139d37b

Top comments (0)