How to Install Shaarli on Linux Mint

Shaarli is a free and open-source link sharing platform designed to manage your bookmarks. It allows you to save, share, and organize links into folders and tags. In this tutorial, we will show you how to install Shaarli on Linux Mint.

Prerequisites

Steps to Install Shaarli on Linux Mint

Step 1: Install Apache, PHP, and MariaDB

Before installing Shaarli, you need to install some prerequisites to run it. First, update your system's package list and install Apache, PHP, and MariaDB using the following commands:

sudo apt update
sudo apt install apache2 mariadb-server php libapache2-mod-php php-gd php-mysql php-curl php-json php-mbstring

Once the packages are installed, start the Apache and MariaDB services and enable them to start at the boot time using the following commands:

sudo systemctl start apache2
sudo systemctl start mariadb
sudo systemctl enable apache2
sudo systemctl enable mariadb

Step 2: Create a Database and User for Shaarli

After installing the required packages, logged in to MariaDB using the following command:

sudo mysql -u root

Once you are logged in, create a new database and user for Shaarli using the following commands:

MariaDB [(none)]> CREATE DATABASE shaarli;
MariaDB [(none)]> CREATE USER 'shaarliuser'@'localhost' IDENTIFIED BY 'shaarlipassword';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON shaarli.* TO 'shaarliuser'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;

Replace shaarliuser and shaarlipassword with your preferred username and password.

Step 3: Download and Install Shaarli

Now that you have installed the prerequisites and created a database for Shaarli, you need to download and install Shaarli. For this, first, navigate to the Apache document root directory using the following command:

cd /var/www/html/

Next, download the Shaarli source code form its official website using the following command:

sudo wget https://github.com/shaarli/Shaarli/archive/master.zip

Once the download completes, extract the downloaded package using the following command:

sudo unzip master.zip -d shaarli

Now, change the ownership of the Shaarli directory to the Apache webserver using the following command:

sudo chown -R www-data:www-data shaarli/

Step 4: Configure Shaarli

After installing Shaarli, you need to configure it by editing the configuration file. For this, navigate to the Shaarli directory and copy the sample configuration file using the following command:

cd shaarli/
sudo cp config.php.example config.php

Next, open the Shaarli configuration file using the Nano text editor:

sudo nano config.php

Once the file is opened, update the following parameters in the file:

define('DATADIR',$ABSOLUTE_DATADIR."/shaarli");//The path to your URLLISTER data file.
define('BYPASS_PASSWORD', true); //Whether passwords are needed to access your bookmarks. Set to false to enable password protection.
define('PLUG_IN_CSS', '1.css'); //Your custom CSS file. Default is "1.css".
define('PLUG_IN_JS', '0.js'); //Your custom Javascript file. Default is "0.js".
define('ENABLE_XSRF', false); //Set to "true" to better protect yourself against XSRF. This won't work if you if you're behind Varnish, Nginx or a similar reverse proxy. See documentation for more information.
define('DELETE_OUTDATED_BOOKMARKS', true); //Set to "true" to periodically remove outdated bookmarks (default: 1 month). Note that this feature requires adequate server permissions.

Save and close the file.

Step 5: Access Shaarli

After completing all the above steps, restart the Apache service using the following command:

sudo systemctl restart apache2

Once the service is restarted, point your web browser to http://your-ip-address/shaarli to access Shaarli. You should see the Shaarli login screen as shown below:

Shaarli login screen

Use the username as "admin" and leave the password field blank to log in to Shaarli.

Once you are logged in, you can start adding bookmarks and organizing them into folders and tags.

Conclusion

That’s it! You have successfully installed Shaarli on Linux Mint. Now, you can manage your bookmarks with ease. If you face any issues while installing Shaarli, feel free to drop a comment below.

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!