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 -fThe 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:
| Service | Container | Host |
|---|---|---|
server (API) | 3000 | 47000 |
web | 80 | 47001 |
landing | 3002 | 47002 |
postgres | 5432 | 47004 |
minio (API / console) | 9000 / 9001 | 47007 / 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.
| Local | VPS | |
|---|---|---|
| Edge / TLS | portless (lvh.me) | Caddy (Let's Encrypt) |
| Domain | kino.lvh.me | kino.yourdomain.com |
| Env file | .env | .env.vps |
| Command | docker compose up -d --build | ./deploy/vps.sh up -d --build |
| File | Role |
|---|---|
docker-compose.vps.yaml | The override: adds the caddy service (80/443) |
deploy/Caddyfile | Routes each domain to its service (web:80, server:3000, landing:3002) |
.env.vps.example | The production env template — copy to .env.vps |
deploy/vps.sh | Runs 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 issuedPrerequisites: 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
webandlandingare per-environment images:VITE_API_URLand theNEXT_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), likelvh.me. Patterns such asapp.company.com+api.company.commay 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 VPSThe migrate service runs again (it is idempotent) before server comes up.
When it does not come up
| Symptom | Usually |
|---|---|
https://kino.lvh.me does not open | The portless proxy is not up (portless doctor), or something else is holding port 443 |
A 4700x port is taken | Another service grabbed the range: ss -ltnp | grep 4700 |
| The certificate is not issued on the VPS | DNS not pointing at the VPS, or 80/443 closed — ./deploy/vps.sh logs -f caddy |
| Login works but the session does not stick | The 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 |
Related
- What runs — the services and the start order.
- Environment —
.envand.env.vps, variable by variable. - Running kino — the first run, without the systemd part.