YES

Replaceable in one session with an AI coding agent.

Short links on your own domain with click analytics, QR codes and a team dashboard. It is the modern take on the category: open source, with the hosted plan being the convenience rather than the software.

Promptfree, for everyone, and the only version there is
Build me branded short links that replace Dub — and note that it is open source, so self-hosting it is a real answer rather than a rewrite. Build this when you want the redirect table to be yours and the shape to be small.

STACK
- Node 20+ with Fastify
- SQLite through better-sqlite3, WAL mode
- Caddy in front, with on-demand TLS for custom domains

THE DATA MODEL
- domains: id, hostname, workspace_id, is_verified, certificate_state, default_redirect
- links: id, domain_id, slug, destination, title, tags_json, utm_json, expires_at, max_clicks, password_hash, is_active, created_by, created_at, archived_at
- link_versions: id, link_id, destination, changed_by, at — appended, never overwritten, because a link on a printed page must stay accountable
- clicks: id, link_id, at, referrer_host, referrer_url, country, device, browser, os, lang, ip_hash, bot, is_preview
- rules: id, link_id, kind, match_json, destination, position — geographic, device or language routing
- workspaces, members, api_keys

THE REDIRECT, WHICH IS THE WHOLE PRODUCT
- 302, never 301. A permanent redirect cached in a browser can never be re-pointed, and re-pointing is the entire reason for a short link
- Answer in a couple of milliseconds: one indexed lookup from an in-memory map, respond, then record the click after the response has been sent
- An expired, disabled or exhausted link lands on a page saying what it was and where to go instead. Never a bare 404 — the poster is still on the wall
- Validate the destination's scheme on save. Never redirect to a `javascript:` or `data:` target

THE DOMAIN, WHICH IS WHAT IS ACTUALLY BEING BOUGHT
- Add a hostname, verify by a DNS record, and let Caddy's on-demand TLS issue a certificate
- The ask endpoint must check the hostname against the domains table before a certificate is requested. Without that check anybody pointing a domain at your server makes you request certificates on their behalf, and you hit the issuer's rate limits within the hour
- A default redirect for the bare domain, so somebody typing just the hostname lands somewhere sensible

COUNTING HONESTLY
- Bots flagged, never dropped, and excluded from published figures through a SQL view. Chat and social platforms fetch every link that is posted, and counting those makes a launch look like a success
- A preview fetch is identifiable from the user agent and from the timing — the same address within a second of posting, once
- Unique clicks by a salted hash of address and user agent within a window, with the definition written next to the number
- By day, referrer, country and device, computed at query time

SAFETY
- Destinations checked against a malware list on save if one is configured, and reported links queued for review. An open short-link service is a phishing tool and yours will be found within weeks
- Rate limits on creation per key and per member

OPERATIONS
- .env: DATABASE_PATH, BASE_URL, HASH_SALT, SESSION_SECRET, GEOIP_DB_PATH
- Migrations on boot, each once; country from a local database file, never an external API
- Nightly backup off the machine — a lost link table breaks every link anybody has ever shared
- Health endpoint that resolves one link

WHAT MATTERS MOST
Redirect speed, the 302, and the on-demand TLS check. Load-test the redirect, then try to add a domain you do not own and confirm the certificate is refused.

What you lose

  • A hosted control plane, so the thing serving your links is not a box you maintain
  • Certificates issued and renewed for every custom domain without you touching DNS twice
  • An edge network, so a redirect is fast from anywhere rather than from one region
  • Team roles, so marketing can create links without touching your infrastructure

If you would rather not build

  • YOURLS — the long-standing PHP shortener still running on shared hosting everywhere
  • A Caddy on-demand TLS block plus forty lines of Node, which is the whole thing

The escape hatch

open source · no votes, no paid placement

Dub

$0

The product itself, open source and self-hostable.

dubinc/dubfree · open source

Shlink

$0

A mature self-hosted shortener with an API, QR codes and visit tracking.

shlinkio/shlinkfree · open source

Why this verdict

our own opinion · changed only by a person

84/100

Verdict yes at 84: a redirect table, a counter and a certificate hook. The migration is harder than the build — every link already handed out has to keep working — and the entry says so.

History

tracked since 14 Aug 2026 · nothing is ever overwritten

Interest · last 30 days

Nothing recorded yet. This chart fills in once the page has visitors, votes or prompt copies — it will not draw a flat line to look busy.

Questions about Dub

answered from the record above

Is Dub free?

No — the plan we track is $24 a month. Pro at $24/month billed monthly, $19 annually, for a fixed number of links and tracked clicks; the software is open source and free to self-host.

Can you replace Dub by building your own?

YES. Replaceable in one session with an AI coding agent. Replacement score 84 out of 100, build time one session. Read what you lose before you decide.

How much does Dub cost?

$24 a month on Pro — $288 a year. Recorded 14 Aug 2026.

What do you lose by replacing Dub?

A hosted control plane, so the thing serving your links is not a box you maintain; Certificates issued and renewed for every custom domain without you touching DNS twice; An edge network, so a redirect is fast from anywhere rather than from one region; Team roles, so marketing can create links without touching your infrastructure. If any of those carry weight for you, keep paying.

Is there an open-source alternative to Dub?

Yes: Dub, Shlink. The prompt on this page is for when you want it your way instead.

Related entries

same category first, most replaced first

All 17 in Social media & links

Not sending yet

Every week, something stops being worth paying for.

New verdicts, prices that moved, entries added. One email a week. Unsubscribe in one click. Nothing is being sent yet — your address is kept here, and the first issue is the first thing it is used for.

free forever · no tracking pixel · stored here, never passed to anyone

Esc