Self-hosting
Hotaru runs as one Docker container, built from this repository’s Dockerfile. Its data is two SQLite files on a volume at /data. There is no separate database server, Redis or worker. Migrations run when the container starts. Which settings exist, and what the container does: deployment.md.
You need:
- A server with Docker and Docker Compose 2.24 or later. Hotaru needs about 1 GB of RAM while running, and about 2 GB while it builds its image.
- A domain or subdomain whose DNS record points to the server, such as
hotaru.example.com. - Optional:
- an OpenRouter key for the AI features (costs.md)
- a Resend key for email (email.md)
- storage for backups (backups.md)
There is no published image: Compose builds it from the source on your server.
Docker Compose with Caddy (recommended)
Caddy gets the HTTPS certificate and passes the client’s address on to Hotaru.
-
Get the code on the server:
Terminal window git clone <repository URL> hotaru && cd hotaru -
Configure it. Copy the example and fill in the two required values:
Terminal window cp .env.example .envORIGIN: the address people open, such ashttps://hotaru.example.com.BETTER_AUTH_SECRET: the output ofopenssl rand -base64 32.
Everything else is optional and explained in the file.
-
Start it. Ports 80 and 443 must be free.
Terminal window docker compose -f compose.yaml -f compose.caddy.yaml up -d --buildTo avoid typing both files every time, add
COMPOSE_FILE=compose.yaml:compose.caddy.yamlto.env. Thendocker compose up -d --builddoes the same. -
Check it.
https://hotaru.example.com/healthanswers{"status":"ok",…}. In the log (docker compose logs hotaru), the first lines say which optional parts are off, such as backups. -
Create the first admin (asks for the password):
Terminal window docker compose exec hotaru node /app/packages/core/scripts/user.ts create --email [email protected] --name "Your Name" --username you --adminThen log in. To let other people in, open Settings → Accounts (accounts.md).
Trying it on your own computer
Without a domain, publish the port on localhost only. Create compose.override.yaml next to compose.yaml:
services: hotaru: ports: - '127.0.0.1:3000:3000'In .env, set ORIGIN=http://localhost:3000. Then run docker compose up -d --build and open http://localhost:3000. Without a proxy, all clients share one login counter, and the log says so once (auth.md). That’s fine on your own computer, but never publish the port to the internet like this.
Coolify
Coolify runs Traefik, which gets the certificate and sets X-Real-Ip. Hotaru’s defaults fit it.
-
New resource → your Git repository (public, or private through Coolify’s GitHub App) → branch.
-
Build pack: Dockerfile, port
3000. Docker Compose withcompose.yamlworks too. Then assign the domain to thehotaruservice. -
Domain:
https://hotaru.example.com. -
Persistent storage: a volume with mount path
/data. With the Dockerfile build pack you must add it yourself. Without it, every redeploy starts with an empty database. -
Health check: path
/health, port3000. -
Environment variables: at least
ORIGINandBETTER_AUTH_SECRET. Everything else as in.env.example. -
Deploy, then create the first admin in the resource’s Terminal with the command from step 5 above, without
docker compose exec hotaru:Terminal window node /app/packages/core/scripts/user.ts create --email [email protected] --name "Your Name" --username you --admin
Optional containers, such as the screenshot browser or a YouTube proxy, are separate Docker Compose resources in the same project. Turn on Connect to Predefined Network for them, then redeploy them, so they share the coolify network with Hotaru. There they are reached by their full container name (docker ps shows it), not the short service name.
Another reverse proxy
Route your proxy to the hotaru service on port 3000. It must set X-Real-Ip to the client’s address and overwrite whatever the client sent. Settings for nginx, Traefik and Cloudflare are in auth.md. A proxy that terminates HTTPS somewhere else works the same way.
Behind Cloudflare or another CDN, don’t let it cache /service-worker.js and /_app/version.json, or browsers keep the old service worker after an update and push notifications stop arriving (deployment.md).
Optional parts
| Part | How |
|---|---|
| AI: gate, summaries, scores, chat | OPENROUTER_API_KEY. It is used for admins only; everyone else adds their own key in the app (costs.md) |
| Email (confirmation, password reset, invites) | RESEND_API_KEY and EMAIL_FROM. Without them, the links are written to the log (email.md) |
| Backups | LITESTREAM_REPLICA_URL (S3-compatible storage or SFTP) (backups.md). Never point two installations at one replica: an empty volume restores from it |
| Screenshots of pages without an image | compose.screenshots.yaml and three settings (images.md) |
| Transcripts when YouTube blocks your server | YOUTUBE_PROXY_URL (youtube.md) |
Upgrading
Back up first (backups.md). Then:
git pulldocker compose up -d --buildThe new container applies new migrations when it starts. The data stays on the volume.
Testing a fresh install
scripts/compose-smoke.sh runs these steps on a throwaway Compose project (hotaru-smoke) with only the values from .env.example and a generated secret:
- build and start
/health- create the first admin with the CLI
- log in
At the end, it removes the containers and the volume. CI runs it on every pull request, next to a secret scan with gitleaks.
Rules
- One container per volume, never more (ADR-0001). Don’t scale the service, and don’t start a second installation on the same volume or backup replica.
- Keep
BETTER_AUTH_SECRET. Changing it logs everyone out and makes stored integration tokens and model keys unreadable. - Keep the port behind the proxy. Hotaru trusts the
X-Real-Ipheader for its rate limits.