Build from source
The published image is built from the same repository. Build it yourself when you need a custom image; otherwise use the published image.
Prerequisites
Section titled “Prerequisites”- Git and Docker with the Compose plugin, for an image build.
- Node 26+ and pnpm 12 (the version pinned in
package.json), for development.
Build and run an image
Section titled “Build and run an image”The repository’s docker-compose.yml builds the image locally (build: ., tagged
kinglet:latest) and runs it on port 8080 with the same /data volume layout as
the published image:
git clone https://github.com/rushlightlab/kinglet.gitcd kingletcp .env.example .env # then set KINGLET_BASE_URL and the admin variablesdocker compose up -d --buildThe compose file loads .env when it exists, with two exceptions: it sets
KINGLET_DB_PATH and KINGLET_RETENTION_DAYS in its environment: block, which
overrides .env, so edit those there. It also publishes 8080 on every
interface; change the mapping to "127.0.0.1:8080:3000" unless other machines
must reach it.
To build an image for another host, use docker build -t kinglet:<tag> . and
deploy it like the published image with any method in Deploy. For
the Caddy TLS sample, replace its image: line with build: .. and
image: kinglet:latest, as the comment in deploy/docker-compose.tls.yml shows,
and run it from deploy/ in the checkout so .. is the repository root.
Upgrade
Section titled “Upgrade”git pulldocker compose up -d --buildBack up /data first; migrations run on boot. See the
upgrade notes.
Development servers
Section titled “Development servers”pnpm installpnpm devThe API listens on :3000 and the UI on :5173 (Vite, proxying /v1 and
/api/auth). The
development API stores its database in apps/api/data/, and the generated admin
password in apps/api/data/admin-password.txt. Sign in at
http://localhost:5173.
If port 3000 is taken, move both servers:
KINGLET_PORT=3100 KINGLET_API_URL=http://localhost:3100 pnpm devThe repository README covers tests, demo log generators, and the release workflow.
Troubleshooting
Section titled “Troubleshooting”- Code changes do not show up in the container. Rebuild with
docker compose up -d --build; a plainup -dreuses the existing image. address already in useon 8080. Change the host side of theports:mapping indocker-compose.yml, andKINGLET_BASE_URLwith it.- Sign-in returns
403 INVALID_ORIGIN.KINGLET_BASE_URLdoes not match the browser origin.