TiloBox
Back to directory
YOURLS project preview

YOURLS

Your Own URL Shortener: open-source link shortener and self-hosted alternative to Bitly.

LicenseMIT
GitHub stars12.2k
Last commit1 weeks ago
Tags6 topics
Link TrackerPluginsAnalyticsUrl ShortenerSelf HostedPhp
Overview

Why consider YOURLS?

YOURLS is an open-source PHP link shortener that runs on your own domain. It provides custom keyword slugs, click tracking analytics, referrers geolocation, and full plugin support.

Guided learning

Learn YOURLS by building

Practical setup notes, real use cases, and copy-ready examples in one focused guide.

3 min read 10 sections
In this guide10 sections

What is YOURLS?

YOURLS (Your Own URL Shortener) is an open-source web application written in PHP and MySQL that lets you run your own private or public link shortening service on custom branded domains. It serves as a self-hosted alternative to commercial link shorteners like Bitly, TinyURL, and Rebrandly.

YOURLS gives you full control over short URLs: customize keyword slugs, track detailed click analytics and referrer sources, restrict access to authorized team members, and extend capabilities using a rich library of community plugins and REST APIs.

Who Is It For?

  • Marketing Teams & Content Creators: Creating branded short links (e.g. go.brand.com/summer-sale) that maintain brand recognition on social media and email campaigns.
  • Enterprise Organizations: Shortening internal corporate URLs while keeping link analytics and destination data strictly inside private network domains.
  • Web Developers: Integrating automated programmatic short link creation into mobile apps, web backends, and Slack bots via REST APIs.

Key Features

  • Custom branded short links: Choose custom keyword slugs or generate sequential/random short strings.
  • Comprehensive link analytics: Track total clicks, referrers, visitor countries, and historical traffic graphs.
  • Full REST API with secret signature token authentication for programmatic link creation and retrieval.
  • Powerful plugin architecture supporting custom authentication, anti-spam, QR codes, and caching.
  • Password-protected administrative dashboard with public or private access modes.

Deploying YOURLS with Docker Compose

yaml
1version: '3.5'
2
3services:
4 yourls:
5 image: yourls:latest
6 container_name: yourls
7 restart: unless-stopped
8 ports:
9 - "8080:80"
10 environment:
11 - YOURLS_DB_HOST=db
12 - YOURLS_DB_NAME=yourls
13 - YOURLS_DB_USER=yourls
14 - YOURLS_DB_PASS=secure_yourls_pass
15 - YOURLS_SITE=http://localhost:8080
16 - YOURLS_USER=admin
17 - YOURLS_PASS=secure_admin_password
18 - YOURLS_SECRET=generate_a_secure_random_hash_token_string
19 depends_on:
20 - db
21
22 db:
23 image: mariadb:10.11
24 container_name: yourls_db
25 restart: unless-stopped
26 volumes:
27 - ./mysql_data:/var/lib/mysql
28 environment:
29 - MARIADB_DATABASE=yourls
30 - MARIADB_USER=yourls
31 - MARIADB_PASSWORD=secure_yourls_pass
32 - MARIADB_ROOT_PASSWORD=root_secure_password

Start the instance:

bash
1docker compose up -d

Open http://localhost:8080/admin/ in your browser to complete one-click database table creation and begin generating short links.

Practical Use Cases

1. Branded Marketing Campaigns

A marketing team generates custom campaign short links (link.brand.com/launch) for printed billboards and social ads, tracking total scans and geo-location conversion rates.

2. Programmatic API Integration

An e-commerce order confirmation backend calls the YOURLS API via cURL to generate unique tracking links sent to customers via SMS.

3. QR Code Generation for Events

An event organizer installs the official YOURLS QR Code plugin to automatically generate high-resolution QR codes alongside each short link for printed badges.

Troubleshooting and Limitations

  • Web Server URL Rewriting (mod_rewrite): YOURLS requires Apache mod_rewrite (or Nginx try_files) enabled to route short URLs to yourls-loader.php.
  • Public Domain Configuration: Ensure YOURLS_SITE matches your exact external public URL (including protocol and port) to ensure generated short links resolve accurately.

Official Resources

Related tools

More options with a similar category or technology profile.

YOURLS FAQs

YOURLS is listed as a Productivity tool on TiloBox. Review the overview, features, and official documentation on this page to decide whether it solves your specific workflow.

Start with the project's GitHub repository and official website for supported installation and deployment instructions. Test the setup with representative data or a small project before rolling it out more widely.

YOURLS is listed under the MIT license. Read the complete license text and the project's notices before using, modifying, or distributing the software.

Production readiness depends on your requirements. Review maintenance activity, security practices, documentation, backup and upgrade procedures, and compatibility with your stack; then validate it in a non-production environment.

YOURLS is listed as an alternative to Bitly. Compare the core workflow, deployment model, integrations, and licensing against your must-have requirements before switching.