kino
Operations

Deploy

Always-on on your machine, and the same stack on a VPS with automatic TLS.

What you do here: leave kino running for real — locally, always on, or on a server with a domain and HTTPS.

Locally, always on

./deploy/install.sh              # builds, brings it up, enables it on boot
./deploy/install.sh --no-build   # only installs the service (images already built)

The script creates the root .env if it does not exist (with a fresh AUTH_SECRET), builds the images, brings the stack up and installs deploy/kino.service as a systemd unit. The unit runs docker compose up -d on boot and down on stop; restart: unless-stopped on the containers covers a process dying.

systemctl status kino
journalctl -u kino -f
docker compose -f docker-compose.yaml logs -f

The names, and why lvh.me

Ports are published on the loopback only, in a dedicated range, so they do not collide with other projects on the machine:

ServiceContainerHost
server (API)300047000
web8047001
landing300247002
postgres543247004
minio (API / console)9000 / 900147007 / 47008

Day-to-day access is by name, through portless: https://kino.lvh.me, https://api.kino.lvh.me, https://landing.kino.lvh.me. ./deploy/portless-aliases.sh registers the three (it is idempotent).

The TLD is lvh.me and not .localhost for a concrete reason: *.lvh.me resolves to 127.0.0.1 and has a public TLD, so Google accepts the OAuth redirect (https://api.kino.lvh.me/api/auth/callback/google). With .localhost, Google refuses.

The proxy needs port 443 free. If another project binds 0.0.0.0:443, portless loses the race and falls back to an ephemeral port — portless doctor tells you.

On a VPS

The same docker-compose.yaml runs on a VPS. An override adds Caddy (automatic TLS via Let's Encrypt and routing by name) and nothing else changes: the images, the migrate step and the auth flow are the local ones.

LocalVPS
Edge / TLSportless (lvh.me)Caddy (Let's Encrypt)
Domainkino.lvh.mekino.yourdomain.com
Env file.env.env.vps
Commanddocker compose up -d --build./deploy/vps.sh up -d --build
FileRole
docker-compose.vps.yamlThe override: adds the caddy service (80/443)
deploy/CaddyfileRoutes each domain to its service (web:80, server:3000, landing:3002)
.env.vps.exampleThe production env template — copy to .env.vps
deploy/vps.shRuns compose with the base file, the override and the VPS env
cp .env.vps.example .env.vps     # domains, secrets, a production OAuth client
./deploy/vps.sh up -d --build
./deploy/vps.sh logs -f caddy    # watch the certificate being issued

Prerequisites: the DNS of the three domains pointing at the VPS, and ports 80/443 open. The ACME e-mail comes from ACME_EMAIL. The 4700x ports still exist but are irrelevant: Caddy talks to the services by name, inside the compose network.

What needs care

  • web and landing are per-environment images: VITE_API_URL and the NEXT_PUBLIC_* are baked at build. Build on the VPS (or in a per-environment CI); do not reuse the local image.
  • Two Google OAuth clients: one for development and one for production, each with its own redirect. Do not share the development secret with production.
  • Keep the domain shape: root plus subdomain (yourdomain.com + api.yourdomain.com), like lvh.me. Patterns such as app.company.com + api.company.com may not share the session cookie.
  • The MinIO console is on the loopback in the VPS: reach it through an SSH tunnel, or swap MinIO for an external S3. The real storage is configured per organization, so this does not change the compose file.

Updating

git pull
docker compose up -d --build      # ./deploy/vps.sh up -d --build on the VPS

The migrate service runs again (it is idempotent) before server comes up.

When it does not come up

SymptomUsually
https://kino.lvh.me does not openThe portless proxy is not up (portless doctor), or something else is holding port 443
A 4700x port is takenAnother service grabbed the range: ss -ltnp | grep 4700
The certificate is not issued on the VPSDNS not pointing at the VPS, or 80/443 closed — ./deploy/vps.sh logs -f caddy
Login works but the session does not stickThe domain shape (see above)
The export refuses with "bundle not configured"RENDER_BUNDLE_DIR — see The render
A build fails with Can't resolve ...A package imported directly but not declared in the app's package.json
  • What runs — the services and the start order.
  • Environment — .env and .env.vps, variable by variable.
  • Running kino — the first run, without the systemd part.

On this page