I like buying domains.
Short ones, slightly unusual ccTLDs — if I see one, I tend to register it first and think of a use for it later. Then the renewal notice arrives the following year, and I think about a use for it again. I try not to think about the annual cost of all this. It's better for my mental health.
One natural use for a spare domain is a URL shortener. Bitly and TinyURL exist, of course, but the moment you want your own domain, real analytics, or several domains at once, you're looking at a subscription. Paying monthly to make URLs shorter never sat right with me.
There are good self-hosted options — Shlink, YOURLS, and Sink (which also runs on Cloudflare) among them. I just wanted the feature set I had in mind, running on the platform I already use for everything: Cloudflare.
So I built Linkrovia. MIT licensed, deploys into your own Cloudflare account, and starts on the free Workers plan.
Your links. Your rules.
What it does
It started as "register a URL, get a short link, redirect." Then the feature list grew the way personal projects do: analytics, multiple domains, per-device redirects, QR codes, link health checks, an API, MCP support... It's now closer to a link management platform:
- Branded short links across multiple domains, custom slugs, QR codes
- Redirect rules by device, OS, country, and language — with a simulator
- Click analytics with breakdowns, CSV export, and conversion goals
- Scheduled, expiring, password-protected, and one-time links
- UTM templates, link health monitoring (Guardian), weekly insights
- Passkey sign-in, scoped API keys, REST API (OpenAPI 3.1), and an MCP server
- Dashboard in 10 languages, config backup/restore
There's a public demo with sample data if you want to click around before deploying anything. (It's a shared environment — don't put anything private in it.)
Smart redirects, with a simulator
My favourite feature. One short link, different destinations per visitor:
| Condition | Destination |
|---|---|
| iOS | App Store |
| Android | Google Play |
| Everything else | Your website |
Same for country or browser language. The part I care about is the simulator: once you stack a few rules, "where does this visitor actually end up?" becomes a real question, and testing with actual devices and VPNs gets old fast. The dashboard lets you simulate a visit and see which rule fires before you share the link.
Architecture: Workers + D1 + Analytics Engine
The stack is SvelteKit + TypeScript on Cloudflare Workers, and the interesting decision is where the data lives:
| Data | Store |
|---|---|
| Link config, domains, rules, admins, API keys | D1 |
| Click events | Workers Analytics Engine |
| Long-term aggregates | D1 (rolled up by Cron Triggers) |
Link configuration and click events have opposite shapes: config changes rarely, events arrive on every click. Putting both in one database works until it doesn't. Analytics Engine is built for write-heavy event data and queryable via SQL, but it has retention and sampling characteristics you need to respect — so a Cron Trigger periodically rolls aggregates into D1 for the long term.
A URL shortener is also just a great fit for Workers in general. The request path is tiny (look up config, evaluate rules, record event, return redirect), there's no always-on server, and redirects get served from Cloudflare's network, close to whoever clicked. The honest caveat: "edge" doesn't magically make every database read local, so caching and data placement still need thought.
Optional AI features (link suggestions, analytics explanations, weekly reports) run on Workers AI and are off unless you enable them. A URL shortener whose AI bill exceeds its hosting bill would be a special kind of failure.
Passkeys for the admin
The admin signs in with a passkey, registered during first setup. For a self-hosted app whose admin panel sits on the public internet, this matters more than it might seem: if someone takes over a shortener, they don't just read your data — they can rewrite where your existing links point. Phishing-resistant auth with no password to manage is the right default. (I use a YubiKey daily; I'd like this to be normal.)
An MCP server, because agents are users too
Linkrovia ships an MCP server. Each instance exposes a Streamable HTTP endpoint on its own management hostname (/mcp), authenticated with a scoped API key — the same key system as the REST API, with scopes like links:read, analytics:read, and links:write.
That means an AI client like Claude Code or Codex can work with your links:
- "Shorten this URL and make me a link for sharing on social media"
- "Find the links I registered for project X"
- "How did this link perform last week?"
The detail I care about: you can hand an agent a read-only key. It can look up links and read analytics, and it physically cannot change a destination. As more of our tools get agent interfaces, scoped, revocable credentials feel like the difference between a feature and a liability. My view is that web apps now need two interfaces — one for humans, one for agents — and the agent one deserves the same design attention.
What it costs to run
For personal-scale use, the free plan is genuinely enough:
| Service | Free allowance |
|---|---|
| Workers | 100,000 requests/day |
| D1 reads | 5 million rows/day |
| D1 writes | 100,000 rows/day |
| D1 storage | 5 GB per account |
Workers Paid starts at $5/month if you outgrow it. One honest caveat from my own docs: password-protected links are where the free plan's CPU limit can bite, so heavy use of those is a reason to consider Paid.
Deployment is a "Deploy to Cloudflare" button: connect GitHub, set a setup token, deploy, register your passkey, connect your domains. No Docker host, no reverse proxy, no certificate wrangling. That absence of chores is the whole point of building Cloudflare-native.
The tradeoff: lock-in, on purpose
Linkrovia is designed around Workers, D1, and Analytics Engine. It will not run on your VPS or home server, and Cloudflare's pricing or platform changes will affect it. CSV import/export and config backup soften that, but they don't remove it.
That's a deliberate choice: not "runs anywhere," but "runs effortlessly on Cloudflare." Supporting every environment costs development and maintenance time a personal project doesn't have. If you want a shortener you can host on any box, Shlink is excellent. If you already live on Cloudflare, this removes nearly all the operational surface.
Try it
- Site: https://linkrovia.com
- Demo: https://demo.linkrovia.com
- GitHub: https://github.com/enjoydarts/linkrovia
Bug reports, feature ideas, and PRs are welcome. And if you like it, a star genuinely helps — for a solo maintainer it's fuel.
Cloudflare has brought my infrastructure costs down nicely. My domain costs, meanwhile, keep going up. The universe has a sense of balance.
Your links. Your rules.