| [184393c] | 1 | # Klonkt
|
|---|
| [7bc636b] | 2 |
|
|---|
| [bbbfa3c] | 3 | Your own, **self-hosted** corner of the web — for your story, your visuals and
|
|---|
| 4 | your sound. Built on **Node + SQLite + htmx**: lightweight, server-rendered, and
|
|---|
| 5 | yours. No algorithm, no ads, no platform sitting in between.
|
|---|
| [7bc636b] | 6 |
|
|---|
| [bbbfa3c] | 7 | ## What it does
|
|---|
| [7bc636b] | 8 |
|
|---|
| [7008b28] | 9 | - **Solo** — one personal site, entirely yours, on your own domain.
|
|---|
| [bbbfa3c] | 10 | - **Blog & photos** — posts with cover, tags, timeline or grid.
|
|---|
| 11 | - **Host your own music** — built-in audio player with tracks, albums and playlists.
|
|---|
| [7008b28] | 12 | - **Fediverse-native** — your posts federate over **ActivityPub**: people follow,
|
|---|
| 13 | like, boost and reply from Mastodon (or another Klonkt). You can follow accounts,
|
|---|
| 14 | see a home timeline, and reply/like back — Klonkt is a full fediverse client.
|
|---|
| [bbbfa3c] | 15 | - **Grow**: newsletter, download-for-email, EPK/press kit, link-in-bio,
|
|---|
| 16 | show calendar, and **cookie-free statistics**.
|
|---|
| [ce16d8a] | 17 | - **Circles** — a curated feed of the makers you choose: feature accounts (other Klonkt
|
|---|
| 18 | sites, Mastodon, PeerTube — any fediverse server) and their public posts appear in your
|
|---|
| 19 | Circle. Decentralized, no central platform — built on ActivityPub.
|
|---|
| [bbbfa3c] | 20 | - **Themes & languages** — multiple palettes (light + dark), interface in EN/NL/DE.
|
|---|
| 21 | - **Installable (PWA)**, **privacy-first** (self-hosted fonts, no tracking).
|
|---|
| [7bc636b] | 22 |
|
|---|
| [bbbfa3c] | 23 | ### Lite mode (no audio)
|
|---|
| [7bc636b] | 24 |
|
|---|
| [bbbfa3c] | 25 | Set `KLONKT_AUDIO=off` in `.env` to disable the entire audio/music feature.
|
|---|
| 26 | Klonkt then runs as a lightweight **blog/photo/EPK/links site without ffmpeg** —
|
|---|
| [7008b28] | 27 | ideal for minimal hosting. Circles and external embeds
|
|---|
| [bbbfa3c] | 28 | (YouTube/SoundCloud/Spotify) keep working.
|
|---|
| [7bc636b] | 29 |
|
|---|
| [196e1be] | 30 | It's **fully reversible**: set `KLONKT_AUDIO` back to `on` (or remove the line)
|
|---|
| 31 | and restart — no reinstall. The flag only toggles the audio routes/UI; the
|
|---|
| 32 | database tables are never dropped, so any tracks you had are preserved.
|
|---|
| 33 |
|
|---|
| [bbbfa3c] | 34 | ## Self-hosting
|
|---|
| [5a2cb69] | 35 |
|
|---|
| [bbbfa3c] | 36 | Klonkt is a **Node app** — run it on a **VPS, in Docker, or on a Node hosting
|
|---|
| 37 | platform (PaaS)**. **Not** on classic shared PHP hosting. The database (SQLite)
|
|---|
| 38 | creates itself on first start.
|
|---|
| [5a2cb69] | 39 |
|
|---|
| [c648b04] | 40 | > **Requires [Node.js](https://nodejs.org/) 20 or newer.** The one-command VPS
|
|---|
| 41 | > installer and the Docker image include it; only a manual install needs you to
|
|---|
| 42 | > provide it.
|
|---|
| 43 |
|
|---|
| [6d3e2c1] | 44 | ### Option A — One-command VPS installer (recommended)
|
|---|
| [5a2cb69] | 45 |
|
|---|
| [45271b7] | 46 | **Good if:** you have (or just rented) a fresh, empty Debian/Ubuntu VPS and want
|
|---|
| 47 | the easiest path. This single line does everything — installs Node 20, sets up
|
|---|
| 48 | Caddy for automatic HTTPS, runs Klonkt as a background service that auto-restarts
|
|---|
| 49 | on reboot, and adds an update command. It's coexistence-safe (if the server
|
|---|
| 50 | already runs something it picks a free port and skips Caddy), but a clean VPS is
|
|---|
| 51 | simplest. Point your domain's DNS (A + AAAA records) at the server first, then run
|
|---|
| 52 | as root:
|
|---|
| [7bc636b] | 53 |
|
|---|
| 54 | ```bash
|
|---|
| [6d3e2c1] | 55 | curl -fsSL https://klonkt.com/install.sh | sudo bash -s -- --domain yourdomain.com
|
|---|
| [7bc636b] | 56 | ```
|
|---|
| 57 |
|
|---|
| [45271b7] | 58 | Then open `https://yourdomain.com` and finish setup in the browser. Update anytime
|
|---|
| 59 | with `klonkt-update`.
|
|---|
| [184393c] | 60 |
|
|---|
| [6d3e2c1] | 61 | ### Option B — Docker
|
|---|
| [184393c] | 62 |
|
|---|
| [45271b7] | 63 | **Good if:** you already use Docker, or want everything bundled in one isolated
|
|---|
| 64 | container. Node, ffmpeg and cwebp are inside the image — you only need Docker +
|
|---|
| 65 | Docker Compose.
|
|---|
| [5a2cb69] | 66 |
|
|---|
| 67 | ```bash
|
|---|
| [45271b7] | 68 | git clone https://github.com/roboburr/klonkt.git
|
|---|
| 69 | cd klonkt
|
|---|
| [09ee2bd] | 70 | cp .env.example .env # works as-is; optionally set PUBLIC_BASE_URL to your domain
|
|---|
| [6d3e2c1] | 71 | docker compose up -d
|
|---|
| [5a2cb69] | 72 | ```
|
|---|
| 73 |
|
|---|
| [09ee2bd] | 74 | `SESSION_SECRET` is auto-generated on first start, so the defaults work as-is.
|
|---|
| [45271b7] | 75 | Klonkt runs on port 3000 — put your own reverse proxy in front for HTTPS (see
|
|---|
| 76 | step 5 of Option C). Data (database + media) stays in the `klonkt-data` volume,
|
|---|
| 77 | even across updates. Update: `git pull && docker compose up -d --build`.
|
|---|
| [184393c] | 78 |
|
|---|
| [45271b7] | 79 | ### Option C — manual (Node 20+), step by step
|
|---|
| 80 |
|
|---|
| 81 | **Good if:** you want full control, are adding Klonkt to a server you already
|
|---|
| 82 | manage, or just want to test it locally.
|
|---|
| 83 |
|
|---|
| 84 | **1. Get the code & install dependencies**
|
|---|
| [5a2cb69] | 85 |
|
|---|
| 86 | ```bash
|
|---|
| [45271b7] | 87 | git clone https://github.com/roboburr/klonkt.git
|
|---|
| 88 | cd klonkt
|
|---|
| [5a2cb69] | 89 | npm ci
|
|---|
| 90 | ```
|
|---|
| 91 |
|
|---|
| [09ee2bd] | 92 | **2. Create your config.** `SESSION_SECRET` (the key that signs login cookies) is
|
|---|
| 93 | auto-generated on first start, so this works as-is. For production, set
|
|---|
| 94 | `PUBLIC_BASE_URL` to your site address (e.g. `https://yourdomain.com`) so email &
|
|---|
| 95 | login links are correct:
|
|---|
| [45271b7] | 96 |
|
|---|
| 97 | ```bash
|
|---|
| 98 | cp .env.example .env
|
|---|
| [7008b28] | 99 | nano .env # optional: PUBLIC_BASE_URL, plus SMTP if you want it
|
|---|
| [45271b7] | 100 | ```
|
|---|
| 101 |
|
|---|
| 102 | **3. Start it** — the SQLite database is created automatically on first start:
|
|---|
| 103 |
|
|---|
| 104 | ```bash
|
|---|
| 105 | npm start # runs on http://localhost:3000
|
|---|
| 106 | ```
|
|---|
| 107 |
|
|---|
| 108 | Just testing locally? Stop here and open `http://localhost:3000`.
|
|---|
| 109 |
|
|---|
| 110 | **4. Keep it running** across crashes and reboots (easiest is pm2):
|
|---|
| 111 |
|
|---|
| 112 | ```bash
|
|---|
| 113 | npm install -g pm2
|
|---|
| 114 | pm2 start src/server.js --name klonkt
|
|---|
| 115 | pm2 save && pm2 startup # run the one command it prints, once
|
|---|
| 116 | ```
|
|---|
| 117 |
|
|---|
| 118 | **5. Add HTTPS** with a reverse proxy in front. With Caddy (automatic
|
|---|
| 119 | certificates), put this in `/etc/caddy/Caddyfile` and reload Caddy:
|
|---|
| 120 |
|
|---|
| 121 | ```caddy
|
|---|
| 122 | yourdomain.com {
|
|---|
| 123 | reverse_proxy localhost:3000
|
|---|
| 124 | }
|
|---|
| 125 | ```
|
|---|
| 126 |
|
|---|
| [f99bbe8] | 127 | By default the app binds to `127.0.0.1` (via `HOST` in `.env`), so only your
|
|---|
| 128 | reverse proxy can reach it — not the open internet. Local testing on the same
|
|---|
| 129 | machine (`localhost:3000`) still works. Only set `HOST=0.0.0.0` if you need direct
|
|---|
| 130 | external access without a proxy (then open the port in your firewall and add HTTPS
|
|---|
| 131 | yourself).
|
|---|
| 132 |
|
|---|
| [45271b7] | 133 | (`cwebp` is optional — `apt install webp` — for WebP image conversion.)
|
|---|
| [5a2cb69] | 134 |
|
|---|
| [bbbfa3c] | 135 | ### HTTPS (Docker / bare Node)
|
|---|
| [5a2cb69] | 136 |
|
|---|
| [bbbfa3c] | 137 | Put a reverse proxy in front of the app. With **Caddy** (automatic Let's Encrypt):
|
|---|
| [5a2cb69] | 138 |
|
|---|
| 139 | ```caddy
|
|---|
| [bbbfa3c] | 140 | yourdomain.com {
|
|---|
| [5a2cb69] | 141 | reverse_proxy localhost:3000
|
|---|
| 142 | encode gzip zstd
|
|---|
| 143 | }
|
|---|
| 144 | ```
|
|---|
| 145 |
|
|---|
| [bbbfa3c] | 146 | (The VPS installer sets up Caddy + HTTPS for you already.)
|
|---|
| [184393c] | 147 |
|
|---|
| [bbbfa3c] | 148 | ### First run
|
|---|
| [5a2cb69] | 149 |
|
|---|
| [bbbfa3c] | 150 | Open your site → you get the **setup wizard**: pick your language, name your site
|
|---|
| 151 | and create your admin. The **first user automatically becomes the administrator**;
|
|---|
| 152 | registration then closes. Lost your password?
|
|---|
| [184393c] | 153 | `npm run reset-admin` (Docker: `docker compose exec klonkt npm run reset-admin`).
|
|---|
| 154 |
|
|---|
| [bbbfa3c] | 155 | ## Configuration (`.env`)
|
|---|
| [184393c] | 156 |
|
|---|
| [bbbfa3c] | 157 | | Variable | Required | What |
|
|---|
| [184393c] | 158 | |---|---|---|
|
|---|
| [bbbfa3c] | 159 | | `SESSION_SECRET` | ✅ | Random string of ≥32 characters |
|
|---|
| 160 | | `PUBLIC_BASE_URL` | ✅ | Canonical URL (e.g. `https://yourdomain.com`) |
|
|---|
| 161 | | `SMTP_HOST` / `_PORT` / `_USER` / `_PASS` / `_FROM` | — | Email for password reset + newsletter |
|
|---|
| 162 | | `KLONKT_DEFAULT_LANG` | — | Default language for visitors (`en`/`nl`/`de`) |
|
|---|
| 163 | | `KLONKT_AUDIO` | — | `off` = lite mode (no audio/ffmpeg) |
|
|---|
| [7bc636b] | 164 |
|
|---|
| 165 | ## Stack
|
|---|
| 166 |
|
|---|
| 167 | - **Runtime:** Node 20+
|
|---|
| 168 | - **Web:** Express + Helmet + express-session
|
|---|
| [bbbfa3c] | 169 | - **DB:** better-sqlite3 (WAL), self-migrating on boot
|
|---|
| 170 | - **Templates:** EJS (server-rendered) + **htmx 1.9** (vendored, no build step)
|
|---|
| 171 | - **Audio:** ffmpeg-static (bundled)
|
|---|
| [ce16d8a] | 172 | - **Fediverse / Circles:** ActivityPub (HTTP Signatures) — federates with Mastodon, PeerTube and other Klonkt sites
|
|---|
| [184393c] | 173 | - **Fonts:** self-hosted variable woff2 (Fraunces / Plus Jakarta Sans)
|
|---|
| [7bc636b] | 174 |
|
|---|
| [bbbfa3c] | 175 | ## Project structure
|
|---|
| [7bc636b] | 176 |
|
|---|
| 177 | ```
|
|---|
| 178 | src/
|
|---|
| [bbbfa3c] | 179 | ├── server.js # Express bootstrap + route mounting
|
|---|
| [7008b28] | 180 | ├── config/ # database, mailer, feature flags
|
|---|
| [bbbfa3c] | 181 | ├── db/migrations/ # SQLite schema (001-init.sql)
|
|---|
| 182 | ├── middleware/ # site resolving, auth, render (htmx-aware)
|
|---|
| 183 | ├── routes/ # per-resource Express routers (posts, auth, admin-*, circle, …)
|
|---|
| 184 | ├── services/ # domain logic (federation, stats, mailer, permissions, …)
|
|---|
| [184393c] | 185 | ├── views/ # shell.ejs + partials/ + pages/ (EJS)
|
|---|
| [bbbfa3c] | 186 | └── assets/ # css/ (palette tokens + components), js/ (htmx, player), fonts/
|
|---|
| [7bc636b] | 187 | ```
|
|---|
| 188 |
|
|---|
| [bbbfa3c] | 189 | ## License
|
|---|
| [7bc636b] | 190 |
|
|---|
| [bbbfa3c] | 191 | **AGPL-3.0-or-later** — see [LICENSE](LICENSE). Klonkt is free software: you may
|
|---|
| 192 | use, study, modify and distribute it. The AGPL does require that a modified
|
|---|
| 193 | version you offer as a network service makes its source code available to the
|
|---|
| 194 | users of that service. Made by robo.burr (Robin Genis) ·
|
|---|
| [184393c] | 195 | <https://klonkt.com>
|
|---|