Here I will show you, step-by-step, how to install the YOURLS link shortener on a custom domain name using Softaculous in your shared web hosting account cPanel.
YOURLS (short for Your Own URL Shortener) is a free, open-source, and self hosted URL shortener alternative to bit.ly, goo.gl or is.gd.
Bit.ly or Goo.gl are really good link shortening services but maybe you want to create your own branded shortened links using a 100% free, open-source, self-hosted and flexible URL shortening application.
In this tutorial, I will show you how to install self hosted link shortener YOURLS using a custom domain name on Softaculous (for installation on Ubuntu or CentOS check out the guides here).
I will assume that you already have registered a custom domain name and that you set it up on your web host.
Installing YOURLS using Softaculous and start shortening URLs shouldn’t take you more than a couple of minutes to do.
1. Login to your web host’s control panel (I’m using SiteGround)
First, you need to log in to your web hosting control panel (cPanel) and click on the Softaculous icon or button. I’m using SiteGround and it’s the web host I use and recommend (read my SiteGround review).
YOURLS can be installed on most shared web hosts like on InMotion Hosting (review here) or on Bluehost (review here) and you will find it in the 1-click installation scripts (such as Softaculous, Installatron, or Fantastico Deluxe) in the cPanel of your hosting account.
(FYI check out my SiteGround vs Bluehost comparison if you are interested to know how these two web hosts stack up against each other)
2. Access Softaculous (or App Installer, Installatron or Fantastico Deluxe)
Next, locate the search box and search for the YOURLS URL shortening application.
3. Install YOURLS on Softaculous
Then click on the Yourls install link.
4. Configure the YOURLS settings
Finally, you need to configure the YOURLS setup and YOURLS login settings.
- Choose protocol: I recommend using non-WWW (i.e. http:// or https:// only) as this will shorten the URL further
- Choose domain: Choose the domain to install YOURL on (e.g. I have wshr.site)
- In directory: Leave this blank
- Site name: Choose a name for the YOURLS site name
- Admin username: Choose a hard to guess username
- Admin password: Choose an even harder to guess password
- First name: Your first name
- Last name: Your last name
- Admin email: your email address
- Install: Click the install button and YOURLS will be installed
Click the install button and YOURLS URL shortener will be installed using Softaculous. Once it’s installed you will be given the username and password to your YOURLS dashboard/admin area.
That’s it, you’re all done and now you have learned how to install YOURLS! There is also possible to create a link shortener using Cloudflare Workers.
To wrap things up, here below I have summarized the server requirements and noted down some of the pros and cons of YOURLS.
YOURLS server requirements
- Server must have mod_rewrite enabled
- Server must support at least PHP 5.3 and MYSQL 5
- Must have its own .htaccess file (i.e. you can’t install YOURLS in the same directory as for example WordPress)
YOURLS pros and cons
Pros:
- It’s 100% free
- It’s open source (unlike bit.ly)
- It’s self-hosted (you OWN it unlike bit.ly)
- It’s flexible and easy to install on cPanel (control panel that most web hosts like Hostinger use)
- You can use any domain that you own
- You can change the URL destinations later (unlike bit.ly)
- Huge range of free YOURLS plugins (unlike bit.ly)
- Plugins that lets you choose from a range of redirect types (e.g. 301, 302, meta redirect)
- Plugin that sets a fallback URL
- Plugin that makes URLs case insensitive
- Plugin that forces lowercase
- Plugin that adds Google Analytics link tagging
- Plugin that hides the referrer or take you to an anonymizer service
- Plus loads more plugins that extend YOURLS
- You can import and export URLs (unlike bit.ly)
- You can add users (unlike bit.ly)
- You can use it to create vanity, campaign and sales URLs (e.g. for Black Friday web hosting deals vanity URLs)
Cons:
- It can be somewhat challenging to manually install
- It can be even more challenging to install on a cloud server (for example on Kinsta or Cloudways or WP Engine)
- No comprehensive backups are available (import/export or database export are your only options)
- YOURLS shortener design is basic (compared to Bit.ly)