A self-hosted platform for creating, organizing and sharing human-readable short links like s/shortcut.
shlinkio/shlink
A self-hosted URL shortener written in PHP that serves short links under your own domain, with a CLI and REST API.
Open-source alternative to:Bitly
- Stars
- 5,365
- Forks
- 438
- Open issues
- 26
- Last commit
- 7 hours ago
What is it?
Shlink is a self-hosted URL shortener that lets you serve shortened links under your own domain instead of a third-party service. It is written in PHP and can be installed from a prebuilt distribution package, built from source, or run as an official Docker image configured through environment variables.
Shlink supports MySQL, MariaDB, PostgreSQL, Microsoft SQL Server and SQLite as storage backends. Administration is handled through a command line tool (bin/cli), where you can run commands and manage API keys, and through a REST API documented on the project site. A separate web client is available for a browser-based interface, either hosted yourself or used from the project's hosted app.
The project requires PHP 8.4 or 8.5 with several standard extensions. An optional RabbitMQ integration is available for those who need it.
Key features
- 01Serves short URLs under your own domain.
- 02Supports MySQL, MariaDB, PostgreSQL, Microsoft SQL Server and SQLite.
- 03Provides a command line interface for management and API key generation.
- 04Exposes a REST API for integrating with other systems.
- 05Can be deployed from a dist package, from source, or via an official Docker image.
Use cases
- Running a branded link shortener for a company or community on your own domain.
- Keeping click and link data on your own infrastructure instead of a hosted service.
- Automating link creation from other applications through the REST API.
Quick start
- 1
Download the shlink dist zip for your PHP version from the latest GitHub release and decompress it
- 2
Run the installer on the server where Shlink will be hosted
vendor/bin/shlink-installer install - 3
Generate your first API key
bin/cli api-key:generate
Things to know
- Requires PHP 8.4 or 8.5 with several extensions, plus a supported database.
- Self-hosting requires server setup, database configuration and manual installer steps.
In collections
Topics
FAQ
- What is shlink?
- A self-hosted URL shortener written in PHP that serves short links under your own domain, with a CLI and REST API. Shlink is a self-hosted URL shortener that lets you serve shortened links under your own domain instead of a third-party service. It is written in PHP and can be installed from a prebuilt distribution package, built from source, or run as an official Docker image configured through environment variables.
- Is shlink free to use? What license does it have?
- shlink is open source under the MIT license. Check the license terms before using it in commercial products.
- Is shlink still maintained?
- Actively maintained. The last commit to shlink was on Oct 24, 2026.
- What can I use shlink for?
- Running a branded link shortener for a company or community on your own domain. Keeping click and link data on your own infrastructure instead of a hosted service. Automating link creation from other applications through the REST API.
- How do I install shlink?
- Download the shlink dist zip for your PHP version from the latest GitHub release and decompress it Run the installer on the server where Shlink will be hosted: vendor/bin/shlink-installer install Generate your first API key: bin/cli api-key:generate
- Where can I get shlink?
- The source code and installation instructions are on GitHub: https://github.com/shlinkio/shlink
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A self-hosted URL shortener written in PHP, letting you run your own short-link service with control over your data and stats.
Self-hostable URL shortener built with Laravel, Vue 3 and Inertia.js, with click analytics, custom domains and custom slugs.
Kutt is a self-hostable URL shortener with custom domains, link statistics, an admin panel and a RESTful API.
A self-hosted file upload server built for ShareX, with sharing, galleries and short links.
Open-source link attribution platform for short links, conversion tracking, and affiliate programs, built with Next.js and TypeScript.