PHPackages                             shlinkio/shlink - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. shlinkio/shlink

ActiveProject[Utility &amp; Helpers](/categories/utility)

shlinkio/shlink
===============

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

v5.0.1(2mo ago)4.8k4.3k↓11.5%380[18 issues](https://github.com/shlinkio/shlink/issues)[1 PRs](https://github.com/shlinkio/shlink/pulls)MITPHPPHP ^8.4CI passing

Since May 2Pushed 2mo ago20 watchersCompare

[ Source](https://github.com/shlinkio/shlink)[ Packagist](https://packagist.org/packages/shlinkio/shlink)[ Docs](https://shlink.io)[ Fund](https://slnk.to/donate)[ GitHub Sponsors](https://github.com/acelaya)[ RSS](/packages/shlinkio-shlink/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (108)Versions (157)Used By (0)

[![Shlink](https://raw.githubusercontent.com/shlinkio/shlink.io/main/public/images/shlink-hero.png)](https://raw.githubusercontent.com/shlinkio/shlink.io/main/public/images/shlink-hero.png)

[![Build Status](https://camo.githubusercontent.com/30883635b769c52fd5017b8f7bc6b90929de2b87ba14538bd2e7adf75c595c15/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73686c696e6b696f2f73686c696e6b2f63692e796d6c3f6272616e63683d646576656c6f70266c6f676f3d676974687562267374796c653d666c61742d737175617265)](https://github.com/shlinkio/shlink/actions/workflows/ci.yml?query=workflow%3A%22Continuous+integration%22)[![Code Coverage](https://camo.githubusercontent.com/f3e1fc0f829a3a27d875e4565f86bdb634a54749e83de7fa7cd2a85b3366add2/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f73686c696e6b696f2f73686c696e6b2f646576656c6f703f7374796c653d666c61742d737175617265)](https://app.codecov.io/gh/shlinkio/shlink)[![Latest Stable Version](https://camo.githubusercontent.com/9042e2226565388d1ab4b5c4f1ca5942940035e0175d0829a0ce487525964000/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73686c696e6b696f2f73686c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/shlinkio/shlink)[![Docker pulls](https://camo.githubusercontent.com/e772c10e98f87fe01da100601bf16b79a4986af0dfe2c9b6c2d28ef560e03998/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f73686c696e6b696f2f73686c696e6b2e7376673f6c6f676f3d646f636b6572267374796c653d666c61742d737175617265)](https://hub.docker.com/r/shlinkio/shlink/)[![License](https://camo.githubusercontent.com/8841f7d0294c1a3344ead9bd7296b6212b7480b67dd3debc275b649c6aa35a13/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73686c696e6b696f2f73686c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/shlinkio/shlink/blob/main/LICENSE)

[![Mastodon](https://camo.githubusercontent.com/06426394b30c14ab6580dc4e9c28f737c17fc55b07a16fb2d5bf077ee7a5254c/68747470733a2f2f696d672e736869656c64732e696f2f6d6173746f646f6e2f666f6c6c6f772f3130393332393432353432363137353039383f636f6c6f723d25323336333634666626646f6d61696e3d6874747073253341253246253246666f7373746f646f6e2e6f7267266c6162656c3d666f6c6c6f77266c6f676f3d6d6173746f646f6e266c6f676f436f6c6f723d7768697465267374796c653d666c61742d737175617265)](https://fosstodon.org/@shlinkio)[![Bluesky](https://camo.githubusercontent.com/7669b74e57eb087220848878d641ca0610dfc3b4773b1394a88d02db6422e04d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f666f6c6c6f772d73686c696e6b696f2d3032383546462e7376673f7374796c653d666c61742d737175617265266c6f676f3d626c7565736b79266c6f676f436f6c6f723d7768697465)](https://bsky.app/profile/shlink.io)[![Paypal donate](https://camo.githubusercontent.com/f7bd7ab1d7bea7a4ac78f5189c56ce2dbf8cc73608863e0dd9408e10ddca4673/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d70617970616c2d626c75652e7376673f7374796c653d666c61742d737175617265266c6f676f3d70617970616c26636f6c6f72413d616161616161)](https://slnk.to/donate)

A PHP-based self-hosted URL shortener that can be used to serve shortened URLs under your own domain.

Table of Contents
-----------------

[](#table-of-contents)

- [Full documentation](#full-documentation)
- [Docker image](#docker-image)
- [Self-hosted](#self-hosted)
    - [Download](#download)
    - [Configure](#configure)
- [Using shlink](#using-shlink)
- [Contributing](#contributing)

Full documentation
------------------

[](#full-documentation)

This document contains the very basics to get started with Shlink. If you want to learn everything you can do with it, visit the [full searchable documentation](https://shlink.io/documentation/).

Docker image
------------

[](#docker-image)

You can learn how to use the official docker image by reading [the docs](https://shlink.io/documentation/install-docker-image/).

The idea is that you can just generate a container using the image and provide the custom config via env vars.

Self-hosted
-----------

[](#self-hosted)

First, make sure the host where you are going to run shlink fulfills these requirements:

- PHP 8.4 or 8.5
- The next PHP extensions: json, curl, pdo, intl, gd and gmp/bcmath.
    - apcu extension is recommended if you don't plan to use RoadRunner.
    - sockets and bcmath extensions are required if you want to integrate with a RabbitMQ instance.
- MySQL, MariaDB, PostgreSQL, MicrosoftSQL or SQLite.
    - You will also need the corresponding pdo variation for the database you are planning to use: `pdo_mysql`, `pdo_pgsql`, `pdo_sqlsrv` or `pdo_sqlite`.

### Download

[](#download)

In order to run Shlink, you will need a built version of the project. There are two ways to get it.

- **Using a dist file**

    The easiest way to install shlink is by using one of the pre-bundled distributable packages.

    Go to the [latest version](https://github.com/shlinkio/shlink/releases/latest) and download the `shlink*_dist.zip` file that suits your needs. You will find one for every supported PHP version.

    Finally, decompress the file in the location of your choice.
- **Building from sources**

    If for any reason you want to build the project yourself, follow these steps:

    - Clone the project with git (`git clone https://github.com/shlinkio/shlink.git`), or download it by clicking the **Clone or download** green button.
    - Download the [Composer](https://getcomposer.org/download/) PHP package manager inside the project folder.
    - Run `./build.sh 3.0.0`, replacing the version with the version number you are going to build (the version number is used as part of the generated dist file name, and to set the value returned when running `shlink -V` from the command line).

    After that, you will have a dist file inside the `build` directory, that you need to decompress in the location of your choice.

    > **Note**
    >
    > This is the process used when releasing new Shlink versions. After tagging the new version with git, the GitHub release is automatically created by a [GitHub workflow](https://github.com/shlinkio/shlink/actions?query=workflow%3A%22Publish+release%22), attaching the generated dist file to it.

### Configure

[](#configure)

Despite how you built the project, you now need to configure it, by following these steps:

- If you are going to use MySQL, MariaDB, PostgreSQL or Microsoft SQL Server, create an empty database with the name of your choice.
- Recursively grant write permissions to the `data` directory. Shlink uses it to cache some information.
- Set up the application by running the `vendor/bin/shlink-installer install` script. It is a command line tool that will guide you through the installation process. **Take into account that this tool has to be run directly on the server where you plan to host Shlink. Do not run it before uploading/moving it there.**
- Generate your first API key by running `bin/cli api-key:generate`. You will need the key in order to interact with Shlink's API.

Using shlink
------------

[](#using-shlink)

Once shlink is installed, there are two main ways to interact with it:

- **The command line**: Try running `bin/cli` to see all the available commands.

    All of them can be run with the `--help`/`-h` flag in order to see how to use them and all the available options.

    It is probably a good idea to symlink the CLI entry point (`bin/cli`) to somewhere in your path, so that you can run shlink from any directory.
- **The REST API**: The complete docs on how to use the API can be found [here](https://shlink.io/documentation/api-docs), and a sandbox which also documents every endpoint can be found in the [API Spec](https://api-spec.shlink.io/) portal.

    However, you probably don't want to consume the raw API yourself. That's why a nice [web client](https://github.com/shlinkio/shlink-web-client) is provided that can be directly used from , or hosted by yourself.

Both the API and CLI allow you to do mostly the same operations, except for API key management, which can be done from the command line interface only.

Contributing
------------

[](#contributing)

If you are trying to find out how to run the project in development mode or how to provide contributions, read the [CONTRIBUTING](CONTRIBUTING.md) doc.

Powered by
----------

[](#powered-by)

Thanks to [JetBrains](https://www.jetbrains.com/) for their continuous support to this project in the form of IDE licenses.

[![JetBrains logo](https://camo.githubusercontent.com/b5639e7738c6dfae9fe3f3e20175570b7376ce2577a772e09c25c2d4f14bf86e/68747470733a2f2f7265736f75726365732e6a6574627261696e732e636f6d2f73746f726167652f70726f64756374732f636f6d70616e792f6272616e642f6c6f676f732f6a6574627261696e732e737667)](https://camo.githubusercontent.com/b5639e7738c6dfae9fe3f3e20175570b7376ce2577a772e09c25c2d4f14bf86e/68747470733a2f2f7265736f75726365732e6a6574627261696e732e636f6d2f73746f726167652f70726f64756374732f636f6d70616e792f6272616e642f6c6f676f732f6a6574627261696e732e737667)

---

> This product includes GeoLite2 data created by MaxMind, available from

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance86

Actively maintained with recent releases

Popularity54

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity99

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Recently: every ~36 days

Total

155

Last Release

75d ago

Major Versions

1.x-dev → v2.0.32020-01-27

v2.10.3 → v3.0.02022-01-28

v3.7.3 → v4.0.02024-03-03

3.x-dev → v4.0.32024-03-15

v4.6.0 → v5.0.02026-01-09

PHP version history (12 changes)v0.1.0PHP ^5.5 || ^7.0

v0.2.0PHP ^5.6 || ^7.0

v1.6.0PHP ^7.0

v1.8.0PHP ^7.1

v1.17.0PHP ^7.2

v2.0.0PHP ^7.4

v2.6.0PHP ^7.4 || ^8.0

v2.8.0-alpha.1PHP ^8.0

v3.2.0PHP ^8.1

v3.7.0-beta.1PHP ^8.2

v4.4.0PHP ^8.3

v5.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/73480af83259e096d154a8c4333e550c186b28ccb7a0d11f537b9aa57ad35392?d=identicon)[acelaya](/maintainers/acelaya)

---

Top Contributors

[![acelaya](https://avatars.githubusercontent.com/u/2719332?v=4)](https://github.com/acelaya "acelaya (4653 commits)")[![jsoref](https://avatars.githubusercontent.com/u/2119212?v=4)](https://github.com/jsoref "jsoref (8 commits)")[![alesub](https://avatars.githubusercontent.com/u/1220806?v=4)](https://github.com/alesub "alesub (8 commits)")[![Starbix](https://avatars.githubusercontent.com/u/12443257?v=4)](https://github.com/Starbix "Starbix (5 commits)")[![jakkuh](https://avatars.githubusercontent.com/u/14115855?v=4)](https://github.com/jakkuh "jakkuh (4 commits)")[![wuuei](https://avatars.githubusercontent.com/u/9289130?v=4)](https://github.com/wuuei "wuuei (3 commits)")[![Roy-Orbison](https://avatars.githubusercontent.com/u/28617290?v=4)](https://github.com/Roy-Orbison "Roy-Orbison (3 commits)")[![weirdan](https://avatars.githubusercontent.com/u/57403?v=4)](https://github.com/weirdan "weirdan (3 commits)")[![KetchupBomb](https://avatars.githubusercontent.com/u/13783465?v=4)](https://github.com/KetchupBomb "KetchupBomb (2 commits)")[![NReilingh](https://avatars.githubusercontent.com/u/2458645?v=4)](https://github.com/NReilingh "NReilingh (2 commits)")[![PeterDaveHello](https://avatars.githubusercontent.com/u/3691490?v=4)](https://github.com/PeterDaveHello "PeterDaveHello (2 commits)")[![celayale](https://avatars.githubusercontent.com/u/42169931?v=4)](https://github.com/celayale "celayale (2 commits)")[![dlondero](https://avatars.githubusercontent.com/u/209782?v=4)](https://github.com/dlondero "dlondero (2 commits)")[![kanadaj](https://avatars.githubusercontent.com/u/3247357?v=4)](https://github.com/kanadaj "kanadaj (2 commits)")[![SirFlip](https://avatars.githubusercontent.com/u/6735323?v=4)](https://github.com/SirFlip "SirFlip (1 commits)")[![jpatters](https://avatars.githubusercontent.com/u/195614?v=4)](https://github.com/jpatters "jpatters (1 commits)")[![PxSonny](https://avatars.githubusercontent.com/u/6723977?v=4)](https://github.com/PxSonny "PxSonny (1 commits)")[![robwent](https://avatars.githubusercontent.com/u/411678?v=4)](https://github.com/robwent "robwent (1 commits)")[![vaslv](https://avatars.githubusercontent.com/u/1648799?v=4)](https://github.com/vaslv "vaslv (1 commits)")[![LeagueRaINi](https://avatars.githubusercontent.com/u/19365835?v=4)](https://github.com/LeagueRaINi "LeagueRaINi (1 commits)")

---

Tags

laminasmezziophprest-apiurl-shortener

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/shlinkio-shlink/health.svg)

```
[![Health](https://phpackages.com/badges/shlinkio-shlink/health.svg)](https://phpackages.com/packages/shlinkio-shlink)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[magento/community-edition

Magento 2 (Open Source)

12.1k52.1k10](/packages/magento-community-edition)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
