How to Install Shaarli on Debian Latest
Shaarli is a popular bookmarking platform that allows you to easily save and tag links for future reference. In this tutorial, we will guide you through the process of installing Shaarli on Debian Latest.
Prerequisites
Before you proceed with the installation, make sure your Debian system meets the following requirements:
- A non-root user with sudo privileges.
- Apache or Nginx installed and running.
- PHP 7.2 or later installed.
- MySQL or MariaDB installed.
Step 1: Update the System
First, update the system packages to the latest version using the following command:
sudo apt-get update
sudo apt-get upgrade
Step 2: Install Required Packages
Next, we need to install the required packages for Shaarli. Run the following command to install them:
sudo apt-get install git curl php7.4-curl php7.4-gd php7.4-xml php7.4-mbstring php7.4-sqlite3
Step 3: Download Shaarli
Now, clone Shaarli's GitHub repository into a directory on your system using the following command:
cd /var/www/
sudo git clone https://github.com/shaarli/Shaarli.git
Step 4: Configure Web Server
Apache
If you're using Apache, create a new virtual host for Shaarli with the following command:
sudo nano /etc/apache2/sites-available/shaarli.conf
Add the following content to the file and save it:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/Shaarli
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Enable the site with the following command:
sudo a2ensite shaarli.conf
Finally, restart Apache:
sudo systemctl restart apache2
Nginx
For Nginx, create a new server block configuration file with the following command:
sudo nano /etc/nginx/sites-available/shaarli.conf
Add the following content to the file and save it:
server {
listen 80;
server_name example.com;
root /var/www/Shaarli;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php;
}
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 30d;
}
location ~ /\. {
deny all;
}
}
Replace example.com with your own domain name.
Enable the site file with the following command:
sudo ln -s /etc/nginx/sites-available/shaarli.conf /etc/nginx/sites-enabled/shaarli.conf
Finally, restart Nginx:
sudo service nginx restart
Step 5: Install Shaarli
In your web browser, go to the URL http://your_server_ip/ or http://your_domain_name/ if you have one set up. You will see the Shaarli installation page. Follow the prompts to complete the installation process.
Once the installation is complete, delete the setup/ directory for security reasons:
sudo rm -r /var/www/Shaarli/setup/
Congratulations! You have successfully installed Shaarli on Debian Latest. You can now start using it to manage your bookmarks.