How to Install Shaarli on Fedora Server

Shaarli is an open-source bookmarking application that allows you to bookmark and share links with ease. In this tutorial, we will walk you through the process of installing Shaarli on Fedora Server.

Prerequisites

Before you begin, ensure that you have the following:

Step 1: Update the System

Before installing any new package, update the system with the latest updates and packages by running the following command:

sudo dnf update -y

Step 2: Install Required Packages

Shaarli requires some packages and dependencies to run correctly. Install these packages by running the following command:

sudo dnf install -y curl git unzip php php-cli php-curl php-pdo php-gd php-mbstring php-xml php-zip

Step 3: Install Nginx Web Server

Shaarli requires a webserver to serve webpages. In this tutorial, we will use Nginx as the webserver.

Install Nginx by running the following command:

sudo dnf install -y nginx

Start and enable Nginx to run at boot:

sudo systemctl start nginx
sudo systemctl enable nginx

Step 4: Install MariaDB Database Server

Shaarli requires a database to store its data. In this tutorial, we will use the MariaDB database server.

Install MariaDB by running the following command:

sudo dnf install -y mariadb mariadb-server

Start and enable MariaDB to run at boot:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the following command to secure your MariaDB installation:

sudo mysql_secure_installation

Answer the prompts as shown in the output below:

Securing the MariaDB server deployment.

Enter password for user root: 
VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: n 
Please set the password for root here.

New password: 

Re-enter new password: 

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Success.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done! 

Step 5: Install PHP Composer

Shaarli requires PHP Composer to manage its dependencies.

Install PHP Composer by running the following command:

sudo dnf install -y composer

Step 6: Install Shaarli

Now, we can download and install Shaarli. Change to the Nginx web server document root directory:

cd /usr/share/nginx/html

Download the latest version of Shaarli from the Github repository by running the following command:

sudo curl -L https://github.com/shaarli/Shaarli/releases/latest/download/shaarli-vX.X.X.zip -o shaarli.zip

Replace X.X.X with the latest release version number.

Unzip the downloaded file:

sudo unzip shaarli.zip

Rename the extracted directory to shaarli:

sudo mv shaarli-vX.X.X shaarli

Change permissions on the shaarli directory to allow Nginx to access it:

sudo chown -R nginx:nginx /usr/share/nginx/html/

Step 7: Configure Nginx for Shaarli

Create a new Nginx configuration file for Shaarli:

sudo nano /etc/nginx/conf.d/shaarli.conf

Add the following configuration settings to the file:

server {
    listen 80;
    server_name shaarli.example.com; # Replace with your domain name
    root /usr/share/nginx/html/shaarli;

    index index.php;

    # PHP-FPM configuration
    location ~* \.php$ {
        try_files $uri =404;
        fastcgi_pass unix:/run/php-fpm/www.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    # Static files
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    # Hide some files from web access
    location ~ /(config|content/meta|tests|var)/ {
        deny all;
        return 404;
    }

    # Include recommended SSL configuration for HTTPS
    # SSL configuration
}

Save and exit the file.

Verify Nginx configuration:

sudo nginx -t

If successful, reload Nginx to apply the new configuration:

sudo systemctl reload nginx

Step 8: Setup Shaarli

Open your web browser and navigate to your domain name or server IP address. You should see the Shaarli setup page.

Shaarli Setup Page

Follow the prompts to set up your Shaarli instance.

On the next page, enter your MariaDB credentials:

Click "Next."

On the final page, choose your privacy settings and click "Finish Setup."

You can now log in to your Shaarli instance and start bookmarking and sharing links.

Conclusion

In this tutorial, we have shown you how to install Shaarli on a Fedora Server Latest installation. Shaarli is a powerful and lightweight bookmarking application that makes it easy to manage and share links.

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!