Changeset 45271b7 in Klonkt


Ignore:
Timestamp:
06/23/2026 09:16:19 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
09ee2bd
Parents:
a301d7a
Message:

docs: clearer A/B/C for beginners + complete Option C

Add a 'Good if:' line per option and write Option C as a full step-by-step
(clone, config, start, keep running with pm2, HTTPS via Caddy).

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • README.md

    ra301d7a r45271b7  
    3434### Option A — One-command VPS installer (recommended)
    3535
    36 **Best on a fresh, empty Debian/Ubuntu VPS** — a cheap box with nothing else on
    37 it. One command installs Node 20, Caddy (automatic HTTPS) and a systemd service.
    38 If the server already runs something it adapts (picks a free port and skips Caddy
    39 when another web server is present, then prints reverse-proxy instructions), but a
    40 clean VPS is the simplest, most reliable setup:
     36**Good if:** you have (or just rented) a fresh, empty Debian/Ubuntu VPS and want
     37the easiest path. This single line does everything — installs Node 20, sets up
     38Caddy for automatic HTTPS, runs Klonkt as a background service that auto-restarts
     39on reboot, and adds an update command. It's coexistence-safe (if the server
     40already runs something it picks a free port and skips Caddy), but a clean VPS is
     41simplest. Point your domain's DNS (A + AAAA records) at the server first, then run
     42as root:
    4143
    4244```bash
     
    4446```
    4547
    46 Then open your domain and finish setup in the browser. Update later with `klonkt-update`.
     48Then open `https://yourdomain.com` and finish setup in the browser. Update anytime
     49with `klonkt-update`.
    4750
    4851### Option B — Docker
    4952
    50 Node, ffmpeg and cwebp are inside the image; you only need Docker.
     53**Good if:** you already use Docker, or want everything bundled in one isolated
     54container. Node, ffmpeg and cwebp are inside the image — you only need Docker +
     55Docker Compose.
    5156
    5257```bash
    53 git clone https://github.com/roboburr/klonkt.git && cd klonkt
    54 cp .env.example .env          # set SESSION_SECRET + PUBLIC_BASE_URL
     58git clone https://github.com/roboburr/klonkt.git
     59cd klonkt
     60cp .env.example .env          # then edit .env: set SESSION_SECRET + PUBLIC_BASE_URL
    5561docker compose up -d
    5662```
    5763
    58 Data (database + media) stays in the `klonkt-data` volume, even across updates.
    59 Updating: `git pull && docker compose up -d --build`.
     64Klonkt runs on port 3000 — put your own reverse proxy in front for HTTPS (see
     65step 5 of Option C). Data (database + media) stays in the `klonkt-data` volume,
     66even across updates. Update: `git pull && docker compose up -d --build`.
    6067
    61 ### Option C — bare Node (20+)
     68### Option C — manual (Node 20+), step by step
     69
     70**Good if:** you want full control, are adding Klonkt to a server you already
     71manage, or just want to test it locally.
     72
     73**1. Get the code & install dependencies**
    6274
    6375```bash
    64 git clone https://github.com/roboburr/klonkt.git && cd klonkt
     76git clone https://github.com/roboburr/klonkt.git
     77cd klonkt
    6578npm ci
    66 cp .env.example .env          # set SESSION_SECRET + PUBLIC_BASE_URL
    67 npm start                     # the database is created on first start
    6879```
    6980
    70 For production, put it behind a process manager (pm2/systemd) and a
    71 reverse proxy. `cwebp` is optional (`apt install webp`) for WebP images.
     81**2. Create your config** — copy the example and edit it; at minimum set a long
     82random `SESSION_SECRET` and your `PUBLIC_BASE_URL` (e.g. `https://yourdomain.com`):
     83
     84```bash
     85cp .env.example .env
     86nano .env
     87```
     88
     89**3. Start it** — the SQLite database is created automatically on first start:
     90
     91```bash
     92npm start          # runs on http://localhost:3000
     93```
     94
     95Just testing locally? Stop here and open `http://localhost:3000`.
     96
     97**4. Keep it running** across crashes and reboots (easiest is pm2):
     98
     99```bash
     100npm install -g pm2
     101pm2 start src/server.js --name klonkt
     102pm2 save && pm2 startup     # run the one command it prints, once
     103```
     104
     105**5. Add HTTPS** with a reverse proxy in front. With Caddy (automatic
     106certificates), put this in `/etc/caddy/Caddyfile` and reload Caddy:
     107
     108```caddy
     109yourdomain.com {
     110    reverse_proxy localhost:3000
     111}
     112```
     113
     114(`cwebp` is optional — `apt install webp` — for WebP image conversion.)
    72115
    73116### HTTPS (Docker / bare Node)
Note: See TracChangeset for help on using the changeset viewer.