Keep control over all your shortened URLs by serving them under your own domains with this simple yet powerful tool.

At a Glance:

Shlink is a PHP-based self-hosted URL shortener that allows you to create and serve shortened URLs under your own domain, with management via a REST API and command-line interface.

Overview:

Shlink is a self-hosted URL shortening service written in PHP. It is designed for users who need to run their own URL shortener under a custom domain, giving them full control over their shortened links. The project can be deployed with a Docker image or by using a pre-built distributable package on a server that meets its requirements for PHP 8.4+ and a supported database. Interaction with the service is primarily handled through a REST API or a command-line interface, both of which provide the core functionality for managing short URLs.

Key Decision Points:

  • Self-hosted deployment: Runs on your own infrastructure under a custom domain, requiring a server with PHP 8.4+ and a database like MySQL, PostgreSQL, or SQLite.

  • Primary interaction methods: Management is done entirely through a REST API or a command-line interface (CLI); a ready-to-use web client is available but hosted separately.

  • API key generation is CLI-only: The generation and management of API keys for programmatic access can only be performed via the command-line tool, not the REST API.

  • Database flexibility: Supports several databases including MySQL, MariaDB, PostgreSQL, Microsoft SQL Server, and SQLite.

Core Features:

  • Custom domain short URLs: Serves all shortened links under your own configured domain.

  • REST API: Provides a full API for creating and managing short URLs, with complete documentation and a sandbox environment for testing endpoints.

  • Command-line interface: A CLI tool (bin/cli) offers equivalent management capabilities to the API, with the sole exception of API key management which is exclusive to the CLI.

  • Multiple database support: Can be configured to use MySQL, MariaDB, PostgreSQL, Microsoft SQL Server, or SQLite for data storage.

  • Official Docker image: An official container image is available, configurable via environment variables for simplified deployment.

  • Distributable packages: Offers pre-bundled distribution files for different PHP versions, removing the need to build from source.

Use Cases:

  • Developers who need a programmatic URL shortener they can integrate into other applications via a REST API.

  • System administrators wanting to run a private, domain-branded link shortener on their own server.

Open-Source Alternative Value:

As a self-hosted solution, Shlink gives users the ability to run a URL shortening service on their own infrastructure, using their own domain, and with a choice of database backend. Its value as an open-source alternative comes from this operational independence and the transparent access to its source code. The software offers two distinct, well-documented management interfaces—a REST API and a CLI—allowing it to fit into both automated workflows and direct server administration. Deployment is flexible, supported through a Docker image and distributable packages.

ShareXLinkedInReddit

Related tools

Project stats

Stars

5,113

Forks

396

License

MIT

Metadata

Alternative to
Bitly
Shlink: Open Source Link Management & Shorteners Tool | BestAlternative