SelfHost Hub SelfHost Hub
EN
← 返回到所有服务

GitHub 仓库信息

获取时间 · 2026年6月5日
★ 23,645 最后更新: 2026年6月5日
README
<a href="https://dub.co">
  <img alt="Dub is the modern, open-source link attribution platform for short links, conversion tracking, and affiliate programs." src="https://github.com/user-attachments/assets/42cf0705-f5a2-4200-bc4a-c5acf0ba9e15">
</a>

<h3 align="center">Dub</h3>

<p align="center">
    The open-source link attribution platform.
    <br />
    <a href="https://dub.co"><strong>Learn more »</strong></a>
    <br />
    <br />
    <a href="#introduction"><strong>Introduction</strong></a> ·
    <a href="#tech-stack"><strong>Tech Stack</strong></a> ·
    <a href="#self-hosting"><strong>Self-hosting</strong></a> ·
    <a href="#contributing"><strong>Contributing</strong></a>
</p>

<p align="center">
  <a href="https://twitter.com/dubdotco">
    <img src="https://img.shields.io/twitter/follow/dubdotco?style=flat&label=%40dubdotco&logo=twitter&color=0bf&logoColor=fff" alt="Twitter" />
  </a>
  <a href="https://news.ycombinator.com/item?id=32939407"><img src="https://img.shields.io/badge/Hacker%20News-255-%23FF6600" alt="Hacker News"></a>
  <a href="https://github.com/dubinc/dub/blob/main/LICENSE.md">
    <img src="https://img.shields.io/github/license/dubinc/dub?label=license&logo=github&color=f80&logoColor=fff" alt="License" />
  </a>
</p>

<br/>

## Introduction

Dub is the modern, open-source link attribution platform for [short links](https://dub.co/home), [conversion tracking](https://dub.co/analytics), and [affiliate programs](https://dub.co/partners).

Our platform powers 100M+ clicks and 2M+ links monthly, and is used by world-class marketing teams from companies like Twilio, Buffer, Framer, Perplexity, Vercel, Laravel, and [more](https://dub.co/customers).

## Tech Stack

- [Next.js](https://nextjs.org/) – framework
- [TypeScript](https://www.typescriptlang.org/) – language
- [Tailwind](https://tailwindcss.com/) – CSS
- [Prisma](https://www.prisma.io/) – ORM
- [Upstash](https://upstash.com/) – redis
- [Tinybird](https://tinybird.com/) – analytics
- [PlanetScale](https://planetscale.com/) – database
- [NextAuth.js](https://next-auth.js.org/) – auth
- [BoxyHQ](https://boxyhq.com/enterprise-sso) – SSO/SAML
- [Turborepo](https://turbo.build/repo) – monorepo
- [Stripe](https://stripe.com/) – payments
- [Resend](https://resend.com/) – emails
- [Vercel](https://vercel.com/) – deployments

## Self-Hosting

You can self-host Dub for greater control over your data and design. [Read this guide](https://dub.co/docs/self-hosting/guide) to learn more.

## Contributing

We love our contributors! Here's how you can contribute:

- [Open an issue](https://github.com/dubinc/dub/issues) if you believe you've encountered a bug.
- Follow the [local development guide](https://dub.co/docs/local-development) to get your local dev environment set up.
- Make a [pull request](https://github.com/dubinc/dub/pull) to add new features/make quality-of-life improvements/fix bugs.

### Recommended Versions

| Package | Version  |
| ------- | -------- |
| node    | v23.11.0 |
| pnpm    | 9.15.9   |

### Common Local Development Issues

- `The table <table-name> does not exist in the current database.` - Run `pnpm prisma:push` push the state of the Prisma schema file to the database without using migrations files.
- The project is not building correctly locally - verify your versions of `node` and `pnpm` match the recommended versions above. Delete all `node_modules`, `.next`, and `.turbo` directories in the `apps` and `packages` directory. You may now reinstall `node_modules` by running `pnpm install` and attempt to rebuild the project with `pnpm build`.

### Dev Seed Script

This script seeds the database with development data for testing and development purposes.

**Basic seeding (adds data without deleting existing data):**

```bash
cd apps/web
pnpm run script dev/seed
```

**Truncate database before seeding (deletes all existing data first):**

```bash
cd apps/web
pnpm run script dev/seed --truncate
```

When using `--truncate`, the script will ask for confirmation before deleting any data.

## Repo Activity

![Dub repo activity – generated by Axiom](https://repobeats.axiom.co/api/embed/6ac4c94a89ea20e2e10032b932a128b6d8442e66.svg "Repobeats analytics image")

## License

Dub Technologies, Inc. is a commercial open-source company, which means some parts of this open-source repository require a commercial license. The concept is called "Open Core" where the core technology (99%) is fully open source, licensed under [AGPLv3](https://opensource.org/license/agpl-v3) and the last 1% is covered under a commercial license (["/ee" Enterprise Edition](<https://github.com/dubinc/dub/tree/ee/apps/web/app/(ee)>)) which we believe is entirely relevant for larger organisations that require enterprise features. Enterprise features are built by the core engineering team of Dub Technologies, Inc., which is hired full-time.

Dub 是一个开源、注重隐私的短链接平台,支持品牌化域名、团队协作、A/B 测试和转化追踪,可替代 Bitly、Rebrandly 等商业服务。

核心功能

  • 自定义域名:绑定多个自有域名,支持路径与参数管理,提升品牌一致性。
  • 团队协作:可创建工作区并分配成员角色,集中管理营销链接与活动。
  • 转化追踪:内置实时统计面板,提供点击趋势、来源渠道、地理位置等数据。
  • A/B 测试:为同一链接配置多个目标地址,按权重分发以验证转化效果。
  • API 与集成:提供 REST API、Webhook,与 Zapier、Slack 等工具集成自动化流程。

部署建议

  1. 官方提供 Docker Compose 模板,依赖 PostgreSQL、Redis 与 Next.js 前端,可快速启动。
  2. .env 文件中配置数据库、缓存、JWT 密钥以及第三方登录与存储服务。
  3. 如需启用地理定位统计,可配置 MaxMind GeoLite2 数据库或第三方 IP API。
  4. 将静态资源与日志存储在持久化卷中,并通过反向代理启用 HTTPS,确保链接安全可用。

发现更多