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 powerful and feature-rich URL shortener offering link tracking, analytics, and API access. It’s a robust solution for those needing advanced features.
-
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.
-
⚡ A Simple / Speedy / Secure Link Shortener with Analytics, 100% run on Cloudflare.
Deploy it with Cloudflare (?) See deployment instructions
-
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.
-
Snapp: A simple URL shortener built with Svelte. Snapp is a good option for those looking for a lightweight and easy-to-deploy solution.
-
Snapp on GitHub is completely OSS, under MIT License
Yet Another Url Shortner. A simple exercise to learn Svelte.
Setup Snapp with docker container ⏬
#version: "3"
services:
redis:
image: redis/redis-stack:latest
volumes:
- /etc/localtime:/etc/localtime:ro
- /home/snapp/redis:/data:rw
networks:
- snapp-stack
environment:
REDIS_ARGS: "--save 60 1 --appendonly yes"
# Optional: Requires `--requirepass mypassword` in REDIS_ARGS
snapp:
image: uraniadev/snapp:0.7.test
ports:
- 3000:3000
networks:
- snapp-stack
environment:
DB_HOST: redis
# DB_PASS:
AUTH_SECRET: # openssl rand -base64 32
networks:
snapp-stack:
external: false
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.