| 1 | # Klonkt
|
|---|
| 2 |
|
|---|
| 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.
|
|---|
| 6 |
|
|---|
| 7 | ## What it does
|
|---|
| 8 |
|
|---|
| 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).
|
|---|
| 20 |
|
|---|
| 21 | ### Lite mode (no audio)
|
|---|
| 22 |
|
|---|
| 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.
|
|---|
| 27 |
|
|---|
| 28 | ## Self-hosting
|
|---|
| 29 |
|
|---|
| 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.
|
|---|
| 33 |
|
|---|
| 34 | ### Option A — One-command VPS installer (recommended)
|
|---|
| 35 |
|
|---|
| 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:
|
|---|
| 43 |
|
|---|
| 44 | ```bash
|
|---|
| 45 | curl -fsSL https://klonkt.com/install.sh | sudo bash -s -- --domain yourdomain.com
|
|---|
| 46 | ```
|
|---|
| 47 |
|
|---|
| 48 | Then open `https://yourdomain.com` and finish setup in the browser. Update anytime
|
|---|
| 49 | with `klonkt-update`.
|
|---|
| 50 |
|
|---|
| 51 | ### Option B — Docker
|
|---|
| 52 |
|
|---|
| 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.
|
|---|
| 56 |
|
|---|
| 57 | ```bash
|
|---|
| 58 | git clone https://github.com/roboburr/klonkt.git
|
|---|
| 59 | cd klonkt
|
|---|
| 60 | cp .env.example .env # works as-is; optionally set PUBLIC_BASE_URL to your domain
|
|---|
| 61 | docker compose up -d
|
|---|
| 62 | ```
|
|---|
| 63 |
|
|---|
| 64 | `SESSION_SECRET` is auto-generated on first start, so the defaults work as-is.
|
|---|
| 65 | Klonkt runs on port 3000 — put your own reverse proxy in front for HTTPS (see
|
|---|
| 66 | step 5 of Option C). Data (database + media) stays in the `klonkt-data` volume,
|
|---|
| 67 | even across updates. Update: `git pull && docker compose up -d --build`.
|
|---|
| 68 |
|
|---|
| 69 | ### Option C — manual (Node 20+), step by step
|
|---|
| 70 |
|
|---|
| 71 | **Good if:** you want full control, are adding Klonkt to a server you already
|
|---|
| 72 | manage, or just want to test it locally.
|
|---|
| 73 |
|
|---|
| 74 | **1. Get the code & install dependencies**
|
|---|
| 75 |
|
|---|
| 76 | ```bash
|
|---|
| 77 | git clone https://github.com/roboburr/klonkt.git
|
|---|
| 78 | cd klonkt
|
|---|
| 79 | npm ci
|
|---|
| 80 | ```
|
|---|
| 81 |
|
|---|
| 82 | **2. Create your config.** `SESSION_SECRET` (the key that signs login cookies) is
|
|---|
| 83 | auto-generated on first start, so this works as-is. For production, set
|
|---|
| 84 | `PUBLIC_BASE_URL` to your site address (e.g. `https://yourdomain.com`) so email &
|
|---|
| 85 | login links are correct:
|
|---|
| 86 |
|
|---|
| 87 | ```bash
|
|---|
| 88 | cp .env.example .env
|
|---|
| 89 | nano .env # optional: PUBLIC_BASE_URL, plus SMTP / Google if you want them
|
|---|
| 90 | ```
|
|---|
| 91 |
|
|---|
| 92 | **3. Start it** — the SQLite database is created automatically on first start:
|
|---|
| 93 |
|
|---|
| 94 | ```bash
|
|---|
| 95 | npm start # runs on http://localhost:3000
|
|---|
| 96 | ```
|
|---|
| 97 |
|
|---|
| 98 | Just testing locally? Stop here and open `http://localhost:3000`.
|
|---|
| 99 |
|
|---|
| 100 | **4. Keep it running** across crashes and reboots (easiest is pm2):
|
|---|
| 101 |
|
|---|
| 102 | ```bash
|
|---|
| 103 | npm install -g pm2
|
|---|
| 104 | pm2 start src/server.js --name klonkt
|
|---|
| 105 | pm2 save && pm2 startup # run the one command it prints, once
|
|---|
| 106 | ```
|
|---|
| 107 |
|
|---|
| 108 | **5. Add HTTPS** with a reverse proxy in front. With Caddy (automatic
|
|---|
| 109 | certificates), put this in `/etc/caddy/Caddyfile` and reload Caddy:
|
|---|
| 110 |
|
|---|
| 111 | ```caddy
|
|---|
| 112 | yourdomain.com {
|
|---|
| 113 | reverse_proxy localhost:3000
|
|---|
| 114 | }
|
|---|
| 115 | ```
|
|---|
| 116 |
|
|---|
| 117 | By default the app binds to `127.0.0.1` (via `HOST` in `.env`), so only your
|
|---|
| 118 | reverse proxy can reach it — not the open internet. Local testing on the same
|
|---|
| 119 | machine (`localhost:3000`) still works. Only set `HOST=0.0.0.0` if you need direct
|
|---|
| 120 | external access without a proxy (then open the port in your firewall and add HTTPS
|
|---|
| 121 | yourself).
|
|---|
| 122 |
|
|---|
| 123 | (`cwebp` is optional — `apt install webp` — for WebP image conversion.)
|
|---|
| 124 |
|
|---|
| 125 | ### HTTPS (Docker / bare Node)
|
|---|
| 126 |
|
|---|
| 127 | Put a reverse proxy in front of the app. With **Caddy** (automatic Let's Encrypt):
|
|---|
| 128 |
|
|---|
| 129 | ```caddy
|
|---|
| 130 | yourdomain.com {
|
|---|
| 131 | reverse_proxy localhost:3000
|
|---|
| 132 | encode gzip zstd
|
|---|
| 133 | }
|
|---|
| 134 | ```
|
|---|
| 135 |
|
|---|
| 136 | (The VPS installer sets up Caddy + HTTPS for you already.)
|
|---|
| 137 |
|
|---|
| 138 | ### First run
|
|---|
| 139 |
|
|---|
| 140 | Open your site → you get the **setup wizard**: pick your language, name your site
|
|---|
| 141 | and create your admin. The **first user automatically becomes the administrator**;
|
|---|
| 142 | registration then closes. Lost your password?
|
|---|
| 143 | `npm run reset-admin` (Docker: `docker compose exec klonkt npm run reset-admin`).
|
|---|
| 144 |
|
|---|
| 145 | ## Configuration (`.env`)
|
|---|
| 146 |
|
|---|
| 147 | | Variable | Required | What |
|
|---|
| 148 | |---|---|---|
|
|---|
| 149 | | `SESSION_SECRET` | ✅ | Random string of ≥32 characters |
|
|---|
| 150 | | `PUBLIC_BASE_URL` | ✅ | Canonical URL (e.g. `https://yourdomain.com`) |
|
|---|
| 151 | | `GOOGLE_CLIENT_ID` / `_SECRET` / `_REDIRECT_URI` | — | Google login for listeners (your own OAuth client; never grants admin) |
|
|---|
| 152 | | `SMTP_HOST` / `_PORT` / `_USER` / `_PASS` / `_FROM` | — | Email for password reset + newsletter |
|
|---|
| 153 | | `KLONKT_DEFAULT_LANG` | — | Default language for visitors (`en`/`nl`/`de`) |
|
|---|
| 154 | | `KLONKT_AUDIO` | — | `off` = lite mode (no audio/ffmpeg) |
|
|---|
| 155 |
|
|---|
| 156 | ## Stack
|
|---|
| 157 |
|
|---|
| 158 | - **Runtime:** Node 20+
|
|---|
| 159 | - **Web:** Express + Helmet + express-session
|
|---|
| 160 | - **DB:** better-sqlite3 (WAL), self-migrating on boot
|
|---|
| 161 | - **Templates:** EJS (server-rendered) + **htmx 1.9** (vendored, no build step)
|
|---|
| 162 | - **Audio:** ffmpeg-static (bundled)
|
|---|
| 163 | - **Circles:** Ed25519-signed pull (libsodium via Node crypto)
|
|---|
| 164 | - **Fonts:** self-hosted variable woff2 (Fraunces / Plus Jakarta Sans)
|
|---|
| 165 |
|
|---|
| 166 | ## Project structure
|
|---|
| 167 |
|
|---|
| 168 | ```
|
|---|
| 169 | src/
|
|---|
| 170 | ├── server.js # Express bootstrap + route mounting
|
|---|
| 171 | ├── config/ # database, mailer, google, feature flags
|
|---|
| 172 | ├── db/migrations/ # SQLite schema (001-init.sql)
|
|---|
| 173 | ├── middleware/ # site resolving, auth, render (htmx-aware)
|
|---|
| 174 | ├── routes/ # per-resource Express routers (posts, auth, admin-*, circle, …)
|
|---|
| 175 | ├── services/ # domain logic (federation, stats, mailer, permissions, …)
|
|---|
| 176 | ├── views/ # shell.ejs + partials/ + pages/ (EJS)
|
|---|
| 177 | └── assets/ # css/ (palette tokens + components), js/ (htmx, player), fonts/
|
|---|
| 178 | ```
|
|---|
| 179 |
|
|---|
| 180 | ## License
|
|---|
| 181 |
|
|---|
| 182 | **AGPL-3.0-or-later** — see [LICENSE](LICENSE). Klonkt is free software: you may
|
|---|
| 183 | use, study, modify and distribute it. The AGPL does require that a modified
|
|---|
| 184 | version you offer as a network service makes its source code available to the
|
|---|
| 185 | users of that service. Made by robo.burr (Robin Genis) ·
|
|---|
| 186 | <https://klonkt.com>
|
|---|