Dub

Open-source link management platform

URL Shorteners ★ 24.8k stars Hard setup AGPL-3.0

Dub is a modern, open-source link management platform for creating branded short links with advanced analytics, QR codes, and team collaboration. It can be self-hosted with Docker.

Key features

  • Branded short links
  • Advanced click analytics
  • QR code generation
  • Team workspaces

Pros & cons

Strengths

  • Polished modern UI
  • Powerful analytics

Trade-offs

  • Complex self-hosting setup

Dub replaces

Last reviewed Aug 26, 2026 · 845 words

Dub is the best-looking link shortener you can self-host and the one I would least often recommend self-hosting. It is a 24,570-star, AGPL-3.0 TypeScript codebase that is genuinely open, but it was built as a SaaS first, and running your own copy means rebuilding the SaaS: a Postgres database, Redis, an analytics backend, an email sender, and an OAuth login provider before you have shortened a single link. The catalogue rates it Hard and asks for 1 GB of RAM, and both are fair. If what you want is go.example.com/launch with a click count, a simpler tool gets you there in 10 minutes; if what you want is Bitly for a marketing team, with workspaces, branded domains, QR codes, and per-link analytics you would happily show a client, Dub is the only open-source option in that league.

What "open source" means here

Dub's application is a Next.js app, and the code you clone is the same code that runs dub.co. That is unusual and good: features land in the open repo, the API is documented, and the AGPL means a hosted fork has to publish its changes. The catch is that a SaaS architecture assumes managed services around it. At last check the self-hosting guide walks you through creating accounts for the analytics pipeline (Tinybird), a hosted Redis, an email provider for magic-link logins, and a Google OAuth app, plus a database and somewhere to run the Next.js server. Each step is documented and none is hard, but you end up with a self-hosted front end whose click data lives in a third-party service, which undercuts the reason many people self-host at all. Nothing stops you swapping those out, but you are then maintaining a fork.

The analytics are the product

Every shortener counts clicks. Dub records referrer, country, city, device, browser, OS, and time for each one, filters by any combination, breaks down by UTM parameter, and does it on a dashboard that loads instantly because the heavy lifting is in a column store rather than a row-per-click table. It also supports conversion tracking, so a link can be tied to a sign-up or a sale further down the funnel. For a one-person homelab that is overkill. For anyone who currently pays Bitly for exactly these charts, it is the point, and the Bitly alternatives page is written for that user.

Branded domains, QR codes, and workspaces

Add a domain, point its DNS at your Dub instance, and every link on it gets your brand in the URL, a QR code with your logo in the middle, and optional link expiry, password protection, device targeting, and geo-targeting. Workspaces separate teams or clients, with roles and per-workspace API keys. If you run an agency and want one instance with a workspace per client, this is the feature set that no lighter shortener has, and it is why Dub competes with Rebrandly rather than with YOURLS.

Where the lighter tools win

Shlink is a PHP shortener with a REST API, a separate web client, per-link visit stats with country and referrer, and a Docker image that needs a database and nothing else; it idles in about 100 MB. Kutt is a Node app with a pleasant UI, custom domains, and password-protected links, and it is the one I hand to people who want "Dub, but I can set it up in an evening". YOURLS is the veteran PHP option that will run on shared hosting. All three keep click data on your own disk. The URL shorteners category lists the rest.

NeedPick
Personal short links, click counts, done tonightShlink or Kutt
Marketing-grade analytics, QR, workspacesDub
Runs on a 5 USD PHP hostYOURLS

The resource and maintenance bill

Budget 1 GB of RAM for the Next.js server and the database on the same box, more if you build the app there rather than pulling a prebuilt image. Dub ships changes constantly, which is a good sign for the product and a chore for a self-hoster: merging upstream into a lightly customised deployment every few weeks is real work. The hosted free tier covers modest personal use, and I would not be embarrassed to tell someone to use it while keeping the self-host option as their exit.

What I'd do

If I wanted branded links with a click counter for myself, I would run Shlink behind Caddy and be finished before dinner. If I ran links for clients or a marketing team and had a cloud account to pay for the analytics backend anyway, I would self-host Dub, put it on a 2 GB VPS, and accept the third-party dependencies as the cost of the best dashboard in the category. What I would not do is self-host Dub on principle: the data-sovereignty argument favours the simpler tools.

Compare Dub

11 head-to-head comparisons.

Similar url shorteners apps