How To Install YOURLS

By -

YOURLS is an (amazing) open-source software to create your own URL shortening service with your own custom domain. YOURLS stands for Your Own URL Shortener. It’s open-source, just like WordPress.

If you use YOURLS, then you don’t need to depend on a third-party URL shortening service to create short URLs. It’s also a great way to add branding to your short URLs, instead of using the same boring TinyURL or bitly links.

FAQ

But bitly Is Already There, Right?

It is, and I believe it will always be there. But having your personal URL shortening service gives you full control over your URLs. You don’t need to depend on random generated URLs, but you can also generate personalized URLs. Personal branding is really important, and Dustin Hartzler has a great episode about the importance of personal branding.

And What About The Stats & All?

Dude, YOURLS is an entire software to create your own service to create short links, so it gives you very detailed stats about each link and many great features. Plus, if you’re a developer, you can also create a custom plugin.

How To Install

Download YOURLS

First you need to download YOURLS’ latest version from their official Github page. Download the latest .zip version of the software. As of writing, 1.7 is the latest version available in the Github repository.

Create A MySQL Database For YOURLS

This software needs a database to store all the links data, so we need to create a MySQL database for the software. If you have some experience with databases, you can also install it to an existing database. You can create a MySQL database from your hosting panel or cPanel. Create a database , make sure you write down the database name, username and password you’ve just created. We these credentials later in the tutorial.

Create MySQL DatabaseConfigure YOURLS

Before we could upload YOURLS to our web server, we need to configure it.

  • Unzip the YOURLS archive
  • Copy user/config-sample.php to user/config.php
  • Open user/config.php with Notepad and fill following settings

Fill the following part of the file with your database username, password, database name, database host & table prefix for YOURLS. It’s the info that we used while creating our MySQL database.

Now scroll down a little cuz we have more stuff to define. You need to fill your website domain or the directory where you have installed YOURS and your GMT timezone.

If you have used www.example.com, then you won’t be able to use the service with www. prefix. In GMT timezone part, all you need to do is put your timezone, such as +5:30 for India.

Now we will set our preferred language for YOURLS dashboard. Define your language in the following lines (Click here for more info):

Now let’s scroll a little more for some additional settings. Fill following info in this three-part code:

If you want only to have one pair of short/long URL then don’t touch this field, otherwise change the following to false:

If you want your admin area to be password protected then don’t change the following value, otherwise jut change it to false:

Now add some random code to the following field to encrypt cookies. You don’t need to remember this code, so make it long & complicated. You can generate a random code by clicking here.

If you have password protected your admin area, then you will have define some user accounts, which can be defined from the following part:

You can add as many user accounts as you want just by adding more ‘login’=>’password’ lines.

If you’re a developer, then you might wanna turn debugging by defining following part:

Now scroll down to the URL shortening settings more final steps. Define your URL shortening method in following lines:

  • 36: generates all lowercase keywords (ie: 13jkm)
  • 62: generates mixed case keywords (ie: 13jKm or 13JKm)

Time for the final part of configuration settings. Now we need to define some reserved terms which can’t be used for shortening URLs. Add or remove words in the following part:

Upload To Server

Just save the config.php file, and upload the entire YOURLS folder or files to your web server via FTP or File Manager. Just point your browser to http://yoursite.com/admin/ to see your new YOURLS installation in work.

That’s it! Don’t forget to leave your comments…

Hope this article helped you. If it helped you then please consider making a small amount of donation. Any amount, even $1.00, is appreciated.

Teen blogger and a huge pro-wrestling fan. Also known for bunch of websites. Formerly worked as a lawn gnome and scare crow.

4 Comments to How To Install YOURLS

Leave a Reply

Are you concerned about your WordPress website's security? Download our FREE PDF book to learn about WordPress security and how you can make your WordPress hacker-proof!