A PHP command line tool used to install shlink

v5.1.0 2020-06-20 09:01 UTC


A PHP command line tool used to install shlink.

Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version License Paypal donate

Shlink installer


Install this tool using composer.

composer install shlinkio/shlink-installer


This is the command line tool used by shlink to guide you through the installation process.

The tool expects the active directory to be a valid shlink instance.

There are two main ways to run this tool:

  • Using the built-in CLI entry points.

    Run either vendor/bin/shlink-install or vendor/bin/shlink-update in order to install or update a shlink instance.

  • Using the bin/run.php helper script.

    This script returns two functions that can be used to either install or update a shlink instance.

    Just require it and invoke the appropriate function:

    [$install, $update] = require 'vendor/shlinkio/shlink-installer/bin/run.php';
    $install(); // To install
    $update(); // To update

Customize options

Questions to ask the user

In order to retain backwards compatibility, it is possible to configure the installer to ask just a specific subset of questions.

Add a configuration file including a configuration like this:



use Shlinkio\Shlink\Installer\Config\Option;

return [

    'installer' => [
        'enabled_options' => [


If installer.enabled_options is not provided at all, all the config options will be asked.

Commands to run after installation

After the user has been asked for all the config, the installer will run a set of scripts which will create/update the database, download assets, etc.

It is possible to overwrite those commands via configuration too, using a syntax like this:



return [

    'installer' => [
        'installation_commands' => [
            'db_create_schema' => [
                'command' => 'bin/shlink shlink:db:create',
            'db_migrate' => [
                'command' => 'bin/some-script some:command',
            'orm_proxies' => [
                'command' => '-v', // Just print PHP version


This example shows all the currently available commands. They are run in the order they have been set here.

Important: Take into consideration that all the commands must be PHP scripts, since the installer will prefix all of them with the php binary.