YOURLS is a classic open-source PHP URL shortener that lets you run your own short-link service with detailed stats, plugins and full data ownership.