Skip to main content

How to Migrate from Bitly to Dub

·OSSAlt Team
bitlydubmigrationurl shortenerguide

How to Migrate from Bitly to Dub

Bitly's free plan limits you to 10 links/month. Paid plans start at $8/month. Dub is the open source alternative — unlimited links, analytics, custom domains, team workspaces, and QR codes. Here's how to switch.

Step 1: Set Up Dub

Option A: Dub.co Cloud

  1. Sign up at dub.co
  2. Create a workspace

Option B: Self-hosted

git clone https://github.com/dubinc/dub.git
cd dub
cp .env.example .env
# Configure DATABASE_URL, NEXTAUTH_SECRET, etc.
pnpm install
pnpm dev

Step 2: Export from Bitly

  1. Bitly → SettingsAdvancedData Export
  2. Or use the Bitly API:
curl -H "Authorization: Bearer YOUR_BITLY_TOKEN" \
  "https://api-ssl.bitly.com/v4/groups/YOUR_GROUP/bitlinks?size=100" \
  > bitly-export.json

Use Dub's API to create links:

const links = require('./bitly-export.json');

for (const link of links) {
  await fetch('https://api.dub.co/links', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_DUB_TOKEN',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      url: link.long_url,
      key: link.custom_bitlinks?.[0]?.split('/').pop() || undefined,
      domain: 'yourdomain.com',
    }),
  });
}

Step 4: Set Up Custom Domain

  1. Dub → SettingsDomainsAdd Domain
  2. Add DNS records (CNAME to Dub's servers)
  3. Existing short URLs use your custom domain

If you have Bitly links embedded in emails, social posts, or documents:

  • Option A: Keep Bitly active as redirect (Bitly links still work)
  • Option B: Set up 301 redirects from old Bitly custom domain
  • Option C: Update links to new Dub URLs over time

Cost Comparison

FeatureBitlyDub.coDub Self-Hosted
Links/month10 (free)25 (free)Unlimited
Basic plan$8/month$24/monthFree
AnalyticsBasicDetailedDetailed
Custom domainsPaid
QR codesPaid

Compare link management tools on OSSAlt — analytics, custom domains, and pricing side by side.