Build Linktree Pro
YESreplaces $15/mosaves $180/yrback to the verdict
A link-in-bio page on your own domain: your links live in one JSON file, every button routes through a redirect that counts the click without a third party, and a private stats page shows what people actually press. Fast, dark-mode aware, and yours.
Before step 1
Everything below is assumed from the first step. Tick each one when you actually have it, not when you plan to.
- installfree
Why Everything in this build runs on it: the server, the scripts, the tests.
Get it Download the LTS installer from nodejs.org, or install with your package manager (brew install node, or nvm install 22). Restart the terminal afterwards. open ↗
Verify
node --version prints v22 or higher - installfree
Why Every step below is a command you type or a file you edit.
Get it VS Code (code.visualstudio.com), Cursor or Zed. Open a folder for the project and use the editor's built-in terminal. open ↗
Verify
You can open a folder and run a command in its terminal - installfree
Why History for your code, and the way most hosts deploy.
Get it Install from git-scm.com or with your package manager, then run git init in the project folder once it exists. open ↗
Verify
git --version prints a version - have readyfree
Why The page renders links.json exactly. Decide the order and titles first so Phase 1 is about rendering, not editing.
Get it A list of up to ten links with a short title each, a one-line bio, and a square avatar image (at least 400x400).
- decidefree
Why Click rows store a daily-salted hash, never the raw address.
Get it openssl rand -hex 32 into .env as IP_SALT.
- accountroughly $10 a year, or free on an existing domain
Why The entire upgrade over Linktree is that the page lives on your domain.
Get it Register at Cloudflare Registrar, Porkbun or Namecheap, or use a subdomain of one you already own. You add one DNS record in the deploy phase. open ↗
- accountabout $5 a month
Why This needs one process running all the time with a public address.
Get it Hetzner Cloud (from about 4 EUR), DigitalOcean or Fly.io. Ubuntu 24.04, the smallest size. You need SSH access and a public IP. Only needed for the deploy phase; develop locally first. open ↗
- installfree
Why Automatic HTTPS in front of the Node process. Without TLS the browser features this relies on (and your visitors' trust) do not work.
Get it On the VPS: follow the install steps at caddyserver.com/docs/install for Ubuntu. One Caddyfile with your domain and a reverse_proxy line is the whole config. open ↗
Verify
caddy version prints a version on the server
Data model
Create these before the first phase that stores anything. Changing a table later is the expensive kind of change.
`links.json` is the CMS:
- `profile`: { name, bio, avatar, accent }
- `links`: array of { slug, title, url, emoji (optional), enabled (bool) }
- `slug` is the stable click-tracking key. Changing a title must never change a
slug, or the stats history silently resets.
`clicks` table: id, slug, clicked_at, referer, user_agent_class, ip_hash.
Classify the user agent into a coarse bucket (mobile/desktop/bot) at write time
and store the bucket, not the string. Hash the IP with a rotating daily salt.Environment variables
These go in a .env file the app reads at startup. The pack's .env.example is this table as a file · copy it, never commit the filled-in version.
| Variable | Needed | Example | Where the value comes from |
|---|---|---|---|
PORT | required | 3000 | Any free port; Caddy proxies to it. |
DATABASE_PATH | required | ./data/clicks.db | SQLite file for click rows. |
SITE_URL | required | https://links.yourname.com | Public base URL for OG tags. |
IP_SALTsecret | required | hex-from-openssl-rand | openssl rand -hex 32, once. |
ADMIN_USER | required | admin | Any username for the basic-auth admin pages. |
ADMIN_PASSsecret | required | change-me-to-a-long-random-string | Generate one: openssl rand -base64 24. Never reuse a real password. |
The build, in order
The page
Render the profile and links from links.json, mobile-first, working with JavaScript disabled, and refuse to boot on a broken file.
profile (name, bio, avatar, accent) and links: array of {slug, title, url, emoji, enabled}. The slug is the permanent click-tracking key; changing a title must never change a slug.
Files
links.jsonserver.mjsterminalmkdir links && cd links && git init && npm init -y && npm pkg set type=module mkdir data public && cp .env.example .env
Every url starts with http, every slug is unique and lowercase, avatar exists in public/. On failure exit with the bad entry named. A broken page is worse than a refused start.
Avatar, name, bio, then enabled links as a vertical stack of buttons. Disabled links do not render at all.
done when · tick each as it passesDesign
Comfortable, accessible, no external requests.
System font stack; buttons at least 44px tall with generous horizontal padding.
prefers-color-scheme with the same custom properties overridden. Check contrast in both schemes.
Keyboard visitors must see where they are.
done when · tick each as it passeswatch out- No web fonts from a CDN. A fonts request is a third-party call and a performance deduction.
Click tracking
Every button goes through /go/:slug, which records a row and redirects, and the redirect never waits on the database.
clicks (id, slug, clicked_at, referer_host, user_agent_class, ip_hash). Classify the user agent into mobile, desktop or bot at write time and store the bucket, not the string.
Look up the slug in links.json, send the 302 first, then insert the row. Unknown slugs redirect to / rather than erroring.
sha256(IP_SALT + today's date + ip). The same visitor is one hash today and a different one tomorrow.
done when · tick each as it passeswatch out- Send the redirect before writing. A click must never wait on the database.
Bot filtering and stats
A private stats page whose numbers you can explain.
A short list (bot, crawler, spider, preview, slackbot, twitterbot, facebookexternalhit). Count them separately rather than deleting them.
Clicks per link over today, 7 and 30 days excluding bots, a clicks-per-day bar chart as inline SVG, top referrers, and the bot count shown separately.
done when · tick each as it passesShare cards and deploy
Previews correctly when shared, live on your domain, documented.
satori and @resvg/resvg-js at startup or build time, rendering your name on your accent.
terminalnpm install satori@0.29.0 @resvg/resvg-js@2.6.2
Files
deploy/links.serviceCaddyfileterminalsqlite3 data/clicks.db ".backup '/tmp/clicks-$(date +%F).db'"
README: the links.json reference, the warning that slugs are permanent, how to add a link without breaking stats, and a note that owning the domain is the actual upgrade.
Files
README.md
done when · tick each as it passesOperate it like a productproduct builder
Only for the product-builder path: know when the redirect is down, never lose the database, and keep the server patched.
Answer 200 with the build id and a quick database read. Point a free uptime monitor (or your own, from the Healthchecks entry on this site) at it so an outage is noticed before a user notices.
One JSON line per request: method, path, status, duration, no raw IPs. Rotate weekly with logrotate, keep eight.
SQLite's .backup command makes a consistent copy while the app runs. Copy it to object storage or a second machine; then, once, restore it into a fresh checkout and confirm the app reads it.
terminalsqlite3 data/app.db ".backup '/tmp/app-$(date +%F).db'" rclone copy /tmp/app-$(date +%F).db remote:backups/
Firewall allowing only 22, 80 and 443; unattended security updates on; the app running as an unprivileged user under systemd with Restart=on-failure.
done when · tick each as it passes
That is the whole plan for Linktree Pro. What it deliberately does not cover is below · check the gaps before you call it a replacement.
- The drag-and-drop editor. Editing links.json is the trade for owning it.
- Their analytics beyond clicks per link. At this scale the only question is which link people press.
- Payments, link scheduling, and the integrations you were not using.
- the drag-and-drop editor
- their analytics dashboard
- hosted-for-you convenience
- integrations you probably weren't using
- A tiny basic-auth editor that writes links.json and commits it
- Per-link QR codes for print
Need the files? The project pack on the verdict page hands your agent the whole brief · more link in bio.