How to install Wallabag on Ubuntu using SQLite

Written by
Date: 2020-07-04 13:45:00 00:00


Introduction

Wallabag is an open source alternative for Pocket and similar services or tools, it is Open Source and you can run it on your server.

You can read my Wallabag review if you like.

Installation

Preparing the server

We will need to prepare the server first

sudo apt update && sudo apt upgrade

If the Kernel has been updated, a reboot is needed

sudo reboot

Now, some tools, in just one command

sudo apt install build-essential

We are going to need Nginx, PHP and Composer

sudo apt install php-fpm php-mysql php-bcmath php-xml php-zip php-curl php-mbstring php-gd php-tidy php-tokenizer php-gettext nginx composer	sqlite php7.2-sqlite3 certbot python-certbot-nginx

Optionally, you may want to install redis.

sudo apt install redis

Configure Nginx

We will be using Nginx to server Wallabag site.

mkdir -p /var/www/wallabag.foss.social/{public_html,logs}

Now, create the virtual server in the /etc/nginx/sites-available/wallabag.foss.social and put this inside.

server {
server_name wallabag.foss.social; # Change this to fit your needs
root /var/www/wallabag.foss.social/public_html/web;
access_log /var/www/wallabag.foss.social/logs/access.log;
error_log /var/www/wallabag.foss.social/logs/error.log;
location / {
    try_files $uri /app.php$is_args$args;
}
location ~ ^/app\.php(/|$) {
    fastcgi_pass unix:/run/php/php7.2-fpm.sock; # Change this to fit your needs
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
    fastcgi_param DOCUMENT_ROOT $realpath_root;
    internal;
}
}

And now create a link to /etc/nginx/sites-enabled/

sudo ln -s /etc/nginx/sites-available/wallabag.foss.social /etc/nginx/sites-enabled/wallabag.foss.social

Now let's install Wallabag

Get the source code

sudo git clone https://github.com/wallabag/wallabag.git /var/www/wallabag.foss.social/public_html/

Apply the right permissions to the directories

chown -R www-data:www-data /var/www/wallabag.foss.social

Switch to www-data user

sudo -u www-data /bin/bash

Perform the proper installation

cd /var/www/wallabag.foss.social/public_html/ && make install

And wait a little….

When asked… reply with this.

database_driver (pdo_mysql): pdo_sqlite 
database_driver_class (null): 
database_host (127.0.0.1): 
database_port (null): 
database_name (wallabag): 
database_user (root): 
database_password (null): 
database_path (null): /var/www/wallabag.foss.social/data          
database_table_prefix (wallabag_): 
database_socket (null): 
database_charset (utf8mb4): 
domain_name ('https://your-wallabag-url-instance.com'): https://wallabag.foss.social
mailer_transport (smtp): 
mailer_host (127.0.0.1): smtp.gmail.com
mailer_user (null): user@gmail.com
mailer_password (null): user-password
locale (en): 
secret (ovmpmAWXRCabNlMgzlzSGYYmtrghGv): 
twofactor_auth (true): false
twofactor_sender (no-reply@wallabag.org): user@gmail.com
fosuser_registration (true): 
fosuser_confirmation (true):      
from_email (no-reply@wallabag.org): user@gmail.com
rss_limit (50): 
rabbitmq_host (localhost): 
rabbitmq_port (5672): 
rabbitmq_user (guest): 
rabbitmq_password (guest): 
rabbitmq_prefetch_count (10): 
redis_scheme (tcp): 
redis_host (localhost): 
redis_port (6379): 
redis_path (null): 
redis_password (null): 

Reply yes, when asked to reset the database, and create the admin user.

Install ssl certificate

certbot --nginx -d wallabag.foss.social

Choose wheter you would like to redirect traffic from http to https, or not (I recommend yes), you should see something like this.

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Redirecting all traffic on port 80 to ssl in /etc/nginx/sites-enabled/wallabag.foss.social

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://wallabag.foss.social

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=wallabag.foss.social
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Restart Nginx

systemctl restart nginx

Test your site.

You should now be able to https://yourserver and see wallabag screen.

Wallabag web Interface