Long URLs are difficult to remember.
With a self-hosted URL shortener, you need only remember your own domain name and a short string.
Here’s how to set up and use one on your Raspberry Pi.
Why Do You Need a URL Shortener?
URLs are long unwieldy things, and can be difficult to remember.
The URL for this post, for instance, ishttps://www.makeuseof.com/run-your-own-url-shortener-on-raspberry-pi/.
Shorter URLs give you more space to write.
By using a URL shortener, you’ve saved a huge 41 characters.
Otherexcellent reasons for using a URL shortenerinclude branding and marketing, tracking clicks, and deep linking to apps.
Why Host a URL Shortener on Raspberry Pi?
There are many commercial URL shortening services available.
These services host your collections of shortened URLs, but they’re vulnerable and not especially portable.
If you break the terms of service, your collection could vanish in an eyeblink.
It’s a mere seven characters, easy to remember, and is related to the main website.
We could have chosen an equally effective muo.fun, muo.gay, muo.la, or muo.wtf.
Thepossibilities for a good domain nameare endless.
Register the domain (ours cost $1.98 for year), then visit the advanced DNS section.
Set the TTL as low as possible.
However, it’s safe to ignore this.
When asked, “Do you trust ‘kylekatarnls/update-helper’ to execute code and wish to enable it now?”
hitYon your keyboard and thenReturn.
You will be returned to the command prompt.
Some of these fields will be pre-filled.
If you followed our instructions exactly, this will betopsecretpassword.
The utility URL is your domain name.
Remember to set a sensible admin username and secure password.
you might also select from a variety of themes including Google Material Design, Newspaper, and Midnight Black.
When you’re done, hit the greenInstallbutton at the bottom of the page.
Secure your Polr installation by using Certbot to fetch and install certificates and keys from Let’s Encrypt.
put in your email address when requested, and select which name would you like to activate HTTPS for.
Certbot will fetch and install SSL keys and certificates from Let’s Encrypt.
To shorten a URL, simply paste the URL into the text box, and clickShorten.
Or clickLink optionsto customize the short link.