Skip to content

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:

There is no published image: Compose builds it from the source on your server.

Caddy gets the HTTPS certificate and passes the client’s address on to Hotaru.

  1. Get the code on the server:

    Terminal window
    git clone <repository URL> hotaru && cd hotaru
  2. Configure it. Copy the example and fill in the two required values:

    Terminal window
    cp .env.example .env
    • ORIGIN: the address people open, such as https://hotaru.example.com.
    • BETTER_AUTH_SECRET: the output of openssl rand -base64 32.

    Everything else is optional and explained in the file.

  3. Start it. Ports 80 and 443 must be free.

    Terminal window
    docker compose -f compose.yaml -f compose.caddy.yaml up -d --build

    To avoid typing both files every time, add COMPOSE_FILE=compose.yaml:compose.caddy.yaml to .env. Then docker compose up -d --build does the same.

  4. Check it. https://hotaru.example.com/health answers {"status":"ok",…}. In the log (docker compose logs hotaru), the first lines say which optional parts are off, such as backups.

  5. 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 --admin

    Then 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.

  1. New resource → your Git repository (public, or private through Coolify’s GitHub App) → branch.

  2. Build pack: Dockerfile, port 3000. Docker Compose with compose.yaml works too. Then assign the domain to the hotaru service.

  3. Domain: https://hotaru.example.com.

  4. 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.

  5. Health check: path /health, port 3000.

  6. Environment variables: at least ORIGIN and BETTER_AUTH_SECRET. Everything else as in .env.example.

  7. 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:

Terminal window
git pull
docker compose up -d --build

The 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:

  1. build and start
  2. /health
  3. create the first admin with the CLI
  4. 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-Ip header for its rate limits.