Changeset 45271b7 in Klonkt
- Timestamp:
- 06/23/2026 09:16:19 PM (3 months ago)
- Branches:
- main
- Children:
- 09ee2bd
- Parents:
- a301d7a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
README.md
ra301d7a r45271b7 34 34 ### Option A — One-command VPS installer (recommended) 35 35 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 37 the easiest path. This single line does everything — installs Node 20, sets up 38 Caddy for automatic HTTPS, runs Klonkt as a background service that auto-restarts 39 on reboot, and adds an update command. It's coexistence-safe (if the server 40 already runs something it picks a free port and skips Caddy), but a clean VPS is 41 simplest. Point your domain's DNS (A + AAAA records) at the server first, then run 42 as root: 41 43 42 44 ```bash … … 44 46 ``` 45 47 46 Then open your domain and finish setup in the browser. Update later with `klonkt-update`. 48 Then open `https://yourdomain.com` and finish setup in the browser. Update anytime 49 with `klonkt-update`. 47 50 48 51 ### Option B — Docker 49 52 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 54 container. Node, ffmpeg and cwebp are inside the image — you only need Docker + 55 Docker Compose. 51 56 52 57 ```bash 53 git clone https://github.com/roboburr/klonkt.git && cd klonkt 54 cp .env.example .env # set SESSION_SECRET + PUBLIC_BASE_URL 58 git clone https://github.com/roboburr/klonkt.git 59 cd klonkt 60 cp .env.example .env # then edit .env: set SESSION_SECRET + PUBLIC_BASE_URL 55 61 docker compose up -d 56 62 ``` 57 63 58 Data (database + media) stays in the `klonkt-data` volume, even across updates. 59 Updating: `git pull && docker compose up -d --build`. 64 Klonkt runs on port 3000 — put your own reverse proxy in front for HTTPS (see 65 step 5 of Option C). Data (database + media) stays in the `klonkt-data` volume, 66 even across updates. Update: `git pull && docker compose up -d --build`. 60 67 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 71 manage, or just want to test it locally. 72 73 **1. Get the code & install dependencies** 62 74 63 75 ```bash 64 git clone https://github.com/roboburr/klonkt.git && cd klonkt 76 git clone https://github.com/roboburr/klonkt.git 77 cd klonkt 65 78 npm ci 66 cp .env.example .env # set SESSION_SECRET + PUBLIC_BASE_URL67 npm start # the database is created on first start68 79 ``` 69 80 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 82 random `SESSION_SECRET` and your `PUBLIC_BASE_URL` (e.g. `https://yourdomain.com`): 83 84 ```bash 85 cp .env.example .env 86 nano .env 87 ``` 88 89 **3. Start it** — the SQLite database is created automatically on first start: 90 91 ```bash 92 npm start # runs on http://localhost:3000 93 ``` 94 95 Just 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 100 npm install -g pm2 101 pm2 start src/server.js --name klonkt 102 pm2 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 106 certificates), put this in `/etc/caddy/Caddyfile` and reload Caddy: 107 108 ```caddy 109 yourdomain.com { 110 reverse_proxy localhost:3000 111 } 112 ``` 113 114 (`cwebp` is optional — `apt install webp` — for WebP image conversion.) 72 115 73 116 ### HTTPS (Docker / bare Node)
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)