| [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 |
|
|---|
| [bbbfa3c] | 9 | - **Solo or hub** — one personal site, or a label/collective with multiple
|
|---|
| 10 | makers under one roof.
|
|---|
| 11 | - **Blog & photos** — posts with cover, tags, timeline or grid.
|
|---|
| 12 | - **Host your own music** — built-in audio player with tracks, albums and playlists.
|
|---|
| 13 | - **Fans & comments** — visitors sign in with Google (optional) and comment.
|
|---|
| 14 | - **Grow**: newsletter, download-for-email, EPK/press kit, link-in-bio,
|
|---|
| 15 | show calendar, and **cookie-free statistics**.
|
|---|
| 16 | - **Circles** — connect your site with other Klonkt sites and show each other's
|
|---|
| 17 | public posts; decentralized, with no central platform (Ed25519-signed federation).
|
|---|
| 18 | - **Themes & languages** — multiple palettes (light + dark), interface in EN/NL/DE.
|
|---|
| 19 | - **Installable (PWA)**, **privacy-first** (self-hosted fonts, no tracking).
|
|---|
| [7bc636b] | 20 |
|
|---|
| [bbbfa3c] | 21 | ### Lite mode (no audio)
|
|---|
| [7bc636b] | 22 |
|
|---|
| [bbbfa3c] | 23 | Set `KLONKT_AUDIO=off` in `.env` to disable the entire audio/music feature.
|
|---|
| 24 | Klonkt then runs as a lightweight **blog/photo/EPK/links site without ffmpeg** —
|
|---|
| 25 | ideal for minimal hosting. Hub, Circles and external embeds
|
|---|
| 26 | (YouTube/SoundCloud/Spotify) keep working.
|
|---|
| [7bc636b] | 27 |
|
|---|
| [bbbfa3c] | 28 | ## Self-hosting
|
|---|
| [5a2cb69] | 29 |
|
|---|
| [bbbfa3c] | 30 | Klonkt is a **Node app** — run it on a **VPS, in Docker, or on a Node hosting
|
|---|
| 31 | platform (PaaS)**. **Not** on classic shared PHP hosting. The database (SQLite)
|
|---|
| 32 | creates itself on first start.
|
|---|
| [5a2cb69] | 33 |
|
|---|
| [6d3e2c1] | 34 | ### Option A — One-command VPS installer (recommended)
|
|---|
| [5a2cb69] | 35 |
|
|---|
| [45271b7] | 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:
|
|---|
| [7bc636b] | 43 |
|
|---|
| 44 | ```bash
|
|---|
| [6d3e2c1] | 45 | curl -fsSL https://klonkt.com/install.sh | sudo bash -s -- --domain yourdomain.com
|
|---|
| [7bc636b] | 46 | ```
|
|---|
| 47 |
|
|---|
| [45271b7] | 48 | Then open `https://yourdomain.com` and finish setup in the browser. Update anytime
|
|---|
| 49 | with `klonkt-update`.
|
|---|
| [184393c] | 50 |
|
|---|
| [6d3e2c1] | 51 | ### Option B — Docker
|
|---|
| [184393c] | 52 |
|
|---|
| [45271b7] | 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.
|
|---|
| [5a2cb69] | 56 |
|
|---|
| 57 | ```bash
|
|---|
| [45271b7] | 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
|
|---|
| [6d3e2c1] | 61 | docker compose up -d
|
|---|
| [5a2cb69] | 62 | ```
|
|---|
| 63 |
|
|---|
| [45271b7] | 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`.
|
|---|
| [184393c] | 67 |
|
|---|
| [45271b7] | 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**
|
|---|
| [5a2cb69] | 74 |
|
|---|
| 75 | ```bash
|
|---|
| [45271b7] | 76 | git clone https://github.com/roboburr/klonkt.git
|
|---|
| 77 | cd klonkt
|
|---|
| [5a2cb69] | 78 | npm ci
|
|---|
| 79 | ```
|
|---|
| 80 |
|
|---|
| [45271b7] | 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.)
|
|---|
| [5a2cb69] | 115 |
|
|---|
| [bbbfa3c] | 116 | ### HTTPS (Docker / bare Node)
|
|---|
| [5a2cb69] | 117 |
|
|---|
| [bbbfa3c] | 118 | Put a reverse proxy in front of the app. With **Caddy** (automatic Let's Encrypt):
|
|---|
| [5a2cb69] | 119 |
|
|---|
| 120 | ```caddy
|
|---|
| [bbbfa3c] | 121 | yourdomain.com {
|
|---|
| [5a2cb69] | 122 | reverse_proxy localhost:3000
|
|---|
| 123 | encode gzip zstd
|
|---|
| 124 | }
|
|---|
| 125 | ```
|
|---|
| 126 |
|
|---|
| [bbbfa3c] | 127 | (The VPS installer sets up Caddy + HTTPS for you already.)
|
|---|
| [184393c] | 128 |
|
|---|
| [bbbfa3c] | 129 | ### First run
|
|---|
| [5a2cb69] | 130 |
|
|---|
| [bbbfa3c] | 131 | Open your site → you get the **setup wizard**: pick your language, name your site
|
|---|
| 132 | and create your admin. The **first user automatically becomes the administrator**;
|
|---|
| 133 | registration then closes. Lost your password?
|
|---|
| [184393c] | 134 | `npm run reset-admin` (Docker: `docker compose exec klonkt npm run reset-admin`).
|
|---|
| 135 |
|
|---|
| [bbbfa3c] | 136 | ## Configuration (`.env`)
|
|---|
| [184393c] | 137 |
|
|---|
| [bbbfa3c] | 138 | | Variable | Required | What |
|
|---|
| [184393c] | 139 | |---|---|---|
|
|---|
| [bbbfa3c] | 140 | | `SESSION_SECRET` | ✅ | Random string of ≥32 characters |
|
|---|
| 141 | | `PUBLIC_BASE_URL` | ✅ | Canonical URL (e.g. `https://yourdomain.com`) |
|
|---|
| 142 | | `GOOGLE_CLIENT_ID` / `_SECRET` / `_REDIRECT_URI` | — | Google login for listeners (your own OAuth client; never grants admin) |
|
|---|
| 143 | | `SMTP_HOST` / `_PORT` / `_USER` / `_PASS` / `_FROM` | — | Email for password reset + newsletter |
|
|---|
| 144 | | `KLONKT_DEFAULT_LANG` | — | Default language for visitors (`en`/`nl`/`de`) |
|
|---|
| 145 | | `KLONKT_AUDIO` | — | `off` = lite mode (no audio/ffmpeg) |
|
|---|
| [7bc636b] | 146 |
|
|---|
| 147 | ## Stack
|
|---|
| 148 |
|
|---|
| 149 | - **Runtime:** Node 20+
|
|---|
| 150 | - **Web:** Express + Helmet + express-session
|
|---|
| [bbbfa3c] | 151 | - **DB:** better-sqlite3 (WAL), self-migrating on boot
|
|---|
| 152 | - **Templates:** EJS (server-rendered) + **htmx 1.9** (vendored, no build step)
|
|---|
| 153 | - **Audio:** ffmpeg-static (bundled)
|
|---|
| 154 | - **Circles:** Ed25519-signed pull (libsodium via Node crypto)
|
|---|
| [184393c] | 155 | - **Fonts:** self-hosted variable woff2 (Fraunces / Plus Jakarta Sans)
|
|---|
| [7bc636b] | 156 |
|
|---|
| [bbbfa3c] | 157 | ## Project structure
|
|---|
| [7bc636b] | 158 |
|
|---|
| 159 | ```
|
|---|
| 160 | src/
|
|---|
| [bbbfa3c] | 161 | ├── server.js # Express bootstrap + route mounting
|
|---|
| 162 | ├── config/ # database, mailer, google, feature flags
|
|---|
| 163 | ├── db/migrations/ # SQLite schema (001-init.sql)
|
|---|
| 164 | ├── middleware/ # site resolving, auth, render (htmx-aware)
|
|---|
| 165 | ├── routes/ # per-resource Express routers (posts, auth, admin-*, circle, …)
|
|---|
| 166 | ├── services/ # domain logic (federation, stats, mailer, permissions, …)
|
|---|
| [184393c] | 167 | ├── views/ # shell.ejs + partials/ + pages/ (EJS)
|
|---|
| [bbbfa3c] | 168 | └── assets/ # css/ (palette tokens + components), js/ (htmx, player), fonts/
|
|---|
| [7bc636b] | 169 | ```
|
|---|
| 170 |
|
|---|
| [bbbfa3c] | 171 | ## License
|
|---|
| [7bc636b] | 172 |
|
|---|
| [bbbfa3c] | 173 | **AGPL-3.0-or-later** — see [LICENSE](LICENSE). Klonkt is free software: you may
|
|---|
| 174 | use, study, modify and distribute it. The AGPL does require that a modified
|
|---|
| 175 | version you offer as a network service makes its source code available to the
|
|---|
| 176 | users of that service. Made by robo.burr (Robin Genis) ·
|
|---|
| [184393c] | 177 | <https://klonkt.com>
|
|---|