# Shlink ## Documentation - [Getting started](https://sourcey-shlink.pages.dev/documentation/index.md): Shlink is a self-hosted URL shortener which provides both a REST and a CLI interface to interact with it. - [Install using a docker image](https://sourcey-shlink.pages.dev/documentation/install-docker-image/index.md): The docker image is probably the simplest installation use case, since it includes all dependencies and works standalone. - [Install using a dist file](https://sourcey-shlink.pages.dev/documentation/install-dist-file/index.md): Install using a dist file - [Supported runtimes](https://sourcey-shlink.pages.dev/documentation/supported-runtimes/index.md): Shlink supports a number of ways to serve it. Each one of them has pros and cons, and depending on your technical knowledge and needs, you may prefer to choose one or another. - [Serve Shlink using RoadRunner](https://sourcey-shlink.pages.dev/documentation/supported-runtimes/serve-with-roadrunner/index.md): Starting with v3.3.0, Shlink can be served with RoadRunner. - [Serve Shlink using FrankenPHP](https://sourcey-shlink.pages.dev/documentation/supported-runtimes/serve-with-franken-php/index.md): Starting with v4.6.0, it is possible to use FrankenPHP to serve Shlink, using its worker mode. - [Serve Shlink with a classic web server](https://sourcey-shlink.pages.dev/documentation/supported-runtimes/classic-web-server/index.md): In order to be able to serve shlink, you need to put a web server with PHP integration in front of it. - [Supported database engines](https://sourcey-shlink.pages.dev/documentation/supported-db-engines/index.md): Performance with all of them is pretty similar, and the only reason to not force you to use a specific one is so that you can use the one you are more comfortable with. - [GeoLite2 license key](https://sourcey-shlink.pages.dev/documentation/geolite-license-key/index.md): Shlink makes use of a GeoLite2 database, by MaxMind, to geolocate visits to your short URLs. - [Update your Shlink instance](https://sourcey-shlink.pages.dev/documentation/update-your-instance/index.md): Shlink is designed so that updating an installation to a newer version is as easy as possible, without loosing any data while doing it. - [Tracking visits](https://sourcey-shlink.pages.dev/documentation/tracking-visits/index.md): One of the most interesting features in Shlink is the visits tracking. - [Some features](https://sourcey-shlink.pages.dev/documentation/some-features/index.md): Here you'll find some extra Shlink features, which are not as evident, but you might still want to take advantage of. - [Environment variables](https://sourcey-shlink.pages.dev/documentation/environment-variables/index.md): After installing Shlink, you will have to set it up, and customize different aspects of its behavior. One way to do this is via environment variables. - [Long-running tasks](https://sourcey-shlink.pages.dev/documentation/long-running-tasks/index.md): There are a few tasks Shlink needs to perform which are too heavy or time-consuming to be executed when a user visits a short URL. - [Advanced usage](https://sourcey-shlink.pages.dev/documentation/advanced/index.md): At this point you probably have Shlink already up and running. However, there's still some advanced features you might find useful. - [Dynamic rule-based redirects system](https://sourcey-shlink.pages.dev/documentation/advanced/dynamic-rule-based-redirects-system/index.md): Shlink 4.0.0 introduced a new system to dynamically redirect visitors to different long URLs based on runtime conditions. - [Special redirects](https://sourcey-shlink.pages.dev/documentation/advanced/special-redirects/index.md): There are some cases in which Shlink can receive "invalid" requests. When this happens, the default behavior is to return a 404 status with a "Not Found" template. - [Using multiple domains](https://sourcey-shlink.pages.dev/documentation/advanced/multiple-domains/index.md): While in many cases you will just have one short domain, and you'll want all your short URLs to be served from it, there are some cases in which you may want to have multiple short domains served from the same Shlink instance. - [Import short URLs](https://sourcey-shlink.pages.dev/documentation/advanced/import-short-urls/index.md): Since it's quite possible that you are already using some other URL shortener, starting with v2.4.0, it is possible to import short URLs directly into Shlink. - [Real-time updates](https://sourcey-shlink.pages.dev/documentation/advanced/real-time-updates/index.md): Once your Shlink instance is set up, you may want to enable real-time updates to notify third parties when certain events occur. - [Using Redis or Valkey](https://sourcey-shlink.pages.dev/documentation/advanced/using-redis-or-valkey/index.md): Shlink can take advantage of a shared cache server like redis or valkey in multiple contexts. - [Exposing Shlink through a reverse proxy](https://sourcey-shlink.pages.dev/documentation/advanced/exposing-through-reverse-proxy/index.md): When you are serving Shlink with RoadRunner or using the docker image, you'll probably want to put a reverse proxy in front of it. - [Send visits to Matomo](https://sourcey-shlink.pages.dev/documentation/advanced/send-visits-to-matomo/index.md): Starting with v3.7.0, Shlink can send every visit to a Matomo instance of your choice. - [Shlink architecture](https://sourcey-shlink.pages.dev/documentation/advanced/shlink-architecture/index.md): While building and evolving Shlink and its ecosystem, some architecture decisions have been made. - [Command Line Interface](https://sourcey-shlink.pages.dev/documentation/command-line-interface/index.md): Due to the project's architecture, and the lack of an integrated GUI, Shlink provides a couple of command line tools that can be used to install or update Shlink instances, or even completely manage Shlink as a whole (create short URLs, see visits, manage domains, etc). - [CLI Entry point](https://sourcey-shlink.pages.dev/documentation/command-line-interface/entry-point/index.md): Shlink provides a CLI entry point which exposes a set of commands to perform a variety of operations. From creating, updating or listing short URLs, to manage API keys or handle your domains. - [Installation tool](https://sourcey-shlink.pages.dev/documentation/command-line-interface/installation-tool/index.md): Shlink provides a helper CLI installation tool which comes in handy to configure your instance when you are not using Shlink's docker image, and you prefer not to use environment variables. - [REST API](https://sourcey-shlink.pages.dev/documentation/api-docs/index.md): Shlink provides a REST API that can be used to integrate the short URLs management on any consuming system or application. - [Authentication](https://sourcey-shlink.pages.dev/documentation/api-docs/authentication/index.md): All endpoints require authentication. In order to do it, always provide a X-Api-Key: {api_key} header on every request. - [Error management](https://sourcey-shlink.pages.dev/documentation/api-docs/error-management/index.md): Shlink's REST API implements the Problem Details standard for error management. - [API key roles](https://sourcey-shlink.pages.dev/documentation/api-docs/api-key-roles/index.md): Starting with v2.5.0, Shlink allows attaching certain roles to API keys, in order to limit the actions they can do. - [Shlink web client](https://sourcey-shlink.pages.dev/documentation/shlink-web-client/index.md): Shlink web client (aka shlink-web-client) is the official Progressive Web Application for Shlink. - [Installation](https://sourcey-shlink.pages.dev/documentation/shlink-web-client/installation/index.md): There are three ways in which you can use Shlink web client. The Free hosted one does not actually require installation. - [Serve in sub path](https://sourcey-shlink.pages.dev/documentation/shlink-web-client/serve-in-sub-path/index.md): Official distributable files and docker images have been built so that they are served from the root of a domain. - [Pre-configuring servers](https://sourcey-shlink.pages.dev/documentation/shlink-web-client/pre-configuring-servers/index.md): The first time you access shlink-web-client from a browser, you will have to configure the list of shlink servers you want to manage, and they will be saved in the local storage. - [Integrations](https://sourcey-shlink.pages.dev/documentation/integrations/index.md): Since Shlink exposes a REST API, it is possible to use it to integrate it with third party services. - [Short Menu for Mac](https://sourcey-shlink.pages.dev/documentation/integrations/short-menu-mac/index.md): You can download Short Menu for Mac from their official website. - [Short Menu for iOS](https://sourcey-shlink.pages.dev/documentation/integrations/short-menu-ios/index.md): You can download Short Menu for iOS from the App Store. - [GNOME Shell extension](https://sourcey-shlink.pages.dev/documentation/integrations/gnome-shell-extension/index.md): You can install the GNOME extension for Shlink from extensions.gnome.org or any Software Center application that supports installing GNOME Shell extensions. - [Microsoft PowerToys run](https://sourcey-shlink.pages.dev/documentation/integrations/microsoft-power-toys-run/index.md): As described in their website, Microsoft PowerToys run is a quick launcher for Windows power users. - [Shlink iOS shortcut](https://sourcey-shlink.pages.dev/documentation/integrations/shlink-ios-shortcut/index.md): Create an iOS shortcut to generate short URLs with your Shlink instance, from ycy-0510. - [Troubleshooting](https://sourcey-shlink.pages.dev/documentation/troubleshooting/index.md): These are some common issues that people have reported when using Shlink, together with questions that people ask with a higher frequency. ## API Reference - [Shlink REST API](https://sourcey-shlink.pages.dev/documentation/api/index.md): Shlink, the self-hosted URL shortener - [List short URLs](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-short-urls-get.md): Returns the list of short URLs. - [Create short URL](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-short-urls-post.md): Creates a new short URL. Param findIfExists: This new param allows to force shlink to return existing short URLs when found based on provided params, instead of creating a new one. However, it might add complexity and have unexpected outputs. - [Create a short URL](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-short-urls-shorten-get.md): [Deprecated] Use Create short URL instead - [Parse short code](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-short-urls-shortcode-get.md): Get the long URL behind a short URL's short code. - [Delete short URL](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-short-urls-shortcode-delete.md): Deletes the short URL for provided short code. - [Edit short URL](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-short-urls-shortcode-patch.md): Update certain meta arguments from an existing short URL. - [List short URL redirect rules](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-short-urls-shortcode-redirect-rules-get.md): Returns the list of redirect rules for a short URL. - [Set short URL redirect rules](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-short-urls-shortcode-redirect-rules-post.md): Sets redirect rules for a short URL, with priorities matching the order in which they are provided. - [List existing tags](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-tags-get.md): Returns the list of all tags used in any short URL - [Rename tag](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-tags-put.md): Renames one existing tag - [Delete tags](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-tags-delete.md): Deletes provided list of tags - [Get tags with stats](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-tags-stats-get.md): Returns the list of all tags used in any short URL, together with the amount of short URLs and visits for it - [Get general visits stats](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-visits-get.md): Get general visits stats not linked to one specific short URL. - [List visits for short URL](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-short-urls-shortcode-visits-get.md): Get the list of visits on the short URL behind provided short code. - [Delete visits for short URL](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-short-urls-shortcode-visits-delete.md): Delete all existing visits on the short URL behind provided short code. - [List visits for tag](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-tags-tag-visits-get.md): Get the list of visits on any short URL which is tagged with provided tag. - [List visits for domain](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-domains-domain-visits-get.md): Get the list of visits on any short URL which belongs to provided domain. - [List orphan visits](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-visits-orphan-get.md): Get the list of visits to invalid short URLs, the base URL or any other 404. - [Delete orphan visits](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-visits-orphan-delete.md): Delete all visits to invalid short URLs, the base URL or any other 404. - [List non-orphan visits](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-visits-non-orphan-get.md): Get the list of visits to any short URL. - [List configured domains](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-domains-get.md): Returns the list of all domains that have been either used for some short URL, or have explicitly configured redirects. It also includes the domain redirects, plus the default redirects that will be used for any non-explicitly-configured one. - [Sets domain "not found" redirects](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-domains-redirects-patch.md): Sets the URLs that you want a visitor to get redirected to for "not found" URLs for a specific domain - [Get mercure integration info](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-v-version-mercure-info-get.md): Returns information to consume updates published by Shlink on a mercure hub. https://mercure.rocks/ - [Check healthiness](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-rest-health-get.md): Checks the healthiness of the service, making sure it can access required resources. - [Short URL](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-shortcode-get.md): Represents a short URL. Tracks the visit and redirects tio the corresponding long URL - [Short URL tracking pixel](https://sourcey-shlink.pages.dev/documentation/api/operations/operation-shortcode-track-get.md): Generates a 1px transparent image which can be used to track emails with a short URL