Favicon of Dub

Dub

Dub is an open-source link attribution platform for short links, conversion tracking, and affiliate programs.

Open Source Alternative to:
Dub website screenshot
Dub GitHub repository preview

Dub is an open-source link attribution platform for short links, conversion tracking, and affiliate programs, built as an open-source alternative to Bitly. The project reports it powers over 100 million clicks and 2 million links every month, with customers including Twilio, Buffer, Framer, Perplexity, and Vercel. Dub can be used as a hosted service or self-hosted on your own infrastructure.

Key features

  • Short links: Create and manage branded short links with click tracking built in.
  • Conversion tracking: Attribute downstream conversions back to the links that generated them.
  • Affiliate programs: Run partner and affiliate programs on top of the same link infrastructure.
  • Real-time analytics: Click analytics are powered by Tinybird, giving low-latency reporting at scale.
  • Enterprise SSO: SAML-based single sign-on is available through a BoxyHQ integration for enterprise customers.
  • Self-hosting: Run Dub on your own infrastructure for full control over data and design.

Tech stack

Dub is built with Next.js, TypeScript, and Tailwind CSS on the frontend, Prisma as the ORM, PlanetScale for the database, Upstash for Redis, and Tinybird for analytics. Auth runs through NextAuth.js, payments through Stripe, transactional email through Resend, and the project deploys on Vercel with Turborepo managing the monorepo.

Self-hosting and deployment

Dub follows an open-core model. The core platform, about 99% of the codebase, is licensed under AGPLv3 and is fully open source, while a smaller Enterprise Edition under the /ee directory is covered by a separate commercial license for features aimed at larger organizations. A self-hosting guide covers the setup steps for running Dub on your own servers.

Development and contributing

Local development uses pnpm on Node v23.11.0 and pnpm 9.15.9, with a dev seed script (pnpm run script dev/seed) that populates the database with test data, and a --truncate flag to wipe existing data first. Contributors follow a local development guide, open GitHub issues for bugs, and submit pull requests for new features or fixes. Recommended version pinning matters here: mismatched Node or pnpm versions are the most common cause of local build failures, and the project's troubleshooting notes point to clearing node_modules, .next, and .turbo directories before reinstalling.

Who uses it

Dub states its infrastructure handles more than 100 million clicks and 2 million links every month, with customers including Twilio, Buffer, Framer, Perplexity, Vercel, and Laravel listed on its customers page. For teams already comfortable running a Next.js and PlanetScale stack, self-hosting Dub means owning that same infrastructure directly rather than depending on a third-party link shortener.

Frequently asked questions

Share:

Stars
24.2K
Forks
3.2K
Last commit
16 hours ago
Repository age
4 years
Self-hosted
Yes
Activity score
83/100
View Repository
Ad
Favicon

 

  
 

Similar to Dub

Favicon

 

  
 
Favicon

 

  
 
Favicon