How to Install Shlink on POP! OS

This tutorial will guide you through the installation of Shlink, a self-hosted URL shortener, on the latest version of POP! OS.

Step 1: Update and Upgrade the System

Before installing any new application, it is always good to make sure that the system is up-to-date. Open the terminal and run the following commands:

sudo apt update
sudo apt upgrade

Step 2: Install Required Dependencies

Shlink requires several components to work. Install them using the following command:

sudo apt install apache2 mariadb-server libapache2-mod-php7.4 php7.4-cli php7.4-mysql php7.4-curl php7.4-mbstring php7.4-xml php7.4-intl

Step 3: Install Composer

Composer is a dependency manager for PHP that will be used to install Shlink. Run the following command to install Composer:

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Step 4: Download Shlink

Navigate to Shlink's official website (https://shlink.io) and download the latest version of the application. Extract the downloaded file using the following command:

tar xzvf shlink-X.X.X.tar.gz

Step 5: Install Shlink

Change your current directory to the extracted Shlink directory and run the following commands:

sudo composer install
cp .env.dist .env
bin/cli db:create
bin/cli db:migrate

This will install all required dependencies and create the database.

Step 6: Configure Apache

Create a new Apache virtual host configuration file and edit it with the following content:

<VirtualHost *:80>
    ServerName my.shlink.domain
    DocumentRoot /path/to/shlink/public
    <Directory /path/to/shlink/public>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Replace my.shlink.domain with your own domain name and the path to your Shlink installation in the DocumentRoot and Directory directives.

After editing the file, save it and enable the configuration with the following command:

sudo a2ensite shlink.conf

Step 7: Test Shlink

Restart Apache by running the following command:

sudo systemctl restart apache2

Visit your domain name in a web browser, and you should see the Shlink homepage. You can now create short URLs and start using the application.

Congratulations! You have successfully installed Shlink on your POP! OS system.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!