Shlink's two install paths and the host requirements between them
The definitive self-hosted URL shortener
At a glance
- What is it?
- Shlink is a PHP URL shortener you host on your own domain. Getting it running means picking a database, satisfying a fixed extension list, and choosing between a prebuilt dist zip and a local build.sh run.
- Who is it for?
- Shlink fits teams that already run PHP and want short links on their own domain with full control over the API. It is a poor fit if you want a bundled dashboard or a hosted service, since the web client is a separate repository.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly PHP, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.
Star history
- shlinkio/shlink5,421 ★ · +118
| Repository | 2026-09-23 | 2026-11-13 |
|---|---|---|
| shlinkio/shlink | 5.3k | 5.4k |
118 Stars in the last 51 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
PHP 8.4 or 8.5 and six extensions set the floor
Shlink states its host requirements as a floor rather than a suggestion. PHP 8.4 or 8.5, then the extensions json, curl, pdo, intl, gd and gmp/bcmath. Two conditional extensions sit outside that list. The apcu extension is recommended if you do not plan to use RoadRunner, and sockets plus bcmath are required only if you want to integrate with a RabbitMQ instance. Storage is one of MySQL, MariaDB, PostgreSQL, MicrosoftSQL or SQLite, and the matching PDO variation has to be present as `pdo_mysql`, `pdo_pgsql`, `pdo_sqlsrv` or `pdo_sqlite`. A host on PHP 8.3 does not meet the stated requirement, so check the interpreter version before you plan anything else.
A git checkout does not run until build.sh finishes
There is no plain checkout that serves traffic. Two routes exist. Download the `shlink*_dist.zip` file matching your PHP version from the latest release page and decompress it where you want it to live, or build it yourself: clone with `git clone https://github.com/shlinkio/shlink.git`, drop Composer inside the project folder, then run `./build.sh 3.0.0` with the version you intend to build. That number becomes part of the generated dist file name and sets the value returned by `shlink -V` from the command line. Output lands in the `build` directory as a dist file that still has to be decompressed. The same script is what the release workflow runs after tagging, so a local build matches the shape of the published archive.
The installer has to run on the server, not your laptop
Setup is a PHP script with a location constraint. `vendor/bin/shlink-installer install` walks you through the installation process, and it has to be run directly on the server where you plan to host Shlink. Running it elsewhere first and uploading the files afterwards breaks that assumption. Two things come before it: create an empty database with a name of your choice if you picked MySQL, MariaDB, PostgreSQL or Microsoft SQL Server, and recursively grant write permissions to the `data` directory, which Shlink uses to cache information. With SQLite there is no database server to prepare, but the writable `data` directory is still required or the cache has nowhere to land.
The first API key comes from the CLI, and stays there
Installation ends by generating the credential the REST API depends on: `bin/cli api-key:generate` produces your first API key, which you need in order to interact with the API. After that there are two entry points. `bin/cli` lists the available commands, each accepting `--help` or `-h` for its usage and options, and symlinking the CLI entry point into your path lets you run shlink from any directory. The REST API performs mostly the same operations, with documentation at shlink.io/documentation/api-docs and a sandbox documenting every endpoint at api-spec.shlink.io. One operation is asymmetric: API key management is done from the command line interface only, so scripted automation of keys has no HTTP counterpart.
The Docker image hardcodes pdo_sqlsrv to x86_64
The container makes its own version and runtime decisions before PHP does. It starts from `php:8.5-alpine3.24`, sets `USER_ID` to 1001, and exposes two build arguments you can override: `SHLINK_VERSION`, defaulted to `latest`, and `SHLINK_RUNTIME`, defaulted to `rr`. Extensions compile in a single layer where temporary dev packages are installed and then removed with `apk del .dev-deps`, with `pdo_sqlite` added afterwards once `sqlite-libs` is present. The SQL Server driver is architecture dependent: the `pdo_sqlsrv` 5.13.0 install is guarded by an `uname -m` check for x86_64. On arm64 the image builds successfully and simply has no SQL Server support, so a MariaDB or PostgreSQL backend is the portable choice on Apple silicon and similar hosts.
The compose file declares ten linked services behind one PHP container
The repository's `docker-compose.yml` wires far more than a shortener needs on day one. The `shlink_php` service builds from `./data/infra/php.Dockerfile`, runs as `user: 1000:1000`, publishes `8888:8888`, mounts the working tree at `/home/shlink/www` alongside `data/infra/php.ini`, and sets `DEFAULT_DOMAIN: localhost:8000`. It declares links to eleven others: MySQL, PostgreSQL, MariaDB, Microsoft SQL, two Redis variants, two Mercure services, the Mercure proxy, RabbitMQ and Matomo. `shlink_nginx` uses `nginx:1.25-alpine` on `8000:80` and mounts the same tree plus `./docs` at `public/docs`. Read that list as configuration surface, since each linked name has to resolve and each unused service is dead weight you can delete before the first boot.
The README stops at the basics and ships no dashboard
The document names its own limits: it holds the very basics, and everything else lives in the full searchable documentation at shlink.io/documentation, with the image covered separately at shlink.io/documentation/install-docker-image. Not addressed there is rollback after a failed upgrade, backing up the `data` directory or the database, log rotation, or any rate limiting on API keys. The web client is not part of this repository either. It lives in shlinkio/shlink-web-client and can be pointed at https://app.shlink.io or self hosted, which means a fresh install has no bundled dashboard in the tree. Root entries such as `UPGRADE.md`, `SECURITY.md`, `DEVELOPING.md` and `config/` hint at more, but beyond the installer, `bin/cli` and the key generation step, the README leaves further CLI usage to `--help` output.
Editorial conclusion
Shlink fits teams that already run PHP and want short links on their own domain with full control over the API. It is a poor fit if you want a bundled dashboard or a hosted service, since the web client is a separate repository. Before starting, confirm your PHP minor version, that the PDO driver for your chosen database is compiled in, and whether you can run the installer on the final server rather than your workstation.
Frequently asked questions
What is Shlink?
A PHP-based self-hosted URL shortener that serves shortened URLs under your own domain, released under the MIT license with its code on GitHub and its docs at shlink.io.
How do you install Shlink?
Either decompress the `shlink*_dist.zip` file for your PHP version from the latest release, or clone the repo and run `./build.sh 3.0.0` with your version, then create the database, make `data` writable, run `vendor/bin/shlink-installer install` on the target server, and generate a key with `bin/cli api-key:generate`.
How do you use Shlink once it is installed?
Through the command line via `bin/cli`, where every command takes `--help` or `-h`, or through the REST API documented at shlink.io/documentation/api-docs. A web client from shlink-web-client can be used hosted at app.shlink.io or self hosted.
Is Shlink free?
The repository carries an MIT license and is not archived. Distribution options include the dist zip, a source build, and an official Docker image published on Docker Hub, so no paid tier is described.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/shlinkio-shlink)Star history chart for your README
[](https://hysenlabs.com/projects/shlinkio-shlink)Was this useful?