Cloudshort

Overview

Cloudshort is a private URL shortener that runs on your own Cloudflare account.

Latest version
v0.2.1
Platforms
Cloudflare Workers, Cloudflare Pages
License
MIT

Cloudshort turns long links into short ones, like s.example.com/launch, and counts who clicks them. It runs on your own Cloudflare account, so your links and click data stay with you.

The two parts

PartWhat it doesWhere it runs
RedirectorSends visitors from a short link to its destinationA Cloudflare Worker on your short domain
DashboardLets you create, edit, and delete links, and see clicksCloudflare Pages on your admin domain, behind a password

Both parts share one KV namespace (for fast lookups) and one D1 database (the full list of links and every click).

What happens on a click

  1. A visitor opens s.example.com/launch.
  2. The redirector looks up launch in KV and sends the visitor to the destination with a 302 redirect.
  3. After the redirect is sent, the click is saved in D1: the time, the country, the referring site, and the browser. This never slows down the redirect.

If the link does not exist, the visitor sees a plain "Link not found" page, or goes to a page you choose in Settings.

What you need

  • A Cloudflare account. The free plan is enough for personal and small team use. See Cloudflare Workers pricing for the limits.
  • A domain on Cloudflare, if you want links on your own domain.
  • A computer with Node.js 22 or newer and pnpm, to run the setup once.

Next steps