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:
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.
-
Updated Shlink self-hosting guide
- See also: Installing Shlink on Synology NAS
-
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.
-
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.
-
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.
-
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 is a modern URL shortener with support for custom domains. Shorten URLs, manage your links and view the click rate statistics.
-
YOURLS: A self-hosted URL shortener that gives you complete control over your links. YOURLS is a classic and well-established option.
YOURLS ⏬
YOURLS stands for Your Own URL Shortener. It’s a small set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL or bitly).
- 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
tinyurl ⏬
A self-hosted, modern URL shortener, written in Go and React, with a focus on speed, customizability, and ease of use.
-
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.
-
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 on GitHub is completely OSS, under MIT License
Yet Another Url Shortner. A simple exercise to learn Svelte.
Snapp setup note
I originally covered Snapp here with an older Redis-based Docker snippet. That setup is now outdated: current Snapp uses Postgres, Better-Auth, Drizzle, and config/settings.yaml for host/domain configuration.
Use the updated Snapp guide instead:
Snapp setup note
I originally covered Snapp here with an older Redis-based Docker snippet. That setup is now outdated: current Snapp uses Postgres, Better-Auth, Drizzle, and config/settings.yaml for host/domain configuration.
Use the updated Snapp guide instead:
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.
Comments