talira

Your Own URL Shortener

open sourceMITself-hostablefree

YOURLS (Your Own URL Shortener) is a set of PHP scripts for running a URL shortener on your own domain or subdomain, with full control over the links and their data. It keeps click stats with historical reports, referrers and visitor geolocation, has bookmarklets for shortening from the browser, and an API that creates short URLs with sequential or custom keywords, expands them and returns stats in JSON, XML or plain text, signed in with a password or a passwordless signature token. The admin area is private behind a login by default, and a sample public front page turns it into a public shortener; features beyond the small core come from a plugin API and the community plugins listed in Awesome YOURLS. It needs Apache 2.4 with mod_rewrite (or nginx), PHP 8.1 or later and MySQL or MariaDB, and also ships as an official Docker image and Helm chart; it's MIT-licensed, has been developed since 2009 and is funded by backers on Open Collective.

Ways to install

Problems it solves

  • run my own URL shortener on my blog's short domain instead of using Bitly
  • a free self-hosted link shortener in PHP that runs on cheap shared hosting
  • see how many clicks each short link got, where visitors came from and which countries
  • shorten links with custom keywords like example.co/podcast for my show notes
  • a bookmarklet that shortens the page I'm on with my own domain
  • create short links from a script or my WordPress site through an API
  • let anyone on our intranet shorten links without logging in
  • offer a public link shortening page on my site while keeping the admin area private
  • add features to my URL shortener with plugins, like spam checks or random keywords
  • keep ownership of all my short links and their click data if a service shuts down
  • use an API token instead of my password when a tool creates short links for me
  • deploy a URL shortener on Kubernetes with an official Helm chart
  • a self-hosted Bitly alternative backed by MySQL
  • brand all the links in our newsletters with our own short domain

Features

  • short URLs on your own domain or subdomain, with sequential or custom keywords
  • click stats with historical reports, referrer tracking and visitor geolocation
  • bookmarklets for shortening from the browser
  • API (yourls-api.php) to shorten, expand and get stats, with JSON, JSONP, XML or plain-text output
  • passwordless API requests with a signature token
  • custom API actions defined by plugins
  • plugin API with core plugins and dozens of community plugins listed in Awesome YOURLS
  • private admin area behind a login, or a public setup for intranets
  • sample public front page for running a public shortener
  • several username and password pairs in the config file
View 2 more
  • translations through a .pot file
  • official container image (Docker Hub yourls, ghcr.io/yourls/yourls) and Helm chart

Limitations

  • Doesn't support PostgreSQL or SQLite: YOURLS stores links only in MySQL 5.5+ or MariaDB 10.0+7
  • Can't share its directory with WordPress or another app that uses .htaccess rewrite rules: it needs its own root or subdirectory8

Capabilities

Has an APIplan not known
Takes pluginsplan not known

Alternatives

The same job

These do what YOURLS does.

  1. Shlink The definitive self-hosted URL shortener
  2. Kutt Free modern URL shortener
  3. Bitly Create, share, and track short links and QR Codes
  4. Short.io URL shortener with custom domains & analytics
  5. Dub Link attribution platform: short links, conversion tracking and affiliate programs
  6. Chhoto URL Small self-hosted URL shortener written in Rust

Compare YOURLS with the top 3