Your Own URL Shortener
YOURLS is a set of PHP scripts that will allow you to run Your Own URL Shortener, on your server. You'll have full control over your data, detailed stats, analytics, plugins, and more. It's free and open-source.
- Getting Started
- Setup
- Usage
- Architecture
- Community news, tips and tricks
- Contributing
- Backers
- Sponsors
- License
Check out the complete documentation on docs.yourls.org. It contains everything from beginners to experts.
- Download YOURLS: Clone or download the YOURLS repository from GitHub.
- Configure your server: Make sure your server meets the requirements:
- PHP 7.2 or greater
- MySQL 5.0 or greater
mod_rewriteenabled
- Create a database: Create a new MySQL database and a user with full privileges.
- Configure YOURLS:
- Rename
user/config-sample.phptouser/config.php. - Open
user/config.phpand fill in the required database settings. - Customize the other settings to your liking.
- Rename
- Install YOURLS: Open your browser and navigate to
http://your-site.com/admin/install.php. - Secure your installation:
- Make sure the
user/config.phpfile is not publicly accessible. - Change the default username and password in
user/config.php. - Delete the
admin/install.phpfile after the installation is complete.
- Make sure the
The admin interface is located at http://your-site.com/admin/. From here, you can:
- Shorten URLs: Add new short URLs and custom keywords.
- Manage URLs: View, edit, and delete existing short URLs.
- View stats: See detailed statistics for each short URL, including clicks, referrers, and geographic location.
- Manage plugins: Activate and deactivate plugins to extend the functionality of YOURLS.
- Use tools: Access the bookmarklets and API information.
YOURLS provides a simple API that allows you to shorten URLs, get stats, and more. The API is located at http://your-site.com/yourls-api.php.
For more information on how to use the API, see the API documentation.
YOURLS comes with handy bookmarklets for easier link shortening and sharing. To use them, drag and drop the links from the Tools page in the admin interface to your browser's toolbar.
The YOURLS application is structured as follows:
/admin: Contains the files for the admin interface./includes: Contains the core application files, including the functions for handling URLs, the database, and the API./user: Contains user-specific files, such as the configuration file and any custom plugins or pages./(root): Contains the main entry points for the application, including the redirection handler, the API, and the admin interface.
- Read and subscribe to the The Official YOURLS Blog
- Check what the user community makes: plugins, tools, guides and more on Awesome YOURLS
- Engage users and ask for help in our community discussions
- Keep track of development: "Star" and "Watch" this project, follow commit messages
Feature suggestion? Bug to report?
Before opening any issue, please search for existing issues (open and closed) and read the Contributing Guidelines.
Do you use and enjoy YOURLS? Become a backer and show your support to our open source project.
Does your company use YOURLS? Ask your manager or marketing team if your company would be interested in supporting our project. Your company logo will show here. Help support our open-source development efforts by becoming a sponsor.
Free software. Do whatever the hell you want with it. YOURLS is released under the MIT license.
