Install Shaarli on your server

1 minute read

Shaarli is a self-hosted, open-source bookmark manager. This post explains how to install Shaarli on your server.



Having followed the set Setting up your own server: TODO

When you create the file /etc/apache2/sites-available/ use the following configuration:

<VirtualHost *:80>
    DocumentRoot /var/www/

    <Directory /var/www/>
            AllowOverride All
            Options Indexes FollowSymLinks MultiViews
            Order allow,deny
            allow from all

    LogLevel  warn
    ErrorLog  /var/log/apache2/shaarli-error.log
    CustomLog /var/log/apache2/shaarli-access.log combined

Then you can issue a ssl certificate with Let’s Encrypt. Note that you can choose ‘Expand’ if you want this site to use the previously generated SSL certificate. When running certbot to generate the certificate you must provide ALL the websites concerned by the SSL certificate (you have to give the website you might have already gave).

And don’t forget to enable the site with

sudo a2ensite /etc/apache2/sites-available/
sudo service apache2 reload

Server requirements


Shaarli uses Composer to resolve and install third-party PHP dependencies. You can see how to install composer here


  • openssl
  • php-gd : thumbnail resizing
  • php-intl : localized text sorting (e.g. e->è->f)
  • php-curl : using cURL for fetching webpages and thumbnails in a more robust way
sudo apt-get install php-gd php-intl php-curl

Install Shaarli

We clone the project in /var/www/

mkdir /var/www/
chown -R $USER:$USER /var/www/
cd /var/www/
git clone -b v0.8 .

And then install/update third-party dependencies

composer install --no-dev
chown -R www-data:www-data /var/www/

Instal the material theme

The default theme is quite ugly. You can find a material theme here.

To install the material theme, you will have to download and extract the directory material into /var/www/

First, prepare the material directory:

cd /var/www/
mkdir material
cd material

Then download and extract the theme

sudo tar -xvf v0.8.3.tar.gz Shaarli-Material-0.8.3/material/
mv Shaarli-Material-0.8.3/material/* .
rm -r Shaarli-Material-0.8.3

To enable the theme:

  • Shaarli < v0.9.0: edit data/config.json.php and set the value of raintpl_tpl to the new theme name: “raintpl_tpl”: “tpl\/my-template\/”
  • Shaarli >= v0.9.0: select the theme through the Tools page

In our case we edit /var/www/ and modify it to have the line:

"raintpl_tpl": "tpl\/material\/"