Install using a dist file

If you are going to host Shlink yourself, you need to make sure your server fulfils its requirements:

  • PHP 8.2 or 8.3
  • The next PHP extensions: json, curl, pdo, intl, gd and gmp/bcmath.
    • apcu extension is recommended if you don’t plan to use openswoole or RoadRunner.
    • xml extension is required if you want to generate QR codes in svg format.
    • sockets and bcmath extensions are required if you want to integrate with a RabbitMQ instance, or use RoadRunner to serve Shlink.
  • 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 or pdo_sqlsrv.
  • One of the supported runtimes.

Installation steps

  • Download the latest distributable file and decompress it at the location of your choice (you will find a pair of dist files for every supported PHP version, one for openswoole and one for non-openswoole contexts).
  • Create an empty database (not necessary if you are going to use SQLite).
  • Recursively grant write permissions to the data directory.
  • Set-up and customize Shlink by either:
    • Running the installation tool (vendor/bin/shlink-installer install). It’s an interactive tool that will guide you through the installation process.
    • Providing your configuration via env vars (since v2.9.0). Useful to pre-define the configuration or if you don’t have shell access to the server.
  • Optionally, you can create a symlink to the bin/cli script in a folder which is in your path.
    For example /usr/local/bin for linux systems. This will allow you to easily run Shlink from anywhere in the command line.
  • Generate your first API key (you will need it in order to interact with Shlink’s API):
    • For Shlink older than 3.3.0, run bin/cli api-key:generate.
    • For Shlink 3.3.0 or newer, the installation tool will create an API key for you. Just copy-paste it.
  • Set-up Shlink’s runtime:
  • Finally, access to https://app.shlink.io and configure your server to start creating short URLs.