WHAT IS IT?
Shlink is a URL shortener you host yourself to serve short links under your own domain. The server exposes a REST API and a command line interface. On top of that, an official web client manages several instances from a browser, either on app.shlink.io or self-hosted like the rest. The official Docker image is configured through environment variables.
WHY IS IT INTERESTING?
- Your links under your domain: short URLs are served from your own domain name, and multi-domain mode lets the same slug live on several domains at once.
- API first: the REST API covers day-to-day operations, with role-based API keys that restrict access per domain. Key generation stays on the command line.
- Dynamic redirects: a single short link points to different destinations depending on the visitor's geolocation, device type or language.
- Visit statistics: location, browser and referrer, with bot detection to keep automated traffic out of the numbers. IP addresses are anonymized by default.
- Real-time events: visits can be subscribed to through Mercure or RabbitMQ, which is what you need to plug in a custom dashboard or a downstream job.
USE CASES
- Serving campaign links from a branded domain instead of a third-party service.
- Creating short links from a script or a back office through the REST API.
- Limiting a link to a date range or a visit count for a temporary operation.
- Bringing existing links over: Shlink imports from external services such as bit.ly.
- Tagging links to follow statistics campaign by campaign.
On the install side, you need PHP 8.4 or 8.5 with the json, curl, pdo, intl, gd and gmp or bcmath extensions, then a MySQL, MariaDB, PostgreSQL, Microsoft SQL or SQLite database. A command line installer walks through the configuration, and the first API key comes from bin/cli api-key:generate. The project is MIT licensed.
