URL shorteners are handy tools for condensing long URLs into more manageable links, but relying on third-party services can raise privacy and reliability concerns.

Fortunately, several open-source URL shorteners allow you to host and manage your own links.

This post explores some of the options available:

Star History Chart

And how to SelfHost these URL Shorteners with containers.

Why Use an Open-Source URL Shortener?

  • Privacy: You control your data and avoid tracking by third-party services.
  • Customization: You can often customize the short URLs and branding.
  • Reliability: Your links are independent of external services.
  • Control: You have complete control over your link management.

Open-Source URL Shortener Options

Here are some popular open-source URL shorteners:

  • Shlink: A mature URL shortener with a PHP/RoadRunner backend, API access, CLI management, visit tracking, optional GeoLite2 geolocation, and a separate web client.

  • Shlink

  • Shlink on GitHub

  • Updated Shlink self-hosting guide

  • Dub: An open-source link management infrastructure designed for modern marketing teams. Dub provides tools for link attribution, analytics, and more. It’s used by companies like Vercel and Raycast.

  • Dub

    Open-source link management infrastructure. Loved by modern marketing teams like Vercel, Raycast, and Perplexity.

At the time of writting, Dub seems to be the most popular one!

  • Sink: A simple, speedy, and secure link shortener built to run entirely on Cloudflare. Sink offers analytics and leverages the speed and reliability of Cloudflare’s infrastructure.

  • Sink

  • Sink on GitHub

  • Updated Sink Cloudflare self-hosting guide

    ⚡ A Simple / Speedy / Secure Link Shortener with Analytics, 100% run on Cloudflare.

    Deploy it with Cloudflare Workers, D1, and KV. Optional extras include Analytics Engine, R2, and Workers AI.

  • Slite: The local Docker sibling of Sink. Slite keeps the same project-family direction, but runs as one Node.js process with SQLite for links, DuckDB for analytics, and local filesystem storage.

  • Slite

  • Slite on GitHub

  • Slite Docker self-hosting guide

  • Kutt: A modern URL shortener with support for custom domains. Kutt allows you to shorten URLs, manage your links, and view click-rate statistics.

  • Kutt

  • Kutt on GitHub

  • Updated Kutt self-hosting guide

  • TinyURL (Self-Hostable Version): While the popular TinyURL service is proprietary, there’s also an open-source version you can host yourself. TinyURL on GitHub
  • ha.mr: A static URL compressor and QR code optimizer. It is not a normal database-backed shortener; the compressed destination is encoded into the generated link itself.

  • ha.mr

  • ha.mr on GitHub

  • Updated ha.mr self-hosting guide

  • Snapp: A self-hosted URL shortener built with SvelteKit. Snapp is a good option for those looking for a focused self-hosted short-link app with a dashboard, Postgres persistence, teams, API access, and analytics.

  • Snapp

  • Snapp on GitHub is completely OSS, under MIT License

  • Snapp Docker Image

Yet Another Url Shortner. A simple exercise to learn Svelte.

Conclusion

Using an open-source URL shortener gives you control, privacy, and customization over your links.

Whether you need a simple solution or a more advanced platform, there are open-source options available to meet your needs.

Choosing the Right Tool

The best open-source URL shortener for you depends on your specific needs:

  • Simple and Lightweight: If you need a basic URL shortener without many bells and whistles, Snapp or TinyURL might be good choices.
  • Feature-Rich: For advanced features like link tracking, analytics, and custom domains, Shlink or Dub are excellent options.
  • Cloudflare Integration: If you’re using Cloudflare, Sink is a good choice.
  • Ease of Use: Kutt and YOURLS are known for their user-friendly interfaces.

Remember to consider factors like ease of installation, required features, and community support when making your decision.