YOURLS is a set of PHP scripts that will allow you to run Your Own URLShortener. You’ll have full control over your data, detailed stats, analytics, plugins, and more. It’s free and open-source.
Github: https://github.com/YOURLS/YOURLS
Website: https://yourls.org/