How to Install Shaarli on Pop!_OS Latest Version

Shaarli is a free, open-source, and self-hosted bookmark manager that allows users to save, share and search links with ease. In this tutorial, we will guide you through the process of installing and setting up Shaarli on Pop!_OS latest version.

Prerequisites

Step 1: Update System Packages

Before installing any new software, it’s recommended to update your system packages to their latest versions for security reasons. You can do this by running the following command:

sudo apt update && sudo apt upgrade -y

Step 2: Install Apache and PHP

Shaarli requires a web server and PHP to function. We will install Apache and PHP along with the required extensions using the following command:

sudo apt install apache2 php php-cli php-mbstring php-gd php-xml php-curl -y

Once installed, you can check the Apache and PHP versions using the following commands:

apache2 -v
php --version

Step 3: Install MariaDB

Shaarli requires a database to store user information and bookmarks. In this tutorial, we will use MariaDB as our database server. You can install MariaDB using the following command:

sudo apt install mariadb-server -y

Once installed, start the MariaDB service and enable it to start automatically on system boot:

sudo systemctl start mariadb
sudo systemctl enable mariadb 

Now, we need to secure the MariaDB installation by running the following command:

sudo mysql_secure_installation

When prompted, enter a secure password for the root user, and answer yes to all other questions.

Step 4: Create a MariaDB database and user

We need to create a MariaDB database and user for Shaarli. You can do this by logging into the MariaDB shell using the following command:

sudo mysql -u root -p

Enter the root password when prompted, and then run the following commands to create a database and user:

CREATE DATABASE shaarli_db;
CREATE USER 'shaarli_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON shaarli_db.* TO 'shaarli_user'@'localhost';
FLUSH PRIVILEGES;
exit;

Note: Replace "your_password" with a strong, secure password for the shaarli_user account.

Step 5: Download and Install Shaarli

Clone the Shaarli repository from GitHub using the following command:

sudo git clone https://github.com/shaarli/Shaarli.git /var/www/html/shaarli

Change the ownership of the Shaarli directory to the apache user:

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

Configure Apache to serve Shaarli by creating a new virtual host file in the /etc/apache2/sites-available/ directory:

sudo nano /etc/apache2/sites-available/shaarli.conf

Paste the following configuration into the file and save it:

<VirtualHost *:80>
ServerAdmin webmaster@example.com
DocumentRoot /var/www/html/shaarli
ServerName shaarli.example.com
ServerAlias www.shaarli.example.com

<Directory /var/www/html/shaarli>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Note: Replace "shaarli.example.com" and "www.shaarli.example.com" with your domain name.

Now enable the virtual host file and restart Apache:

sudo a2ensite shaarli.conf
sudo systemctl restart apache2

Navigate to http://shaarli.example.com/ in your web browser to complete the Shaarli installation process.

Follow the on-screen instructions to configure the database connection, administrator account, and other settings.

Conclusion

In this tutorial, we have shown you how to install and set up Shaarli on your Pop!_OS latest version. You can now use Shaarli to manage your bookmarks, share links and collaborate with others.

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!